diff options
| author | Poul-Henning Kamp <phk@FreeBSD.org> | 2003-04-04 16:35:16 +0000 |
|---|---|---|
| committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2003-04-04 16:35:16 +0000 |
| commit | 197e5e73ef2943d90f1afc5317ade21513ea1bf3 (patch) | |
| tree | a6b84bed6839656a8003f724b1f2eec04ec03e0f | |
| parent | e0926f607fc9b00020145c48f3bdd31e8134e42e (diff) | |
Notes
29 files changed, 48 insertions, 72 deletions
diff --git a/lib/libdisk/create_chunk.c b/lib/libdisk/create_chunk.c index ac7a544e747f1..330ccc80ed4bd 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 d57e9cd0bf54b..319a0659fe0b0 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 a49c587afe735..4d6c49f5eaacf 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 7adf733fc5967..174bc8cbd1a75 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 658fe239829d8..f409ae432c737 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 e56ed9d707902..8c2aa54bcffef 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 658fe239829d8..f409ae432c737 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 fe2b26cea55af..33113e1a57aa1 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 ca4688ba36629..c6bb6870890cc 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 60fd45ddf92d8..cb41bfb709060 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 d7b832df41f05..fc96872f13dac 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 116c07cf455c2..a6e99a9ec1f88 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 a0b858c80ecdd..cea3b1b966e94 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 75b60bcdaca82..be696064fc3fa 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 cae8d2447a0d6..63f5d6418e190 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 50f84001fe299..75216ed414e64 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 50f84001fe299..75216ed414e64 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 d957596063cb6..88f1c115458b9 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 ff41c1ad57b45..658a39c0bda46 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 c35cc5acb6260..514183db144c2 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 c35cc5acb6260..514183db144c2 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 c35cc5acb6260..514183db144c2 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 f0eaf67505f23..f8636eb478809 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 eb65d33cbeec6..9963ae5d6703a 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 d1427f91ec84c..dd251a75480e2 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 1eeb5564bdd8a..b650f8b5c5228 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 620b31324a51f..475a09e08883a 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 13e0abbecb728..40bc263e12624 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 0a45bcba0495d..333950aa401ad 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 |
