debuggers.hg

view xen/include/asm-x86/config.h @ 3683:1c55bbe02576

bitkeeper revision 1.1159.212.84 (42033fc2Q0eAAtQcKyCf8cXCt_Fgfg)

Common-code cleanups, for ia64.
Signed-off-by: keir.fraser@cl.cam.ac.uk
author kaf24@scramble.cl.cam.ac.uk
date Fri Feb 04 09:26:26 2005 +0000 (2005-02-04)
parents bf2c38625b39
children bbe8541361dd 253e8e10e986
line source
1 /******************************************************************************
2 * config.h
3 *
4 * A Linux-style configuration list.
5 */
7 #ifndef __X86_CONFIG_H__
8 #define __X86_CONFIG_H__
10 #ifdef __i386__
11 #define CONFIG_VMX 1
12 #endif
14 #define CONFIG_X86 1
16 #define CONFIG_SMP 1
17 #define CONFIG_X86_LOCAL_APIC 1
18 #define CONFIG_X86_GOOD_APIC 1
19 #define CONFIG_X86_IO_APIC 1
20 #define CONFIG_X86_L1_CACHE_SHIFT 5
22 #define CONFIG_ACPI 1
23 #define CONFIG_ACPI_BOOT 1
25 #define CONFIG_PCI 1
26 #define CONFIG_PCI_DIRECT 1
27 #if defined(__i386__)
28 #define CONFIG_PCI_BIOS 1
29 #endif
31 #define CONFIG_IDE 1
32 #define CONFIG_BLK_DEV_IDE 1
33 #define CONFIG_BLK_DEV_IDEDMA 1
34 #define CONFIG_BLK_DEV_IDEPCI 1
35 #define CONFIG_IDEDISK_MULTI_MODE 1
36 #define CONFIG_IDEDISK_STROKE 1
37 #define CONFIG_IDEPCI_SHARE_IRQ 1
38 #define CONFIG_BLK_DEV_IDEDMA_PCI 1
39 #define CONFIG_IDEDMA_PCI_AUTO 1
40 #define CONFIG_IDEDMA_AUTO 1
41 #define CONFIG_IDEDMA_ONLYDISK 1
42 #define CONFIG_BLK_DEV_IDE_MODES 1
43 #define CONFIG_BLK_DEV_PIIX 1
45 #define CONFIG_SCSI 1
46 #define CONFIG_SCSI_LOGGING 1
47 #define CONFIG_BLK_DEV_SD 1
48 #define CONFIG_SD_EXTRA_DEVS 40
49 #define CONFIG_SCSI_MULTI_LUN 1
51 #define CONFIG_XEN_ATTENTION_KEY 1
53 #define HZ 100
55 #define OPT_CONSOLE_STR "com1,vga"
57 /*
58 * Just to keep compiler happy.
59 * NB. DO NOT CHANGE SMP_CACHE_BYTES WITHOUT FIXING arch/i386/entry.S!!!
60 * It depends on size of irq_cpustat_t, for example, being 64 bytes. :-)
61 */
62 #define SMP_CACHE_BYTES 64
63 #define NR_CPUS 16
65 /* Linkage for x86 */
66 #define __ALIGN .align 16,0x90
67 #define __ALIGN_STR ".align 16,0x90"
68 #define SYMBOL_NAME_STR(X) #X
69 #define SYMBOL_NAME(X) X
70 #define SYMBOL_NAME_LABEL(X) X##:
71 #ifdef __ASSEMBLY__
72 #define ALIGN __ALIGN
73 #define ALIGN_STR __ALIGN_STR
74 #define ENTRY(name) \
75 .globl SYMBOL_NAME(name); \
76 ALIGN; \
77 SYMBOL_NAME_LABEL(name)
78 #endif
80 #define barrier() __asm__ __volatile__("": : :"memory")
82 #define NR_hypercalls 32
84 #ifndef NDEBUG
85 #define MEMORY_GUARD
86 #endif
88 #ifndef __ASSEMBLY__
89 extern unsigned long _end; /* standard ELF symbol */
90 extern void __out_of_line_bug(int line) __attribute__((noreturn));
91 #define out_of_line_bug() __out_of_line_bug(__LINE__)
92 #endif /* __ASSEMBLY__ */
94 #define BUG() do { \
95 printk("BUG at %s:%d\n", __FILE__, __LINE__); \
96 __asm__ __volatile__("ud2"); \
97 } while (0)
99 #if defined(__x86_64__)
101 #define asmlinkage
103 #define XENHEAP_DEFAULT_MB (16)
105 #define PML4_ENTRY_BITS 39
106 #define PML4_ENTRY_BYTES (1UL << PML4_ENTRY_BITS)
107 #define PML4_ADDR(_slot) \
108 ((((_slot ## UL) >> 8) * 0xffff000000000000UL) | \
109 (_slot ## UL << PML4_ENTRY_BITS))
111 /*
112 * Memory layout:
113 * 0x0000000000000000 - 0x00007fffffffffff [128TB, 2^47 bytes, PML4:0-255]
114 * Guest-defined use.
115 * 0x0000800000000000 - 0xffff7fffffffffff [16EB]
116 * Inaccessible: current arch only supports 48-bit sign-extended VAs.
117 * 0xffff800000000000 - 0xffff803fffffffff [256GB, 2^38 bytes, PML4:256]
118 * Read-only machine-to-phys translation table (GUEST ACCESSIBLE).
119 * 0xffff804000000000 - 0xffff807fffffffff [256GB, 2^38 bytes, PML4:256]
120 * Reserved for future shared info with the guest OS (GUEST ACCESSIBLE).
121 * 0xffff808000000000 - 0xffff80ffffffffff [512GB, 2^39 bytes, PML4:257]
122 * Read-only guest linear page table (GUEST ACCESSIBLE).
123 * 0xffff810000000000 - 0xffff817fffffffff [512GB, 2^39 bytes, PML4:258]
124 * Guest linear page table.
125 * 0xffff818000000000 - 0xffff81ffffffffff [512GB, 2^39 bytes, PML4:259]
126 * Shadow linear page table.
127 * 0xffff820000000000 - 0xffff827fffffffff [512GB, 2^39 bytes, PML4:260]
128 * Per-domain mappings (e.g., GDT, LDT).
129 * 0xffff828000000000 - 0xffff8283ffffffff [16GB, 2^34 bytes, PML4:261]
130 * Machine-to-phys translation table.
131 * 0xffff828400000000 - 0xffff8287ffffffff [16GB, 2^34 bytes, PML4:261]
132 * Page-frame information array.
133 * 0xffff828800000000 - 0xffff828bffffffff [16GB, 2^34 bytes, PML4:261]
134 * ioremap()/fixmap area.
135 * 0xffff828c00000000 - 0xffff82ffffffffff [464GB, PML4:261]
136 * Reserved for future use.
137 * 0xffff830000000000 - 0xffff83ffffffffff [1TB, 2^40 bytes, PML4:262-263]
138 * 1:1 direct mapping of all physical memory. Xen and its heap live here.
139 * 0xffff840000000000 - 0xffff87ffffffffff [4TB, 2^42 bytes, PML4:264-271]
140 * Reserved for future use.
141 * 0xffff880000000000 - 0xffffffffffffffff [120TB, PML4:272-511]
142 * Guest-defined use.
143 */
146 /* Hypervisor reserves PML4 slots 256 to 271 inclusive. */
147 #define HYPERVISOR_VIRT_START (PML4_ADDR(256))
148 #define HYPERVISOR_VIRT_END (HYPERVISOR_VIRT_START + PML4_ENTRY_BYTES*16)
149 /* Slot 256: read-only guest-accessible machine-to-phys translation table. */
150 #define RO_MPT_VIRT_START (PML4_ADDR(256))
151 #define RO_MPT_VIRT_END (RO_MPT_VIRT_START + PML4_ENTRY_BYTES/2)
152 /* Slot 257: read-only guest-accessible linear page table. */
153 #define RO_LINEAR_PT_VIRT_START (PML4_ADDR(257))
154 #define RO_LINEAR_PT_VIRT_END (RO_LINEAR_PT_VIRT_START + PML4_ENTRY_BYTES)
155 /* Slot 258: linear page table (guest table). */
156 #define LINEAR_PT_VIRT_START (PML4_ADDR(258))
157 #define LINEAR_PT_VIRT_END (LINEAR_PT_VIRT_START + PML4_ENTRY_BYTES)
158 /* Slot 259: linear page table (shadow table). */
159 #define SH_LINEAR_PT_VIRT_START (PML4_ADDR(259))
160 #define SH_LINEAR_PT_VIRT_END (SH_LINEAR_PT_VIRT_START + PML4_ENTRY_BYTES)
161 /* Slot 260: per-domain mappings. */
162 #define PERDOMAIN_VIRT_START (PML4_ADDR(260))
163 #define PERDOMAIN_VIRT_END (PERDOMAIN_VIRT_START + PML4_ENTRY_BYTES)
164 /* Slot 261: machine-to-phys conversion table (16GB). */
165 #define RDWR_MPT_VIRT_START (PML4_ADDR(261))
166 #define RDWR_MPT_VIRT_END (RDWR_MPT_VIRT_START + (16UL<<30))
167 /* Slot 261: page-frame information array (16GB). */
168 #define FRAMETABLE_VIRT_START (RDWR_MPT_VIRT_END)
169 #define FRAMETABLE_VIRT_END (FRAMETABLE_VIRT_START + (16UL<<30))
170 /* Slot 261: ioremap()/fixmap area (16GB). */
171 #define IOREMAP_VIRT_START (FRAMETABLE_VIRT_END)
172 #define IOREMAP_VIRT_END (IOREMAP_VIRT_START + (16UL<<30))
173 /* Slot 262-263: A direct 1:1 mapping of all of physical memory. */
174 #define DIRECTMAP_VIRT_START (PML4_ADDR(262))
175 #define DIRECTMAP_VIRT_END (DIRECTMAP_VIRT_START + PML4_ENTRY_BYTES*2)
177 #define PGT_base_page_table PGT_l4_page_table
179 #define __HYPERVISOR_CS64 0x0810
180 #define __HYPERVISOR_CS32 0x0808
181 #define __HYPERVISOR_CS __HYPERVISOR_CS64
182 #define __HYPERVISOR_DS64 0x0000
183 #define __HYPERVISOR_DS32 0x0818
184 #define __HYPERVISOR_DS __HYPERVISOR_DS64
186 /* For generic assembly code: use macros to define operation/operand sizes. */
187 #define __OS "q" /* Operation Suffix */
188 #define __OP "r" /* Operand Prefix */
190 #elif defined(__i386__)
192 #define asmlinkage __attribute__((regparm(0)))
194 #define XENHEAP_DEFAULT_MB (12)
195 #define DIRECTMAP_PHYS_END (12*1024*1024)
197 /* Hypervisor owns top 64MB of virtual address space. */
198 #define __HYPERVISOR_VIRT_START 0xFC000000
199 #define HYPERVISOR_VIRT_START (0xFC000000UL)
201 /*
202 * First 4MB are mapped read-only for all. It's for the machine->physical
203 * mapping table (MPT table). The following are virtual addresses.
204 */
205 #define RO_MPT_VIRT_START (HYPERVISOR_VIRT_START)
206 #define RO_MPT_VIRT_END (RO_MPT_VIRT_START + (4*1024*1024))
207 /* Xen heap extends to end of 1:1 direct-mapped memory region. */
208 #define DIRECTMAP_VIRT_START (RO_MPT_VIRT_END)
209 #define DIRECTMAP_VIRT_END (DIRECTMAP_VIRT_START + DIRECTMAP_PHYS_END)
210 /* Machine-to-phys conversion table. */
211 #define RDWR_MPT_VIRT_START (DIRECTMAP_VIRT_END)
212 #define RDWR_MPT_VIRT_END (RDWR_MPT_VIRT_START + (4*1024*1024))
213 /* Variable-length page-frame information array. */
214 #define FRAMETABLE_VIRT_START (RDWR_MPT_VIRT_END)
215 #define FRAMETABLE_VIRT_END (FRAMETABLE_VIRT_START + (24*1024*1024))
216 /* Next 4MB of virtual address space is used as a linear p.t. mapping. */
217 #define LINEAR_PT_VIRT_START (FRAMETABLE_VIRT_END)
218 #define LINEAR_PT_VIRT_END (LINEAR_PT_VIRT_START + (4*1024*1024))
219 /* Next 4MB of virtual address space is used as a shadow linear p.t. map. */
220 #define SH_LINEAR_PT_VIRT_START (LINEAR_PT_VIRT_END)
221 #define SH_LINEAR_PT_VIRT_END (SH_LINEAR_PT_VIRT_START + (4*1024*1024))
222 /* Next 4MB of virtual address space used for per-domain mappings (eg. GDT). */
223 #define PERDOMAIN_VIRT_START (SH_LINEAR_PT_VIRT_END)
224 #define PERDOMAIN_VIRT_END (PERDOMAIN_VIRT_START + (4*1024*1024))
225 /* Penultimate 4MB of virtual address space used for domain page mappings. */
226 #define MAPCACHE_VIRT_START (PERDOMAIN_VIRT_END)
227 #define MAPCACHE_VIRT_END (MAPCACHE_VIRT_START + (4*1024*1024))
228 /* Final 4MB of virtual address space used for ioremap(). */
229 #define IOREMAP_VIRT_START (MAPCACHE_VIRT_END)
230 #define IOREMAP_VIRT_END (IOREMAP_VIRT_START + (4*1024*1024))
232 #define PGT_base_page_table PGT_l2_page_table
234 #define __HYPERVISOR_CS 0x0808
235 #define __HYPERVISOR_DS 0x0810
237 /* For generic assembly code: use macros to define operation/operand sizes. */
238 #define __OS "l" /* Operation Suffix */
239 #define __OP "e" /* Operand Prefix */
241 #endif /* __i386__ */
243 #ifndef __ASSEMBLY__
244 extern unsigned long xenheap_phys_end; /* user-configurable */
245 #endif
247 #define GDT_VIRT_START(ed) (PERDOMAIN_VIRT_START + ((ed)->eid << PDPT_VCPU_VA_SHIFT))
248 #define GDT_VIRT_END(ed) (GDT_VIRT_START(ed) + (64*1024))
249 #define LDT_VIRT_START(ed) (PERDOMAIN_VIRT_START + (64*1024) + ((ed)->eid << PDPT_VCPU_VA_SHIFT))
250 #define LDT_VIRT_END(ed) (LDT_VIRT_START(ed) + (64*1024))
252 #define PDPT_VCPU_SHIFT 5
253 #define PDPT_VCPU_VA_SHIFT (PDPT_VCPU_SHIFT + PAGE_SHIFT)
255 #if defined(__x86_64__)
256 #define ELFSIZE 64
257 #else
258 #define ELFSIZE 32
259 #endif
261 #endif /* __X86_CONFIG_H__ */