2002-05-20 Yoshinori K. Okuji <okuji@enbug.org>

* 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.
This commit is contained in:
okuji 2002-05-20 09:45:33 +00:00
parent 1ed089ed1a
commit 2364cf3673
2 changed files with 32 additions and 4 deletions

View file

@ -1,3 +1,13 @@
2002-05-20 Yoshinori K. Okuji <okuji@enbug.org>
* 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 <okuji@enbug.org>
* netboot/fsys_tftp.c (tftp_read): Don't call buf_fill unless

View file

@ -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 <linux/unistd.h> /* _llseek */
# endif /* (GLIBC < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR < 1)) */
# include <sys/ioctl.h> /* ioctl */
# include <linux/hdreg.h> /* HDIO_GETGEO */
# include <linux/major.h> /* FLOPPY_MAJOR */
# include <linux/kdev_t.h> /* 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 */