blob: 0e8077cbfdac7da388789be548d599c0839b8fbf [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Just a place holder. We don't want to have to test x86 before
3 * we include stuff
4 */
5
6#ifndef _i386_SETUP_H
7#define _i386_SETUP_H
8
Alon Bar-Lev7bf9f972007-02-12 00:54:27 -08009#define COMMAND_LINE_SIZE 2048
Adrian Bunk7d1362c2006-12-06 20:40:38 -080010
David Woodhousef01f0f02006-09-12 20:36:05 -070011#ifdef __KERNEL__
Dave Hansen22a98352006-03-27 01:16:04 -080012#include <linux/pfn.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070013
14/*
15 * Reserved space for vmalloc and iomap - defined in asm/page.h
16 */
17#define MAXMEM_PFN PFN_DOWN(MAXMEM)
18#define MAX_NONPAE_PFN (1 << 20)
19
Venkatesh Pallipadif9ba7052005-05-01 08:58:51 -070020#define PARAM_SIZE 4096
Linus Torvalds1da177e2005-04-16 15:20:36 -070021
22#define OLD_CL_MAGIC_ADDR 0x90020
23#define OLD_CL_MAGIC 0xA33F
24#define OLD_CL_BASE_ADDR 0x90000
25#define OLD_CL_OFFSET 0x90022
26#define NEW_CL_POINTER 0x228 /* Relative to real mode data */
27
28#ifndef __ASSEMBLY__
29/*
30 * This is set up by the setup-routine at boot-time
31 */
32extern unsigned char boot_params[PARAM_SIZE];
33
34#define PARAM (boot_params)
35#define SCREEN_INFO (*(struct screen_info *) (PARAM+0))
36#define EXT_MEM_K (*(unsigned short *) (PARAM+2))
37#define ALT_MEM_K (*(unsigned long *) (PARAM+0x1e0))
38#define E820_MAP_NR (*(char*) (PARAM+E820NR))
39#define E820_MAP ((struct e820entry *) (PARAM+E820MAP))
40#define APM_BIOS_INFO (*(struct apm_bios_info *) (PARAM+0x40))
41#define IST_INFO (*(struct ist_info *) (PARAM+0x60))
42#define DRIVE_INFO (*(struct drive_info_struct *) (PARAM+0x80))
43#define SYS_DESC_TABLE (*(struct sys_desc_table_struct*)(PARAM+0xa0))
44#define EFI_SYSTAB ((efi_system_table_t *) *((unsigned long *)(PARAM+0x1c4)))
45#define EFI_MEMDESC_SIZE (*((unsigned long *) (PARAM+0x1c8)))
46#define EFI_MEMDESC_VERSION (*((unsigned long *) (PARAM+0x1cc)))
Matt Tolentino7ae65fd2005-09-03 15:56:27 -070047#define EFI_MEMMAP ((void *) *((unsigned long *)(PARAM+0x1d0)))
Linus Torvalds1da177e2005-04-16 15:20:36 -070048#define EFI_MEMMAP_SIZE (*((unsigned long *) (PARAM+0x1d4)))
49#define MOUNT_ROOT_RDONLY (*(unsigned short *) (PARAM+0x1F2))
50#define RAMDISK_FLAGS (*(unsigned short *) (PARAM+0x1F8))
51#define VIDEO_MODE (*(unsigned short *) (PARAM+0x1FA))
52#define ORIG_ROOT_DEV (*(unsigned short *) (PARAM+0x1FC))
53#define AUX_DEVICE_INFO (*(unsigned char *) (PARAM+0x1FF))
54#define LOADER_TYPE (*(unsigned char *) (PARAM+0x210))
55#define KERNEL_START (*(unsigned long *) (PARAM+0x214))
56#define INITRD_START (*(unsigned long *) (PARAM+0x218))
57#define INITRD_SIZE (*(unsigned long *) (PARAM+0x21c))
58#define EDID_INFO (*(struct edid_info *) (PARAM+0x140))
59#define EDD_NR (*(unsigned char *) (PARAM+EDDNR))
60#define EDD_MBR_SIG_NR (*(unsigned char *) (PARAM+EDD_MBR_SIG_NR_BUF))
61#define EDD_MBR_SIGNATURE ((unsigned int *) (PARAM+EDD_MBR_SIG_BUF))
62#define EDD_BUF ((struct edd_info *) (PARAM+EDDBUF))
63
Jeremy Fitzhardingee75eac32006-06-25 05:46:50 -070064/*
65 * Do NOT EVER look at the BIOS memory size location.
66 * It does not work on many machines.
67 */
68#define LOWMEMSIZE() (0x9f000)
69
70struct e820entry;
71
72char * __init machine_specific_memory_setup(void);
Rusty Russelld3561b72006-12-07 02:14:07 +010073char *memory_setup(void);
Jeremy Fitzhardingee75eac32006-06-25 05:46:50 -070074
75int __init copy_e820_map(struct e820entry * biosmap, int nr_map);
76int __init sanitize_e820_map(struct e820entry * biosmap, char * pnr_map);
77void __init add_memory_region(unsigned long long start,
78 unsigned long long size, int type);
79
Rusty Russell40d22c12007-02-13 13:26:26 +010080extern unsigned long init_pg_tables_end;
81
Linus Torvalds1da177e2005-04-16 15:20:36 -070082#endif /* __ASSEMBLY__ */
83
Adrian Bunk7d1362c2006-12-06 20:40:38 -080084#endif /* __KERNEL__ */
85
Linus Torvalds1da177e2005-04-16 15:20:36 -070086#endif /* _i386_SETUP_H */