Module Name: src
Committed By: tsutsui
Date: Sat May 11 22:10:28 UTC 2024
Modified Files:
src/sys/sys: bootblock.h
src/usr.sbin/installboot/arch: hp300.c
Log Message:
Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html
> Use proper signedness for the LIF file system data structures.
mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.
To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/sys/bootblock.h
cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/installboot/arch/hp300.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/sys/bootblock.h
diff -u src/sys/sys/bootblock.h:1.58 src/sys/sys/bootblock.h:1.59
--- src/sys/sys/bootblock.h:1.58 Sat Apr 29 00:05:35 2017
+++ src/sys/sys/bootblock.h Sat May 11 22:10:27 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: bootblock.h,v 1.58 2017/04/29 00:05:35 nonaka Exp $ */
+/* $NetBSD: bootblock.h,v 1.59 2024/05/11 22:10:27 tsutsui Exp $ */
/*-
* Copyright (c) 2002-2004 The NetBSD Foundation, Inc.
@@ -949,41 +949,41 @@ struct apple_blockzeroblock {
/* volume header for "LIF" format volumes */
struct hp300_lifvol {
- int16_t vol_id;
- char vol_label[6];
- int32_t vol_addr;
- int16_t vol_oct;
- int16_t vol_dummy;
- int32_t vol_dirsize;
- int16_t vol_version;
- int16_t vol_zero;
- int32_t vol_huh1;
- int32_t vol_huh2;
- int32_t vol_length;
+ uint16_t vol_id;
+ char vol_label[6];
+ uint32_t vol_addr;
+ uint16_t vol_oct;
+ uint16_t vol_dummy;
+ uint32_t vol_dirsize;
+ uint16_t vol_version;
+ uint16_t vol_zero;
+ uint32_t vol_huh1;
+ uint32_t vol_huh2;
+ uint32_t vol_length;
};
/* LIF directory entry format */
struct hp300_lifdir {
- char dir_name[10];
- int16_t dir_type;
- int32_t dir_addr;
- int32_t dir_length;
- char dir_toc[6];
- int16_t dir_flag;
- int32_t dir_exec;
+ char dir_name[10];
+ uint16_t dir_type;
+ uint32_t dir_addr;
+ uint32_t dir_length;
+ char dir_toc[6];
+ uint16_t dir_flag;
+ uint32_t dir_exec;
};
/* load header for boot rom */
struct hp300_load {
- int32_t address;
- int32_t count;
+ uint32_t address;
+ uint32_t count;
};
-#define HP300_VOL_ID -32768
+#define HP300_VOL_ID 0x8000 /* always $8000 */
#define HP300_VOL_OCT 4096
-#define HP300_DIR_TYPE -5822
-#define HP300_DIR_FLAG 0x8001 /* dont ask me! */
+#define HP300_DIR_TYPE 0xe942 /* "SYS9k Series 9000" */
+#define HP300_DIR_FLAG 0x8001 /* don't ask me! */
#define HP300_SECTSIZE 256
Index: src/usr.sbin/installboot/arch/hp300.c
diff -u src/usr.sbin/installboot/arch/hp300.c:1.17 src/usr.sbin/installboot/arch/hp300.c:1.18
--- src/usr.sbin/installboot/arch/hp300.c:1.17 Sun Dec 5 05:01:50 2021
+++ src/usr.sbin/installboot/arch/hp300.c Sat May 11 22:10:27 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: hp300.c,v 1.17 2021/12/05 05:01:50 msaitoh Exp $ */
+/* $NetBSD: hp300.c,v 1.18 2024/05/11 22:10:27 tsutsui Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#if !defined(__lint)
-__RCSID("$NetBSD: hp300.c,v 1.17 2021/12/05 05:01:50 msaitoh Exp $");
+__RCSID("$NetBSD: hp300.c,v 1.18 2024/05/11 22:10:27 tsutsui Exp $");
#endif /* !__lint */
/* We need the target disklabel.h, not the hosts one..... */
@@ -167,11 +167,12 @@ hp300_setboot(ib_params *params)
/* Relocate files, sanity check LIF directory on the way */
lifdir = (void *)(bootstrap + HP300_SECTSIZE * 2);
for (i = 0; i < 8; lifdir++, i++) {
- int32_t addr = be32toh(lifdir->dir_addr);
- int32_t limit = (params->s1stat.st_size - 1) / HP300_SECTSIZE + 1;
- int32_t end = addr + be32toh(lifdir->dir_length);
+ uint32_t addr = be32toh(lifdir->dir_addr);
+ uint32_t limit = (params->s1stat.st_size - 1) / HP300_SECTSIZE
+ + 1;
+ uint32_t end = addr + be32toh(lifdir->dir_length);
if (end > limit) {
- warnx("LIF entry %d larger (%d %d) than LIF file",
+ warnx("LIF entry %d larger (%u %u) than LIF file",
i, end, limit);
goto done;
}