ia64/xen-unstable

view xen/include/asm-ia64/config.h @ 4691:065f8708a9e2

bitkeeper revision 1.1327.1.9 (42714a2f9RKgJOZHHOz9jvIICLyXxQ)

More code cleanup
author djm@kirby.fc.hp.com
date Thu Apr 28 20:40:15 2005 +0000 (2005-04-28)
parents 0dc81495c135
children 593703cf4935
line source
1 // control flags for turning on/off features under test
2 #undef CLONE_DOMAIN0
3 //#define CLONE_DOMAIN0 1
4 #define DOMU_BUILD_STAGING
5 #define VHPT_GLOBAL
6 #define DOMU_AUTO_RESTART
8 // manufactured from component pieces
10 // defined in linux/arch/ia64/defconfig
11 //#define CONFIG_IA64_GENERIC
12 #define CONFIG_IA64_HP_SIM
13 #define CONFIG_IA64_L1_CACHE_SHIFT 7
14 // needed by include/asm-ia64/page.h
15 #define CONFIG_IA64_PAGE_SIZE_16KB // 4KB doesn't work?!?
16 #define CONFIG_IA64_GRANULE_16MB
17 // needed in arch/ia64/setup.c to reserve memory for domain0
18 #define CONFIG_BLK_DEV_INITRD
20 #ifndef __ASSEMBLY__
22 // can't find where this typedef was before?!?
23 // needed by include/asm-ia64/processor.h (and other places)
24 typedef int pid_t;
26 // from include/linux/kernel.h
27 #define ALIGN(x,a) (((x)+(a)-1)&~((a)-1))
29 //////////////////////////////////////
31 #define FASTCALL(x) x // see linux/include/linux/linkage.h
32 #define fastcall // " "
34 #define touch_nmi_watchdog()
35 // from linux/include/linux/types.h
36 #define BITS_TO_LONGS(bits) \
37 (((bits)+BITS_PER_LONG-1)/BITS_PER_LONG)
38 #define DECLARE_BITMAP(name,bits) \
39 unsigned long name[BITS_TO_LONGS(bits)]
40 #define CLEAR_BITMAP(name,bits) \
41 memset(name, 0, BITS_TO_LONGS(bits)*sizeof(unsigned long))
43 // FIXME?: x86-ism used in xen/mm.h
44 #define LOCK_PREFIX
46 extern unsigned long xenheap_phys_end;
47 extern unsigned long xen_pstart;
48 extern unsigned long xenheap_size;
50 // from linux/include/linux/mm.h
51 extern struct page *mem_map;
53 // xen/include/asm/config.h
54 extern char _end[]; /* standard ELF symbol */
56 // linux/include/linux/compiler.h
57 #define __attribute_const__
58 #define __user
59 //#define __kernel
60 //#define __safe
61 #define __force
62 #define __iomem
63 #define __chk_user_ptr(x) (void)0
64 //#define __chk_io_ptr(x) (void)0
65 //#define __builtin_warning(x, y...) (1)
66 //#define __acquires(x)
67 //#define __releases(x)
68 //#define __acquire(x) (void)0
69 //#define __release(x) (void)0
70 //#define __cond_lock(x) (x)
71 #define __must_check
72 #define __deprecated
74 // xen/include/asm/config.h
75 #define HZ 100
76 // leave SMP for a later time
77 #define NR_CPUS 1
78 //#define NR_CPUS 16
79 //#define CONFIG_NR_CPUS 16
80 #define barrier() __asm__ __volatile__("": : :"memory")
82 // linux/include/spinlock.h
83 #define DEFINE_SPINLOCK(x) spinlock_t x = SPIN_LOCK_UNLOCKED
85 ///////////////////////////////////////////////////////////////
86 // xen/include/asm/config.h
87 // Natural boundary upon TR size to define xenheap space
88 #define XENHEAP_DEFAULT_MB (1 << (KERNEL_TR_PAGE_SHIFT - 20))
89 #define XENHEAP_DEFAULT_SIZE (1 << KERNEL_TR_PAGE_SHIFT)
90 #define ELFSIZE 64
92 ///////////////////////////////////////////////////////////////
94 // get rid of difficult circular include dependency
95 #define CMPXCHG_BUGCHECK(v)
96 #define CMPXCHG_BUGCHECK_DECL
98 // from include/asm-ia64/smp.h
99 #ifdef CONFIG_SMP
100 #error "Lots of things to fix to enable CONFIG_SMP!"
101 #endif
102 #define get_cpu() 0
103 #define put_cpu() do {} while(0)
105 // from linux/include/linux/mm.h
106 struct page;
108 // function calls; see decl in xen/include/xen/sched.h
109 #undef free_task_struct
110 #undef alloc_task_struct
112 // initial task has a different name in Xen
113 //#define idle0_task init_task
114 #define idle0_exec_domain init_task
116 // avoid redefining task_t in asm/thread_info.h
117 #define task_t struct domain
119 // avoid redefining task_struct in asm/current.h
120 #define task_struct exec_domain
122 // linux/include/asm-ia64/machvec.h (linux/arch/ia64/lib/io.c)
123 #define platform_inb __ia64_inb
124 #define platform_inw __ia64_inw
125 #define platform_inl __ia64_inl
126 #define platform_outb __ia64_outb
127 #define platform_outw __ia64_outw
128 #define platform_outl __ia64_outl
130 // FIXME: This just overrides a use in a typedef (not allowed in ia64,
131 // or maybe just in older gcc's?) used in ac_timer.c but should be OK
132 // (and indeed is probably required!) elsewhere
133 #undef __cacheline_aligned
134 #undef ____cacheline_aligned
135 #undef ____cacheline_aligned_in_smp
136 #define __cacheline_aligned
137 #define ____cacheline_aligned
138 #define ____cacheline_aligned_in_smp
139 #define ____cacheline_maxaligned_in_smp
141 #include "asm/types.h" // for u64
142 struct device {
143 #if 0
144 struct list_head node; /* node in sibling list */
145 struct list_head bus_list; /* node in bus's list */
146 struct list_head driver_list;
147 struct list_head children;
148 struct device * parent;
150 struct kobject kobj;
151 char bus_id[BUS_ID_SIZE]; /* position on parent bus */
153 struct bus_type * bus; /* type of bus device is on */
154 struct device_driver *driver; /* which driver has allocated this
155 device */
156 void *driver_data; /* data private to the driver */
157 void *platform_data; /* Platform specific data (e.g. ACPI,
158 BIOS data relevant to device) */
159 struct dev_pm_info power;
160 u32 power_state; /* Current operating state. In
161 ACPI-speak, this is D0-D3, D0
162 being fully functional, and D3
163 being off. */
165 unsigned char *saved_state; /* saved device state */
166 u32 detach_state; /* State to enter when device is
167 detached from its driver. */
169 #endif
170 u64 *dma_mask; /* dma mask (if dma'able device) */
171 #if 0
172 struct list_head dma_pools; /* dma pools (if dma'ble) */
174 void (*release)(struct device * dev);
175 #endif
176 };
178 // from linux/include/linux/pci.h
179 struct pci_bus_region {
180 unsigned long start;
181 unsigned long end;
182 };
184 // warning: unless search_extable is declared, the return value gets
185 // truncated to 32-bits, causing a very strange error in privop handling
186 struct exception_table_entry;
188 const struct exception_table_entry *
189 search_extable(const struct exception_table_entry *first,
190 const struct exception_table_entry *last,
191 unsigned long value);
192 void sort_extable(struct exception_table_entry *start,
193 struct exception_table_entry *finish);
194 void sort_main_extable(void);
196 // defined (why?) in include/asm-i386/processor.h
197 // used in common/physdev.c
198 #define IO_BITMAP_SIZE 32
199 #define IO_BITMAP_BYTES (IO_BITMAP_SIZE * 4)
201 #define printk printf
203 #undef __ARCH_IRQ_STAT
205 #define find_first_set_bit(x) (ffs(x)-1) // FIXME: Is this right???
207 // from include/asm-x86/*/uaccess.h
208 #define array_access_ok(addr,count,size) \
209 (likely(sizeof(count) <= 4) /* disallow 64-bit counts */ && \
210 access_ok(type,addr,count*size))
212 // without this, uart_config_stageX does outb's which are non-portable
213 #define NO_UART_CONFIG_OK
215 // see drivers/char/console.c
216 #define OPT_CONSOLE_STR "com1"
218 #define __attribute_used__ __attribute__ ((unused))
220 // see include/asm-x86/atomic.h (different from standard linux)
221 #define _atomic_set(v,i) (((v).counter) = (i))
222 #define _atomic_read(v) ((v).counter)
223 // FIXME following needs work
224 #define atomic_compareandswap(old, new, v) old
226 // see include/asm-ia64/mm.h, handle remaining pfn_info uses until gone
227 #define pfn_info page
229 // see common/keyhandler.c
230 #define nop() asm volatile ("nop 0")
232 // from include/linux/preempt.h (needs including from interrupt.h or smp.h)
233 #define preempt_enable() do { } while (0)
234 #define preempt_disable() do { } while (0)
236 // needed for include/xen/linuxtime.h
237 typedef s64 time_t;
238 typedef s64 suseconds_t;
240 // used in common code
241 #define softirq_pending(cpu) (cpu_data(cpu)->softirq_pending)
243 // dup'ed from signal.h to avoid changes to includes
244 #define SA_SHIRQ 0x04000000
245 #define SA_INTERRUPT 0x20000000
247 // these declarations got moved at some point, find a better place for them
248 extern int opt_noht;
249 extern int ht_per_core;
250 extern unsigned int watchdog_on;
252 // xen/include/asm/config.h
253 /******************************************************************************
254 * config.h
255 *
256 * A Linux-style configuration list.
257 */
259 #ifndef __XEN_IA64_CONFIG_H__
260 #define __XEN_IA64_CONFIG_H__
262 #undef CONFIG_X86
264 #define CONFIG_MCKINLEY
266 //#define CONFIG_SMP 1
267 //#define CONFIG_NR_CPUS 2
268 //leave SMP for a later time
269 #undef CONFIG_SMP
270 #undef CONFIG_X86_LOCAL_APIC
271 #undef CONFIG_X86_IO_APIC
272 #undef CONFIG_X86_L1_CACHE_SHIFT
274 // this needs to be on to run on hp zx1 with more than 4GB
275 // it is hacked around for now though
276 //#define CONFIG_VIRTUAL_MEM_MAP
278 //#ifndef CONFIG_IA64_HP_SIM
279 // looks like this is hard to turn off for Xen
280 #define CONFIG_ACPI 1
281 #define CONFIG_ACPI_BOOT 1
282 //#endif
284 #define CONFIG_PCI 1
285 #define CONFIG_PCI_BIOS 1
286 #define CONFIG_PCI_DIRECT 1
288 #define CONFIG_XEN_ATTENTION_KEY 1
289 #endif /* __ASSEMBLY__ */
290 #endif /* __XEN_IA64_CONFIG_H__ */
292 // FOLLOWING ADDED FOR XEN POST-NGIO and/or LINUX 2.6.7
294 // following derived from linux/include/linux/compiler-gcc3.h
295 // problem because xen (over?)simplifies include/xen/compiler.h
296 #if __GNUC_MAJOR < 3 || __GNUC_MINOR__ >= 3
297 # define __attribute_used__ __attribute__((__used__))
298 #else
299 # define __attribute_used__ __attribute__((__unused__))
300 #endif