From 84d6b36e309c74d75565793688f01807fb1340f6 Mon Sep 17 00:00:00 2001 From: phk Date: Fri, 4 Apr 2003 16:35:16 +0000 Subject: Libdisk does not need to include any more. Move the remaining bits of to Move i386/pc98 specific bits from to as well. Adjust includes in sys/boot accordingly. --- sys/boot/alpha/libalpha/bootinfo.c | 1 - sys/boot/alpha/libalpha/srmdisk.c | 1 - sys/boot/arc/lib/arcdisk.c | 1 - sys/boot/arc/lib/bootinfo.c | 1 - sys/boot/common/commands.c | 1 - sys/boot/common/load_elf.c | 1 - sys/boot/i386/boot2/boot2.c | 2 -- sys/boot/i386/gptboot/gptboot.c | 2 -- sys/boot/i386/libi386/bioscd.c | 2 +- sys/boot/i386/libi386/biosdisk.c | 2 +- sys/boot/i386/libi386/elf32_freebsd.c | 1 - sys/boot/i386/libi386/elf64_freebsd.c | 1 - sys/boot/i386/libi386/elf_freebsd.c | 1 - sys/boot/pc98/boot2/disk.c | 2 +- sys/boot/pc98/boot2/sys.c | 1 - sys/boot/pc98/libpc98/biosdisk.c | 3 +-- sys/boot/sparc64/boot1/boot1.c | 2 -- sys/i386/include/bootinfo.h | 44 +++++++++++++++++++++++++++++++++++ sys/sys/diskslice.h | 4 ---- sys/sys/reboot.h | 38 ------------------------------ 20 files changed, 48 insertions(+), 63 deletions(-) (limited to 'sys') 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 #include #include -#include #include #include #include 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 #include -#include #include #include 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 #include -#include #include 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 #include #include -#include #include #include #include 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 #include -#include #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 #include -#include #include #include #include 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 -#include -#include #include #include #include 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 -#include -#include #include #include #include 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 #include -#include +#include #include #include 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 #include -#include +#include #include 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 #include -#include #include #include #include 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 #include -#include #include #include #include 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 #include -#include #include #include #include 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 -#include #include +#include #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 -#include #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 #include -#include #include -#include +#include #include 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 -#include -#include #include #include #include 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 -- cgit v1.1