diff --git a/ChangeLog b/ChangeLog index 977738f1f..5855a3e6f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2002-05-20 Yoshinori K. Okuji + + * lib/device.c: Don't include linux/hdreg.h, linux/major.h, + or linux/kdev_t.h. + [__linux__] (HDIO_GETGEO): Defined. + [__linux__] (hd_geometry): Likewise. + [__linux__] (FLOPPY_MAJOR): Likewise. + [__linux__] (MINORBITS): Likewise. + [__linux__] (MAJOR): Likewise. + 2002-05-08 Yoshinori K. Okuji * netboot/fsys_tftp.c (tftp_read): Don't call buf_fill unless diff --git a/lib/device.c b/lib/device.c index 017a4e077..f130cad8f 100644 --- a/lib/device.c +++ b/lib/device.c @@ -1,7 +1,7 @@ /* device.c - Some helper functions for OS devices and BIOS drives */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. + * Copyright (C) 1999,2000,2001,2002 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -42,9 +42,27 @@ # include /* _llseek */ # endif /* (GLIBC < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR < 1)) */ # include /* ioctl */ -# include /* HDIO_GETGEO */ -# include /* FLOPPY_MAJOR */ -# include /* MAJOR */ +# ifndef HDIO_GETGEO +# define HDIO_GETGEO 0x0301 /* get device geometry */ +/* If HDIO_GETGEO is not defined, it is unlikely that hd_geometry is + defined. */ +struct hd_geometry +{ + unsigned char heads; + unsigned char sectors; + unsigned short cylinders; + unsigned long start; +}; +# endif /* ! HDIO_GETGEO */ +# ifndef FLOPPY_MAJOR +# 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)) +# endif /* ! MAJOR */ # ifndef CDROM_GET_CAPABILITY # define CDROM_GET_CAPABILITY 0x5331 /* get capabilities */ # endif /* ! CDROM_GET_CAPABILITY */