Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/sys Avoid 64bit math in the hppa first stage bootloader....



details:   https://anonhg.NetBSD.org/src/rev/80e7d55b305a
branches:  trunk
changeset: 373019:80e7d55b305a
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Jan 13 18:43:42 2023 +0000

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

diffstat:

 sys/arch/hppa/stand/xxboot/Makefile |   4 ++--
 sys/sys/types.h                     |  12 +++++++++++-
 2 files changed, 13 insertions(+), 3 deletions(-)

diffs (45 lines):

diff -r e39a2908c835 -r 80e7d55b305a sys/arch/hppa/stand/xxboot/Makefile
--- a/sys/arch/hppa/stand/xxboot/Makefile       Fri Jan 13 16:00:33 2023 +0000
+++ b/sys/arch/hppa/stand/xxboot/Makefile       Fri Jan 13 18:43:42 2023 +0000
@@ -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 @@
 # 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=
diff -r e39a2908c835 -r 80e7d55b305a sys/sys/types.h
--- a/sys/sys/types.h   Fri Jan 13 16:00:33 2023 +0000
+++ b/sys/sys/types.h   Fri Jan 13 18:43:42 2023 +0000
@@ -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 @@
 #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



Home | Main Index | Thread Index | Old Index