From 30c826451d3e5bbc6e11bba0e7fee5d2f49d9b75 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 15 Oct 2007 17:13:22 -0700 Subject: [x86] remove uses of magic macros for boot_params access Instead of using magic macros for boot_params access, simply use the boot_params structure. Signed-off-by: H. Peter Anvin --- include/asm-x86/Kbuild | 1 - include/asm-x86/bootparam.h | 3 +++ include/asm-x86/bootsetup.h | 40 ---------------------------------------- include/asm-x86/setup_32.h | 29 ----------------------------- include/asm-x86/setup_64.h | 13 +++++++++++++ 5 files changed, 16 insertions(+), 70 deletions(-) delete mode 100644 include/asm-x86/bootsetup.h (limited to 'include') diff --git a/include/asm-x86/Kbuild b/include/asm-x86/Kbuild index c5e43cb3987..80744dbcfaf 100644 --- a/include/asm-x86/Kbuild +++ b/include/asm-x86/Kbuild @@ -1,7 +1,6 @@ include include/asm-generic/Kbuild.asm header-y += boot.h -header-y += bootsetup.h header-y += debugreg_32.h header-y += debugreg_64.h header-y += debugreg.h diff --git a/include/asm-x86/bootparam.h b/include/asm-x86/bootparam.h index b91b01783e4..ef67b59dbdb 100644 --- a/include/asm-x86/bootparam.h +++ b/include/asm-x86/bootparam.h @@ -14,6 +14,9 @@ struct setup_header { u16 root_flags; u32 syssize; u16 ram_size; +#define RAMDISK_IMAGE_START_MASK 0x07FF +#define RAMDISK_PROMPT_FLAG 0x8000 +#define RAMDISK_LOAD_FLAG 0x4000 u16 vid_mode; u16 root_dev; u16 boot_flag; diff --git a/include/asm-x86/bootsetup.h b/include/asm-x86/bootsetup.h deleted file mode 100644 index 7b1c3ad155f..00000000000 --- a/include/asm-x86/bootsetup.h +++ /dev/null @@ -1,40 +0,0 @@ - -#ifndef _X86_64_BOOTSETUP_H -#define _X86_64_BOOTSETUP_H 1 - -#define BOOT_PARAM_SIZE 4096 -extern char x86_boot_params[BOOT_PARAM_SIZE]; - -/* - * This is set up by the setup-routine at boot-time - */ -#define PARAM ((unsigned char *)x86_boot_params) -#define SCREEN_INFO (*(struct screen_info *) (PARAM+0)) -#define EXT_MEM_K (*(unsigned short *) (PARAM+2)) -#define ALT_MEM_K (*(unsigned int *) (PARAM+0x1e0)) -#define E820_MAP_NR (*(char*) (PARAM+E820NR)) -#define E820_MAP ((struct e820entry *) (PARAM+E820MAP)) -#define APM_BIOS_INFO (*(struct apm_bios_info *) (PARAM+0x40)) -#define DRIVE_INFO (*(struct drive_info_struct *) (PARAM+0x80)) -#define SYS_DESC_TABLE (*(struct sys_desc_table_struct*)(PARAM+0xa0)) -#define MOUNT_ROOT_RDONLY (*(unsigned short *) (PARAM+0x1F2)) -#define RAMDISK_FLAGS (*(unsigned short *) (PARAM+0x1F8)) -#define SAVED_VIDEO_MODE (*(unsigned short *) (PARAM+0x1FA)) -#define ORIG_ROOT_DEV (*(unsigned short *) (PARAM+0x1FC)) -#define AUX_DEVICE_INFO (*(unsigned char *) (PARAM+0x1FF)) -#define LOADER_TYPE (*(unsigned char *) (PARAM+0x210)) -#define KERNEL_START (*(unsigned int *) (PARAM+0x214)) -#define INITRD_START (*(unsigned int *) (PARAM+0x218)) -#define INITRD_SIZE (*(unsigned int *) (PARAM+0x21c)) -#define EDID_INFO (*(struct edid_info *) (PARAM+0x140)) -#define EDD_NR (*(unsigned char *) (PARAM+EDDNR)) -#define EDD_MBR_SIG_NR (*(unsigned char *) (PARAM+EDD_MBR_SIG_NR_BUF)) -#define EDD_MBR_SIGNATURE ((unsigned int *) (PARAM+EDD_MBR_SIG_BUF)) -#define EDD_BUF ((struct edd_info *) (PARAM+EDDBUF)) -#define COMMAND_LINE boot_command_line - -#define RAMDISK_IMAGE_START_MASK 0x07FF -#define RAMDISK_PROMPT_FLAG 0x8000 -#define RAMDISK_LOAD_FLAG 0x4000 - -#endif diff --git a/include/asm-x86/setup_32.h b/include/asm-x86/setup_32.h index 7862fe858a9..7a57ca8a179 100644 --- a/include/asm-x86/setup_32.h +++ b/include/asm-x86/setup_32.h @@ -34,35 +34,6 @@ */ extern struct boot_params boot_params; -#define PARAM ((char *)&boot_params) -#define SCREEN_INFO (*(struct screen_info *) (PARAM+0)) -#define EXT_MEM_K (*(unsigned short *) (PARAM+2)) -#define ALT_MEM_K (*(unsigned long *) (PARAM+0x1e0)) -#define E820_MAP_NR (*(char*) (PARAM+E820NR)) -#define E820_MAP ((struct e820entry *) (PARAM+E820MAP)) -#define APM_BIOS_INFO (*(struct apm_bios_info *) (PARAM+0x40)) -#define IST_INFO (*(struct ist_info *) (PARAM+0x60)) -#define SYS_DESC_TABLE (*(struct sys_desc_table *)(PARAM+0xa0)) -#define EFI_SYSTAB ((efi_system_table_t *) *((unsigned long *)(PARAM+0x1c4))) -#define EFI_MEMDESC_SIZE (*((unsigned long *) (PARAM+0x1c8))) -#define EFI_MEMDESC_VERSION (*((unsigned long *) (PARAM+0x1cc))) -#define EFI_MEMMAP ((void *) *((unsigned long *)(PARAM+0x1d0))) -#define EFI_MEMMAP_SIZE (*((unsigned long *) (PARAM+0x1d4))) -#define MOUNT_ROOT_RDONLY (*(unsigned short *) (PARAM+0x1F2)) -#define RAMDISK_FLAGS (*(unsigned short *) (PARAM+0x1F8)) -#define VIDEO_MODE (*(unsigned short *) (PARAM+0x1FA)) -#define ORIG_ROOT_DEV (*(unsigned short *) (PARAM+0x1FC)) -#define AUX_DEVICE_INFO (*(unsigned char *) (PARAM+0x1FF)) -#define LOADER_TYPE (*(unsigned char *) (PARAM+0x210)) -#define KERNEL_START (*(unsigned long *) (PARAM+0x214)) -#define INITRD_START (*(unsigned long *) (PARAM+0x218)) -#define INITRD_SIZE (*(unsigned long *) (PARAM+0x21c)) -#define EDID_INFO (*(struct edid_info *) (PARAM+0x140)) -#define EDD_NR (*(unsigned char *) (PARAM+EDDNR)) -#define EDD_MBR_SIG_NR (*(unsigned char *) (PARAM+EDD_MBR_SIG_NR_BUF)) -#define EDD_MBR_SIGNATURE ((unsigned int *) (PARAM+EDD_MBR_SIG_BUF)) -#define EDD_BUF ((struct edd_info *) (PARAM+EDDBUF)) - /* * Do NOT EVER look at the BIOS memory size location. * It does not work on many machines. diff --git a/include/asm-x86/setup_64.h b/include/asm-x86/setup_64.h index eaeff73d6c1..a04aadcccf6 100644 --- a/include/asm-x86/setup_64.h +++ b/include/asm-x86/setup_64.h @@ -3,4 +3,17 @@ #define COMMAND_LINE_SIZE 2048 +#ifdef __KERNEL__ + +#ifndef __ASSEMBLY__ +#include + +/* + * This is set up by the setup-routine at boot-time + */ +extern struct boot_params boot_params; + +#endif /* not __ASSEMBLY__ */ +#endif /* __KERNEL__ */ + #endif -- cgit v1.2.3 From 3ea335100014785fd2518461705654b200e58d00 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 16 Oct 2007 22:36:04 -0700 Subject: Remove magic macros for screen_info structure members Stop using magic macros for screen_info structure members. Signed-off-by: H. Peter Anvin --- include/linux/screen_info.h | 9 --------- 1 file changed, 9 deletions(-) (limited to 'include') diff --git a/include/linux/screen_info.h b/include/linux/screen_info.h index 3ee412bc00e..ba81ffe9958 100644 --- a/include/linux/screen_info.h +++ b/include/linux/screen_info.h @@ -47,15 +47,6 @@ struct screen_info { extern struct screen_info screen_info; -#define ORIG_X (screen_info.orig_x) -#define ORIG_Y (screen_info.orig_y) -#define ORIG_VIDEO_MODE (screen_info.orig_video_mode) -#define ORIG_VIDEO_COLS (screen_info.orig_video_cols) -#define ORIG_VIDEO_EGA_BX (screen_info.orig_video_ega_bx) -#define ORIG_VIDEO_LINES (screen_info.orig_video_lines) -#define ORIG_VIDEO_ISVGA (screen_info.orig_video_isVGA) -#define ORIG_VIDEO_POINTS (screen_info.orig_video_points) - #define VIDEO_TYPE_MDA 0x10 /* Monochrome Text Display */ #define VIDEO_TYPE_CGA 0x11 /* CGA Display */ #define VIDEO_TYPE_EGAM 0x20 /* EGA/VGA in Monochrome Mode */ -- cgit v1.2.3