diff options
29 files changed, 48 insertions, 72 deletions
diff --git a/lib/libdisk/create_chunk.c b/lib/libdisk/create_chunk.c index ac7a544..330ccc8 100644 --- a/lib/libdisk/create_chunk.c +++ b/lib/libdisk/create_chunk.c @@ -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 diff --git a/lib/libdisk/disk.c b/lib/libdisk/disk.c index d57e9cd..319a065 100644 --- a/lib/libdisk/disk.c +++ b/lib/libdisk/disk.c @@ -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> diff --git a/lib/libdisk/rules.c b/lib/libdisk/rules.c index a49c587..4d6c49f 100644 --- a/lib/libdisk/rules.c +++ b/lib/libdisk/rules.c @@ -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> diff --git a/lib/libdisk/write_alpha_disk.c b/lib/libdisk/write_alpha_disk.c index 7adf733..174bc8c 100644 --- a/lib/libdisk/write_alpha_disk.c +++ b/lib/libdisk/write_alpha_disk.c @@ -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" diff --git a/lib/libdisk/write_amd64_disk.c b/lib/libdisk/write_amd64_disk.c index 658fe23..f409ae4 100644 --- a/lib/libdisk/write_amd64_disk.c +++ b/lib/libdisk/write_amd64_disk.c @@ -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" diff --git a/lib/libdisk/write_disk.c b/lib/libdisk/write_disk.c index e56ed9d..8c2aa54 100644 --- a/lib/libdisk/write_disk.c +++ b/lib/libdisk/write_disk.c @@ -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" diff --git a/lib/libdisk/write_i386_disk.c b/lib/libdisk/write_i386_disk.c index 658fe23..f409ae4 100644 --- a/lib/libdisk/write_i386_disk.c +++ b/lib/libdisk/write_i386_disk.c @@ -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" diff --git a/lib/libdisk/write_ia64_disk.c b/lib/libdisk/write_ia64_disk.c index fe2b26c..33113e1 100644 --- a/lib/libdisk/write_ia64_disk.c +++ b/lib/libdisk/write_ia64_disk.c @@ -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" diff --git a/lib/libdisk/write_pc98_disk.c b/lib/libdisk/write_pc98_disk.c index ca4688b..c6bb687 100644 --- a/lib/libdisk/write_pc98_disk.c +++ b/lib/libdisk/write_pc98_disk.c @@ -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" diff --git a/sys/boot/alpha/libalpha/bootinfo.c b/sys/boot/alpha/libalpha/bootinfo.c index 60fd45d..cb41bfb 100644 --- a/sys/boot/alpha/libalpha/bootinfo.c +++ b/sys/boot/alpha/libalpha/bootinfo.c @@ -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> diff --git a/sys/boot/alpha/libalpha/srmdisk.c b/sys/boot/alpha/libalpha/srmdisk.c index d7b832d..fc96872 100644 --- a/sys/boot/alpha/libalpha/srmdisk.c +++ b/sys/boot/alpha/libalpha/srmdisk.c @@ -40,7 +40,6 @@ #include <stand.h> #include <sys/disklabel.h> -#include <sys/diskslice.h> #include <machine/stdarg.h> #include <machine/prom.h> diff --git a/sys/boot/arc/lib/arcdisk.c b/sys/boot/arc/lib/arcdisk.c index 116c07c..a6e99a9 100644 --- a/sys/boot/arc/lib/arcdisk.c +++ b/sys/boot/arc/lib/arcdisk.c @@ -40,7 +40,6 @@ #include <stand.h> #include <sys/disklabel.h> -#include <sys/diskslice.h> #include <machine/stdarg.h> diff --git a/sys/boot/arc/lib/bootinfo.c b/sys/boot/arc/lib/bootinfo.c index a0b858c..cea3b1b 100644 --- a/sys/boot/arc/lib/bootinfo.c +++ b/sys/boot/arc/lib/bootinfo.c @@ -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> diff --git a/sys/boot/common/commands.c b/sys/boot/common/commands.c index 75b60bc..be69606 100644 --- a/sys/boot/common/commands.c +++ b/sys/boot/common/commands.c @@ -28,7 +28,6 @@ #include <stand.h> #include <string.h> -#include <sys/reboot.h> #include "bootstrap.h" diff --git a/sys/boot/common/load_elf.c b/sys/boot/common/load_elf.c index cae8d24..63f5d64 100644 --- a/sys/boot/common/load_elf.c +++ b/sys/boot/common/load_elf.c @@ -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> diff --git a/sys/boot/i386/boot2/boot2.c b/sys/boot/i386/boot2/boot2.c index 50f8400..75216ed 100644 --- a/sys/boot/i386/boot2/boot2.c +++ b/sys/boot/i386/boot2/boot2.c @@ -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> diff --git a/sys/boot/i386/gptboot/gptboot.c b/sys/boot/i386/gptboot/gptboot.c index 50f8400..75216ed 100644 --- a/sys/boot/i386/gptboot/gptboot.c +++ b/sys/boot/i386/gptboot/gptboot.c @@ -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> diff --git a/sys/boot/i386/libi386/bioscd.c b/sys/boot/i386/libi386/bioscd.c index d957596..88f1c11 100644 --- a/sys/boot/i386/libi386/bioscd.c +++ b/sys/boot/i386/libi386/bioscd.c @@ -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> diff --git a/sys/boot/i386/libi386/biosdisk.c b/sys/boot/i386/libi386/biosdisk.c index ff41c1a..658a39c 100644 --- a/sys/boot/i386/libi386/biosdisk.c +++ b/sys/boot/i386/libi386/biosdisk.c @@ -40,7 +40,7 @@ #include <sys/disklabel.h> #include <sys/diskmbr.h> -#include <sys/reboot.h> +#include <machine/bootinfo.h> #include <stdarg.h> diff --git a/sys/boot/i386/libi386/elf32_freebsd.c b/sys/boot/i386/libi386/elf32_freebsd.c index c35cc5a..514183d 100644 --- a/sys/boot/i386/libi386/elf32_freebsd.c +++ b/sys/boot/i386/libi386/elf32_freebsd.c @@ -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> diff --git a/sys/boot/i386/libi386/elf64_freebsd.c b/sys/boot/i386/libi386/elf64_freebsd.c index c35cc5a..514183d 100644 --- a/sys/boot/i386/libi386/elf64_freebsd.c +++ b/sys/boot/i386/libi386/elf64_freebsd.c @@ -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> diff --git a/sys/boot/i386/libi386/elf_freebsd.c b/sys/boot/i386/libi386/elf_freebsd.c index c35cc5a..514183d 100644 --- a/sys/boot/i386/libi386/elf_freebsd.c +++ b/sys/boot/i386/libi386/elf_freebsd.c @@ -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> diff --git a/sys/boot/pc98/boot2/disk.c b/sys/boot/pc98/boot2/disk.c index f0eaf67..f8636eb 100644 --- a/sys/boot/pc98/boot2/disk.c +++ b/sys/boot/pc98/boot2/disk.c @@ -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 diff --git a/sys/boot/pc98/boot2/sys.c b/sys/boot/pc98/boot2/sys.c index eb65d33..9963ae5 100644 --- a/sys/boot/pc98/boot2/sys.c +++ b/sys/boot/pc98/boot2/sys.c @@ -33,7 +33,6 @@ #include "boot.h" #include <sys/dirent.h> -#include <sys/reboot.h> #if 0 /* #define BUFSIZE 4096 */ diff --git a/sys/boot/pc98/libpc98/biosdisk.c b/sys/boot/pc98/libpc98/biosdisk.c index d1427f9..dd251a7 100644 --- a/sys/boot/pc98/libpc98/biosdisk.c +++ b/sys/boot/pc98/libpc98/biosdisk.c @@ -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> diff --git a/sys/boot/sparc64/boot1/boot1.c b/sys/boot/sparc64/boot1/boot1.c index 1eeb556..b650f8b 100644 --- a/sys/boot/sparc64/boot1/boot1.c +++ b/sys/boot/sparc64/boot1/boot1.c @@ -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> diff --git a/sys/i386/include/bootinfo.h b/sys/i386/include/bootinfo.h index 620b313..475a09e 100644 --- a/sys/i386/include/bootinfo.h +++ b/sys/i386/include/bootinfo.h @@ -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_ */ diff --git a/sys/sys/diskslice.h b/sys/sys/diskslice.h index 13e0abb..40bc263 100644 --- a/sys/sys/diskslice.h +++ b/sys/sys/diskslice.h @@ -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_ */ diff --git a/sys/sys/reboot.h b/sys/sys/reboot.h index 0a45bcb..333950a 100644 --- a/sys/sys/reboot.h +++ b/sys/sys/reboot.h @@ -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 |