Libdisk does not need to include <sys/diskslice.h> any more.

Move the remaining bits of <sys/diskslice.h> to <i386/include/bootinfo.h>

Move i386/pc98 specific bits from <sys/reboot.h> to
<i386/include/bootinfo.h> as well.

Adjust includes in sys/boot accordingly.
This commit is contained in:
phk 2003-04-04 16:35:16 +00:00
parent 4ea6a23f8d
commit 84d6b36e30
29 changed files with 48 additions and 72 deletions

View File

@ -19,7 +19,6 @@ __FBSDID("$FreeBSD$");
#include <stdarg.h>
#include <sys/param.h>
#include <sys/disklabel.h>
#include <sys/diskslice.h>
#ifdef PC98
#include <sys/diskpc98.h>
#else

View File

@ -23,7 +23,6 @@ __FBSDID("$FreeBSD$");
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/disklabel.h>
#include <sys/diskslice.h>
#include <sys/uuid.h>
#include <sys/gpt.h>
#include <paths.h>

View File

@ -15,7 +15,6 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/diskslice.h>
#include <sys/disklabel.h>
#ifdef PC98
#include <sys/diskpc98.h>

View File

@ -19,7 +19,6 @@ __FBSDID("$FreeBSD$");
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/disklabel.h>
#include <sys/diskslice.h>
#include <paths.h>
#include "libdisk.h"

View File

@ -18,7 +18,6 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/disklabel.h>
#include <sys/diskslice.h>
#include <sys/diskmbr.h>
#include <paths.h>
#include "libdisk.h"

View File

@ -19,7 +19,6 @@ __FBSDID("$FreeBSD$");
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/disklabel.h>
#include <sys/diskslice.h>
#include <paths.h>
#include "libdisk.h"

View File

@ -18,7 +18,6 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/disklabel.h>
#include <sys/diskslice.h>
#include <sys/diskmbr.h>
#include <paths.h>
#include "libdisk.h"

View File

@ -18,7 +18,6 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/disklabel.h>
#include <sys/diskslice.h>
#include <sys/diskmbr.h>
#include <paths.h>
#include "libdisk.h"

View File

@ -20,7 +20,6 @@ __FBSDID("$FreeBSD$");
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/disklabel.h>
#include <sys/diskslice.h>
#include <sys/diskpc98.h>
#include <paths.h>
#include "libdisk.h"

View File

@ -29,7 +29,6 @@
#include <stand.h>
#include <string.h>
#include <sys/param.h>
#include <sys/reboot.h>
#include <sys/linker.h>
#include <machine/elf.h>
#include <machine/prom.h>

View File

@ -40,7 +40,6 @@
#include <stand.h>
#include <sys/disklabel.h>
#include <sys/diskslice.h>
#include <machine/stdarg.h>
#include <machine/prom.h>

View File

@ -40,7 +40,6 @@
#include <stand.h>
#include <sys/disklabel.h>
#include <sys/diskslice.h>
#include <machine/stdarg.h>

View File

@ -29,7 +29,6 @@
#include <stand.h>
#include <string.h>
#include <sys/param.h>
#include <sys/reboot.h>
#include <sys/linker.h>
#include <machine/elf.h>
#include <machine/prom.h>

View File

@ -28,7 +28,6 @@
#include <stand.h>
#include <string.h>
#include <sys/reboot.h>
#include "bootstrap.h"

View File

@ -29,7 +29,6 @@
#include <sys/param.h>
#include <sys/exec.h>
#include <sys/reboot.h>
#include <sys/linker.h>
#include <sys/module.h>
#include <string.h>

View File

@ -18,8 +18,6 @@
*/
#include <sys/param.h>
#include <sys/reboot.h>
#include <sys/diskslice.h>
#include <sys/disklabel.h>
#include <sys/diskmbr.h>
#include <sys/dirent.h>

View File

@ -18,8 +18,6 @@
*/
#include <sys/param.h>
#include <sys/reboot.h>
#include <sys/diskslice.h>
#include <sys/disklabel.h>
#include <sys/diskmbr.h>
#include <sys/dirent.h>

View File

@ -40,7 +40,7 @@
#include <stand.h>
#include <sys/param.h>
#include <sys/reboot.h>
#include <machine/bootinfo.h>
#include <machine/psl.h>
#include <stdarg.h>

View File

@ -40,7 +40,7 @@
#include <sys/disklabel.h>
#include <sys/diskmbr.h>
#include <sys/reboot.h>
#include <machine/bootinfo.h>
#include <stdarg.h>

View File

@ -28,7 +28,6 @@
#include <sys/param.h>
#include <sys/exec.h>
#include <sys/reboot.h>
#include <sys/linker.h>
#include <string.h>
#include <machine/bootinfo.h>

View File

@ -28,7 +28,6 @@
#include <sys/param.h>
#include <sys/exec.h>
#include <sys/reboot.h>
#include <sys/linker.h>
#include <string.h>
#include <machine/bootinfo.h>

View File

@ -28,7 +28,6 @@
#include <sys/param.h>
#include <sys/exec.h>
#include <sys/reboot.h>
#include <sys/linker.h>
#include <string.h>
#include <machine/bootinfo.h>

View File

@ -43,8 +43,8 @@
#include "boot.h"
#include <sys/disklabel.h>
#include <sys/diskslice.h>
#include <sys/diskpc98.h>
#include <machine/bootinfo.h>
#define BIOS_DEV_FLOPPY 0x0
#define BIOS_DEV_WIN 0x80

View File

@ -33,7 +33,6 @@
#include "boot.h"
#include <sys/dirent.h>
#include <sys/reboot.h>
#if 0
/* #define BUFSIZE 4096 */

View File

@ -39,9 +39,8 @@
#include <stand.h>
#include <sys/disklabel.h>
#include <sys/diskslice.h>
#include <sys/diskpc98.h>
#include <sys/reboot.h>
#include <machine/bootinfo.h>
#include <stdarg.h>

View File

@ -20,8 +20,6 @@
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/reboot.h>
#include <sys/diskslice.h>
#include <sys/disklabel.h>
#include <sys/dirent.h>
#include <machine/elf.h>

View File

@ -71,4 +71,48 @@ struct bootinfo {
extern struct bootinfo bootinfo;
#endif
/*
* Constants for converting boot-style device number to type,
* adaptor (uba, mba, etc), unit number and partition number.
* Type (== major device number) is in the low byte
* for backward compatibility. Except for that of the "magic
* number", each mask applies to the shifted value.
* Format:
* (4) (4) (4) (4) (8) (8)
* --------------------------------
* |MA | AD| CT| UN| PART | TYPE |
* --------------------------------
*/
#define B_ADAPTORSHIFT 24
#define B_ADAPTORMASK 0x0f
#define B_ADAPTOR(val) (((val) >> B_ADAPTORSHIFT) & B_ADAPTORMASK)
#define B_CONTROLLERSHIFT 20
#define B_CONTROLLERMASK 0xf
#define B_CONTROLLER(val) (((val)>>B_CONTROLLERSHIFT) & B_CONTROLLERMASK)
#define B_SLICESHIFT 20
#define B_SLICEMASK 0xff
#define B_SLICE(val) (((val)>>B_SLICESHIFT) & B_SLICEMASK)
#define B_UNITSHIFT 16
#define B_UNITMASK 0xf
#define B_UNIT(val) (((val) >> B_UNITSHIFT) & B_UNITMASK)
#define B_PARTITIONSHIFT 8
#define B_PARTITIONMASK 0xff
#define B_PARTITION(val) (((val) >> B_PARTITIONSHIFT) & B_PARTITIONMASK)
#define B_TYPESHIFT 0
#define B_TYPEMASK 0xff
#define B_TYPE(val) (((val) >> B_TYPESHIFT) & B_TYPEMASK)
#define B_MAGICMASK 0xf0000000
#define B_DEVMAGIC 0xa0000000
#define MAKEBOOTDEV(type, adaptor, controller, unit, partition) \
(((type) << B_TYPESHIFT) | ((adaptor) << B_ADAPTORSHIFT) | \
((controller) << B_CONTROLLERSHIFT) | ((unit) << B_UNITSHIFT) | \
((partition) << B_PARTITIONSHIFT) | B_DEVMAGIC)
#define BASE_SLICE 2
#define COMPATIBILITY_SLICE 0
#define MAX_SLICES 32
#define WHOLE_DISK_SLICE 1
#endif /* !_MACHINE_BOOTINFO_H_ */

View File

@ -30,10 +30,6 @@
#define _SYS_DISKSLICE_H_
#ifndef sys_boot_code_has_been_fixed
#define BASE_SLICE 2
#define COMPATIBILITY_SLICE 0
#define MAX_SLICES 32
#define WHOLE_DISK_SLICE 1
#endif
#endif /* !_SYS_DISKSLICE_H_ */

View File

@ -66,43 +66,5 @@
#define RB_BOOTINFO 0x80000000 /* have `struct bootinfo *' arg */
/*
* Constants for converting boot-style device number to type,
* adaptor (uba, mba, etc), unit number and partition number.
* Type (== major device number) is in the low byte
* for backward compatibility. Except for that of the "magic
* number", each mask applies to the shifted value.
* Format:
* (4) (4) (4) (4) (8) (8)
* --------------------------------
* |MA | AD| CT| UN| PART | TYPE |
* --------------------------------
*/
#define B_ADAPTORSHIFT 24
#define B_ADAPTORMASK 0x0f
#define B_ADAPTOR(val) (((val) >> B_ADAPTORSHIFT) & B_ADAPTORMASK)
#define B_CONTROLLERSHIFT 20
#define B_CONTROLLERMASK 0xf
#define B_CONTROLLER(val) (((val)>>B_CONTROLLERSHIFT) & B_CONTROLLERMASK)
#define B_SLICESHIFT 20
#define B_SLICEMASK 0xff
#define B_SLICE(val) (((val)>>B_SLICESHIFT) & B_SLICEMASK)
#define B_UNITSHIFT 16
#define B_UNITMASK 0xf
#define B_UNIT(val) (((val) >> B_UNITSHIFT) & B_UNITMASK)
#define B_PARTITIONSHIFT 8
#define B_PARTITIONMASK 0xff
#define B_PARTITION(val) (((val) >> B_PARTITIONSHIFT) & B_PARTITIONMASK)
#define B_TYPESHIFT 0
#define B_TYPEMASK 0xff
#define B_TYPE(val) (((val) >> B_TYPESHIFT) & B_TYPEMASK)
#define B_MAGICMASK 0xf0000000
#define B_DEVMAGIC 0xa0000000
#define MAKEBOOTDEV(type, adaptor, controller, unit, partition) \
(((type) << B_TYPESHIFT) | ((adaptor) << B_ADAPTORSHIFT) | \
((controller) << B_CONTROLLERSHIFT) | ((unit) << B_UNITSHIFT) | \
((partition) << B_PARTITIONSHIFT) | B_DEVMAGIC)
#endif