ia64/xen-unstable

view xen/include/asm-x86/config.h @ 1589:9eda3ea2b4a0

bitkeeper revision 1.1019 (40de8639yjRdZbQS_JrcVsHsaPIwZw)

smp.h, irq.h, config.h, sched_bvt.c, setup.c, pci-pc.c:
Fix compile errors for latest GCC (3.4.0).
author kaf24@scramble.cl.cam.ac.uk
date Sun Jun 27 08:32:57 2004 +0000 (2004-06-27)
parents 31d1b1eaf5b5
children 1b2e743614ea
line source
1 /******************************************************************************
2 * config.h
3 *
4 * A Linux-style configuration list.
5 */
7 #ifndef __XEN_I386_CONFIG_H__
8 #define __XEN_I386_CONFIG_H__
10 #define CONFIG_X86 1
12 #define CONFIG_SMP 1
13 #define CONFIG_X86_LOCAL_APIC 1
14 #define CONFIG_X86_IO_APIC 1
15 #define CONFIG_X86_L1_CACHE_SHIFT 5
17 #define CONFIG_ACPI 1
18 #define CONFIG_ACPI_BOOT 1
20 #define CONFIG_PCI 1
21 #define CONFIG_PCI_BIOS 1
22 #define CONFIG_PCI_DIRECT 1
24 #define CONFIG_IDE 1
25 #define CONFIG_BLK_DEV_IDE 1
26 #define CONFIG_BLK_DEV_IDEDMA 1
27 #define CONFIG_BLK_DEV_IDEPCI 1
28 #define CONFIG_IDEDISK_MULTI_MODE 1
29 #define CONFIG_IDEDISK_STROKE 1
30 #define CONFIG_IDEPCI_SHARE_IRQ 1
31 #define CONFIG_BLK_DEV_IDEDMA_PCI 1
32 #define CONFIG_IDEDMA_PCI_AUTO 1
33 #define CONFIG_IDEDMA_AUTO 1
34 #define CONFIG_IDEDMA_ONLYDISK 1
35 #define CONFIG_BLK_DEV_IDE_MODES 1
36 #define CONFIG_BLK_DEV_PIIX 1
38 #define CONFIG_SCSI 1
39 #define CONFIG_SCSI_LOGGING 1
40 #define CONFIG_BLK_DEV_SD 1
41 #define CONFIG_SD_EXTRA_DEVS 40
42 #define CONFIG_SCSI_MULTI_LUN 1
44 #define CONFIG_XEN_ATTENTION_KEY 1
46 #define HZ 100
48 /*
49 * Just to keep compiler happy.
50 * NB. DO NOT CHANGE SMP_CACHE_BYTES WITHOUT FIXING arch/i386/entry.S!!!
51 * It depends on size of irq_cpustat_t, for example, being 64 bytes. :-)
52 */
53 #define SMP_CACHE_BYTES 64
54 #define NR_CPUS 16
55 #define __cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES)))
56 #define ____cacheline_aligned __cacheline_aligned
58 /*
59 * Amount of slack domain memory to leave in system, in megabytes.
60 * Prevents a hard out-of-memory crunch for things like network receive.
61 */
62 #define SLACK_DOMAIN_MEM_KILOBYTES 2048
64 /* Linkage for x86 */
65 #define asmlinkage __attribute__((regparm(0)))
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 #if defined(__x86_64__)
96 #define PML4_ENTRY_BITS 39
97 #define PML4_ENTRY_BYTES (1UL<<PML4_ENTRY_BITS)
99 /*
100 * Memory layout:
101 * 0x0000000000000000 - 0x00007fffffffffff [128TB, 2^47 bytes, PML4:0-255]
102 * Guest-defined use.
103 * 0x0000800000000000 - 0xffff7fffffffffff [16EB]
104 * Inaccessible: current arch only supports 48-bit sign-extended VAs.
105 * 0xffff800000000000 - 0xffff803fffffffff [256GB, 2^38 bytes, PML4:256]
106 * Read-only machine-to-phys translation table (GUEST ACCESSIBLE).
107 * 0xffff804000000000 - 0xffff807fffffffff [256GB, 2^38 bytes, PML4:256]
108 * Reserved for future shared info with the guest OS (GUEST ACCESSIBLE).
109 * 0xffff808000000000 - 0xffff80ffffffffff [512GB, 2^39 bytes, PML4:257]
110 * Read-only guest linear page table (GUEST ACCESSIBLE).
111 * 0xffff810000000000 - 0xffff817fffffffff [512GB, 2^39 bytes, PML4:258]
112 * Guest linear page table.
113 * 0xffff818000000000 - 0xffff81ffffffffff [512GB, 2^39 bytes, PML4:259]
114 * Shadow linear page table.
115 * 0xffff820000000000 - 0xffff827fffffffff [512GB, 2^39 bytes, PML4:260]
116 * Per-domain mappings (e.g., GDT, LDT).
117 * 0xffff828000000000 - 0xffff8287ffffffff [512GB, 2^39 bytes, PML4:261]
118 * Reserved for future use.
119 * 0xffff830000000000 - 0xffff83ffffffffff [1TB, 2^40 bytes, PML4:262-263]
120 * 1:1 direct mapping of all physical memory. Xen and its heap live here.
121 * 0xffff840000000000 - 0xffff87ffffffffff [4TB, 2^42 bytes, PML4:264-271]
122 * Reserved for future use.
123 * 0xffff880000000000 - 0xffffffffffffffff [120TB, PML4:272-511]
124 * Guest-defined use.
125 */
127 /* Hypervisor reserves PML4 slots 256 to 271 inclusive. */
128 #define HYPERVISOR_VIRT_START (0xFFFF800000000000UL)
129 #define HYPERVISOR_VIRT_END (0xFFFF880000000000UL)
130 /* Slot 256: read-only guest-accessible machine-to-phys translation table. */
131 #define RO_MPT_VIRT_START (HYPERVISOR_VIRT_START)
132 #define RO_MPT_VIRT_END (RO_MPT_VIRT_START + PML4_ENTRY_BYTES/2)
133 /* Slot 257: read-only guest-accessible linear page table. */
134 #define RO_LINEAR_PT_VIRT_START (RO_MPT_VIRT_END + PML4_ENTRY_BYTES/2)
135 #define RO_LINEAR_PT_VIRT_END (RO_LINEAR_PT_VIRT_START + PML4_ENTRY_BYTES)
136 /* Slot 258: linear page table (guest table). */
137 #define LINEAR_PT_VIRT_START (RO_LINEAR_PT_VIRT_END)
138 #define LINEAR_PT_VIRT_END (LINEAR_PT_VIRT_START + PML4_ENTRY_BYTES)
139 /* Slot 259: linear page table (shadow table). */
140 #define SH_LINEAR_PT_VIRT_START (LINEAR_PT_VIRT_END)
141 #define SH_LINEAR_PT_VIRT_END (SH_LINEAR_PT_VIRT_START + PML4_ENTRY_BYTES)
142 /* Slot 260: per-domain mappings. */
143 #define PERDOMAIN_VIRT_START (SH_LINEAR_PT_VIRT_END)
144 #define PERDOMAIN_VIRT_END (PERDOMAIN_VIRT_START + PML4_ENTRY_BYTES)
145 /* Slot 262-263: A direct 1:1 mapping of all of physical memory. */
146 #define DIRECTMAP_VIRT_START (PERDOMAIN_VIRT_END + PML4_ENTRY_BYTES)
147 #define DIRECTMAP_VIRT_END (DIRECTMAP_VIRT_START + PML4_ENTRY_BYTES*2)
149 #define PGT_base_page_table PGT_l4_page_table
151 #define __HYPERVISOR_CS64 0x0810
152 #define __HYPERVISOR_CS32 0x0808
153 #define __HYPERVISOR_DS 0x0818
155 /* For generic assembly code: use macros to define operation/operand sizes. */
156 #define __OS "q" /* Operation Suffix */
157 #define __OP "r" /* Operand Prefix */
159 #elif defined(__i386__)
161 /* Hypervisor owns top 64MB of virtual address space. */
162 #define HYPERVISOR_VIRT_START (0xFC000000UL)
164 /*
165 * First 4MB are mapped read-only for all. It's for the machine->physical
166 * mapping table (MPT table). The following are virtual addresses.
167 */
168 #define RO_MPT_VIRT_START (HYPERVISOR_VIRT_START)
169 #define RO_MPT_VIRT_END (RO_MPT_VIRT_START + (4*1024*1024))
170 /*
171 * Next 12MB is fixed monitor space, which is part of a 40MB direct-mapped
172 * memory region. The following are machine addresses.
173 */
174 #define MAX_MONITOR_ADDRESS (12*1024*1024)
175 #define MAX_DIRECTMAP_ADDRESS (40*1024*1024)
176 /* And the virtual addresses for the direct-map region... */
177 #define DIRECTMAP_VIRT_START (RO_MPT_VIRT_END)
178 #define DIRECTMAP_VIRT_END (DIRECTMAP_VIRT_START + MAX_DIRECTMAP_ADDRESS)
179 #define MONITOR_VIRT_START (DIRECTMAP_VIRT_START)
180 #define MONITOR_VIRT_END (MONITOR_VIRT_START + MAX_MONITOR_ADDRESS)
181 #define RDWR_MPT_VIRT_START (MONITOR_VIRT_END)
182 #define RDWR_MPT_VIRT_END (RDWR_MPT_VIRT_START + (4*1024*1024))
183 #define FRAMETABLE_VIRT_START (RDWR_MPT_VIRT_END)
184 #define FRAMETABLE_VIRT_END (DIRECTMAP_VIRT_END)
185 /* Next 4MB of virtual address space is used as a linear p.t. mapping. */
186 #define LINEAR_PT_VIRT_START (DIRECTMAP_VIRT_END)
187 #define LINEAR_PT_VIRT_END (LINEAR_PT_VIRT_START + (4*1024*1024))
188 /* Next 4MB of virtual address space is used as a shadow linear p.t. map. */
189 #define SH_LINEAR_PT_VIRT_START (LINEAR_PT_VIRT_END)
190 #define SH_LINEAR_PT_VIRT_END (SH_LINEAR_PT_VIRT_START + (4*1024*1024))
191 /* Next 4MB of virtual address space used for per-domain mappings (eg. GDT). */
192 #define PERDOMAIN_VIRT_START (SH_LINEAR_PT_VIRT_END)
193 #define PERDOMAIN_VIRT_END (PERDOMAIN_VIRT_START + (4*1024*1024))
194 /* Penultimate 4MB of virtual address space used for domain page mappings. */
195 #define MAPCACHE_VIRT_START (PERDOMAIN_VIRT_END)
196 #define MAPCACHE_VIRT_END (MAPCACHE_VIRT_START + (4*1024*1024))
197 /* Final 4MB of virtual address space used for ioremap(). */
198 #define IOREMAP_VIRT_START (MAPCACHE_VIRT_END)
199 #define IOREMAP_VIRT_END (IOREMAP_VIRT_START + (4*1024*1024))
201 #define PGT_base_page_table PGT_l2_page_table
203 #define __HYPERVISOR_CS 0x0808
204 #define __HYPERVISOR_DS 0x0810
206 /* For generic assembly code: use macros to define operation/operand sizes. */
207 #define __OS "l" /* Operation Suffix */
208 #define __OP "e" /* Operand Prefix */
210 #endif /* __i386__ */
212 #define GDT_VIRT_START (PERDOMAIN_VIRT_START)
213 #define GDT_VIRT_END (GDT_VIRT_START + (64*1024))
214 #define LDT_VIRT_START (GDT_VIRT_END)
215 #define LDT_VIRT_END (LDT_VIRT_START + (64*1024))
217 #endif /* __XEN_I386_CONFIG_H__ */