]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2004-01-17 Yoshinori K. Okuji <okuji@enbug.org>
authorokuji <okuji@localhost>
Sat, 17 Jan 2004 16:00:03 +0000 (16:00 +0000)
committerokuji <okuji@localhost>
Sat, 17 Jan 2004 16:00:03 +0000 (16:00 +0000)
* lib/device.c [__linux__] (MAJOR): Support 32 bit and 64 bit
dev_t. This code is stolen from glibc.
Suggested by Shen Feng <shen@nanjing-fnst.com>.

ChangeLog
NEWS
lib/device.c

index 326859ab4072887e8b842c426bdf557d45e5cf9a..68cbd602815a57701a4ca814430f4c5fe470d92a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-01-17  Yoshinori K. Okuji  <okuji@enbug.org>
+
+       * lib/device.c [__linux__] (MAJOR): Support 32 bit and 64 bit
+       dev_t. This code is stolen from glibc.
+       Suggested by Shen Feng <shen@nanjing-fnst.com>.
+
 2004-01-11  Yoshinori K. Okuji  <okuji@enbug.org>
 
        * stage2/terminfo.c (ti_set_term): Use a pointer to struct
diff --git a/NEWS b/NEWS
index 7de94e5c3068336c1b5533b4c1653411e221937d..e6f2a45e1e4b36e33373bfd7ce676e31381aa680 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,7 @@ New:
 * Display "GNU GRUB" instead of "GRUB" in the menu.
 * Add support for QNX RTP into the grub shell.
 * Add support for the initrd max address of a kernel header in Linux.
+* Support 32 bit and 64 bit dev_t.
 
 New in 0.93 - 2002-12-08:
 * Define the behavior of the boot loader when the load end address is
index 69a8dab4f405fca60704d9515fe0a0050bcd93e1..07f7d512d96696513a20e38cc3b0da917eae6dd2 100644 (file)
@@ -59,10 +59,12 @@ struct hd_geometry
 #  define FLOPPY_MAJOR 2       /* the major number for floppy */
 # endif /* ! FLOPPY_MAJOR */
 # ifndef MAJOR
-#  ifndef MINORBITS
-#   define MINORBITS   8
-#  endif /* ! MINORBITS */
-#  define MAJOR(dev)   ((unsigned int) ((dev) >> MINORBITS))
+#  define MAJOR(dev)   \
+  ({ \
+     unsigned long long __dev = (dev); \
+     (unsigned) ((__dev >> 8) & 0xfff) \
+                 | ((unsigned int) (__dev >> 32) & ~0xfff); \
+  })
 # endif /* ! MAJOR */
 # ifndef CDROM_GET_CAPABILITY
 #  define CDROM_GET_CAPABILITY 0x5331  /* get capabilities */