Module Name:    src
Committed By:   martin
Date:           Fri Jan 13 18:43:43 UTC 2023

Modified Files:
        src/sys/arch/hppa/stand/xxboot: Makefile
        src/sys/sys: types.h

Log Message:
Avoid 64bit math in the hppa first stage bootloader. Ok chs@


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/hppa/stand/xxboot/Makefile
cvs rdiff -u -r1.105 -r1.106 src/sys/sys/types.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/hppa/stand/xxboot/Makefile
diff -u src/sys/arch/hppa/stand/xxboot/Makefile:1.3 src/sys/arch/hppa/stand/xxboot/Makefile:1.4
--- src/sys/arch/hppa/stand/xxboot/Makefile:1.3	Tue Nov 13 21:22:38 2018
+++ src/sys/arch/hppa/stand/xxboot/Makefile	Fri Jan 13 18:43:43 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2018/11/13 21:22:38 skrll Exp $
+#	$NetBSD: Makefile,v 1.4 2023/01/13 18:43:43 martin Exp $
 
 NODEBUG=yes
 PROG=	xxboot
@@ -11,7 +11,7 @@ CPPFLAGS+=	-I${.CURDIR}/../../../.. -I. 
 # configuration for readufs module
 CPPFLAGS+=	-DUSE_LFS -DUSE_FFS -DUSE_UFS1 -DUSE_UFS2
 # IODC can handle only 2GB, so this is enough
-CPPFLAGS+=	-D__daddr_t=int32_t
+CPPFLAGS+=	-D__daddr_t=int32_t -D__ino_t=uint32_t
 # ANSI C feature prevents from being relocatable
 #CPPFLAGS+=	-traditional	# would be best
 CPPFLAGS+=	-Dconst=

Index: src/sys/sys/types.h
diff -u src/sys/sys/types.h:1.105 src/sys/sys/types.h:1.106
--- src/sys/sys/types.h:1.105	Sat May 16 18:31:53 2020
+++ src/sys/sys/types.h	Fri Jan 13 18:43:42 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.105 2020/05/16 18:31:53 christos Exp $	*/
+/*	$NetBSD: types.h,v 1.106 2023/01/13 18:43:42 martin Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1991, 1993, 1994
@@ -163,7 +163,17 @@ typedef	__gid_t		gid_t;		/* group id */
 #endif
 
 typedef	uint32_t	id_t;		/* group id, process id or user id */
+#ifdef __ino_t
+/*
+ * Some first stage bootloaders may want to avoid 64bit math, especially
+ * when the firmware can only access small disks/partitions anyway.
+ * Example: hppa/stand/xxboot
+ */
+typedef	__ino_t		ino_t;
+#undef __ino_t
+#else
 typedef	uint64_t	ino_t;		/* inode number */
+#endif
 typedef	long		key_t;		/* IPC key (for Sys V IPC) */
 
 #ifndef	mode_t

Reply via email to