ia64/xen-unstable

view xen/arch/ia64/xenmisc.c @ 4146:f2d61710e4d9

bitkeeper revision 1.1236.25.24 (42366e9aQ71LQ8uCB-Y1IwVNqx5eqA)

Merge djm@kirby.fc.hp.com://home/djm/src/xen/xeno-unstable-ia64.bk
into sportsman.spdomain:/home/djm/xeno-unstable-ia64.bk
author djm@sportsman.spdomain
date Tue Mar 15 05:11:54 2005 +0000 (2005-03-15)
parents 557e8cf002c3 0c846e77cca4
children a0b28acf0dcd
line source
1 /*
2 * Xen misc
3 *
4 * Functions/decls that are/may be needed to link with Xen because
5 * of x86 dependencies
6 *
7 * Copyright (C) 2004 Hewlett-Packard Co.
8 * Dan Magenheimer (dan.magenheimer@hp.com)
9 *
10 */
12 #include <linux/config.h>
13 #include <xen/sched.h>
14 #include <linux/efi.h>
15 #include <asm/processor.h>
16 #include <xen/serial.h>
17 #include <asm/io.h>
18 #include <xen/softirq.h>
20 efi_memory_desc_t ia64_efi_io_md;
21 EXPORT_SYMBOL(ia64_efi_io_md);
22 unsigned long wait_init_idle;
23 int phys_proc_id[NR_CPUS];
24 unsigned long loops_per_jiffy = (1<<12); // from linux/init/main.c
26 unsigned int watchdog_on = 0; // from arch/x86/nmi.c ?!?
28 void unw_init(void) { printf("unw_init() skipped (NEED FOR KERNEL UNWIND)\n"); }
29 void ia64_mca_init(void) { printf("ia64_mca_init() skipped (Machine check abort handling)\n"); }
30 void hpsim_setup(char **x) { printf("hpsim_setup() skipped (MAY NEED FOR CONSOLE INPUT!!!)\n"); }
32 long
33 is_platform_hp_ski(void)
34 {
35 int i;
36 long cpuid[6];
38 for (i = 0; i < 5; ++i)
39 cpuid[i] = ia64_get_cpuid(i);
40 if ((cpuid[0] & 0xff) != 'H') return 0;
41 if ((cpuid[3] & 0xff) != 0x4) return 0;
42 if (((cpuid[3] >> 8) & 0xff) != 0x0) return 0;
43 if (((cpuid[3] >> 16) & 0xff) != 0x0) return 0;
44 if (((cpuid[3] >> 24) & 0x7) != 0x7) return 0;
45 return 1;
46 }
48 long
49 platform_is_hp_ski(void)
50 {
51 extern long running_on_sim;
52 return running_on_sim;
53 }
55 /* calls in xen/common code that are unused on ia64 */
56 void synchronise_pagetables(unsigned long cpu_mask) { return; }
58 int grant_table_create(struct domain *d) { return 0; }
59 void grant_table_destroy(struct domain *d)
60 {
61 printf("grant_table_destroy: domain_destruct not tested!!!\n");
62 printf("grant_table_destroy: ensure atomic_* calls work in domain_destruct!!\n");
63 dummy();
64 return;
65 }
67 struct pt_regs *get_execution_context(void) { return ia64_task_regs(current); }
69 void cleanup_writable_pagetable(struct domain *d, int what) { return; }
71 void raise_actimer_softirq(void)
72 {
73 raise_softirq(AC_TIMER_SOFTIRQ);
74 }
76 ///////////////////////////////
77 // from arch/x86/apic.c
78 ///////////////////////////////
80 int reprogram_ac_timer(s_time_t timeout)
81 {
82 struct exec_domain *ed = current;
84 local_cpu_data->itm_next = timeout;
85 if (is_idle_task(ed->domain)) vcpu_safe_set_itm(timeout);
86 else vcpu_set_next_timer(current);
87 return 1;
88 }
90 ///////////////////////////////
91 // from arch/x86/dompage.c
92 ///////////////////////////////
94 struct pfn_info *alloc_domheap_pages(struct domain *d, unsigned int order)
95 {
96 printf("alloc_domheap_pages: called, not implemented\n");
97 }
99 void free_domheap_pages(struct pfn_info *pg, unsigned int order)
100 {
101 printf("free_domheap_pages: called, not implemented\n");
102 }
105 unsigned long avail_domheap_pages(void)
106 {
107 printf("avail_domheap_pages: called, not implemented\n");
108 return 0;
109 }
111 ///////////////////////////////
112 // from arch/x86/flushtlb.c
113 ///////////////////////////////
115 u32 tlbflush_clock;
116 u32 tlbflush_time[NR_CPUS];
118 ///////////////////////////////
119 // from arch/x86/memory.c
120 ///////////////////////////////
122 void init_percpu_info(void)
123 {
124 dummy();
125 //memset(percpu_info, 0, sizeof(percpu_info));
126 }
128 void free_page_type(struct pfn_info *page, unsigned int type)
129 {
130 dummy();
131 }
133 ///////////////////////////////
134 // from arch/x86/pci.c
135 ///////////////////////////////
137 int
138 pcibios_prep_mwi (struct pci_dev *dev)
139 {
140 dummy();
141 }
143 ///////////////////////////////
144 // from arch/x86/pci-irq.c
145 ///////////////////////////////
147 void pcibios_enable_irq(struct pci_dev *dev)
148 {
149 dummy();
150 }
152 ///////////////////////////////
153 // from arch/ia64/pci-pc.c
154 ///////////////////////////////
156 #include <xen/pci.h>
158 int pcibios_enable_device(struct pci_dev *dev, int mask)
159 {
160 dummy();
161 return 0;
162 }
164 int (*pci_config_read)(int seg, int bus, int dev, int fn, int reg, int len, u32 *value) = NULL;
165 int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int len, u32 value) = NULL;
167 //struct pci_fixup pcibios_fixups[] = { { 0 } };
168 struct pci_fixup pcibios_fixups[] = { { 0 } };
170 void
171 pcibios_align_resource(void *data, struct resource *res,
172 unsigned long size, unsigned long align)
173 {
174 dummy();
175 }
177 void
178 pcibios_update_resource(struct pci_dev *dev, struct resource *root,
179 struct resource *res, int resource)
180 {
181 dummy();
182 }
184 void __devinit pcibios_fixup_bus(struct pci_bus *b)
185 {
186 dummy();
187 }
189 void __init pcibios_init(void)
190 {
191 dummy();
192 }
194 char * __devinit pcibios_setup(char *str)
195 {
196 dummy();
197 return 0;
198 }
200 ///////////////////////////////
201 // from arch/ia64/traps.c
202 ///////////////////////////////
204 void show_registers(struct pt_regs *regs)
205 {
206 printf("*** ADD REGISTER DUMP HERE FOR DEBUGGING\n");
207 }
209 ///////////////////////////////
210 // from common/keyhandler.c
211 ///////////////////////////////
212 void dump_pageframe_info(struct domain *d)
213 {
214 printk("dump_pageframe_info not implemented\n");
215 }
217 ///////////////////////////////
218 // from common/physdev.c
219 ///////////////////////////////
220 void
221 physdev_init_dom0(struct domain *d)
222 {
223 }
225 int
226 physdev_pci_access_modify(domid_t id, int bus, int dev, int func, int enable)
227 {
228 return -EINVAL;
229 }
231 // accomodate linux extable.c
232 //const struct exception_table_entry *
233 void *search_module_extables(unsigned long addr)
234 {
235 return NULL;
236 }
238 void *module_text_address(unsigned long addr)
239 {
240 return NULL;
241 }
243 void cs10foo(void) {}
244 void cs01foo(void) {}
246 // context_switch
247 void context_switch(struct exec_domain *prev, struct exec_domain *next)
248 {
249 //printk("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
250 //printk("@@@@@@ context switch from domain %d (%x) to domain %d (%x)\n",
251 //prev->domain->id,(long)prev&0xffffff,next->domain->id,(long)next&0xffffff);
252 //printk("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
253 //if (prev->domain->id == 1 && next->domain->id == 0) cs10foo();
254 //if (prev->domain->id == 0 && next->domain->id == 1) cs01foo();
255 switch_to(prev,next,prev);
256 clear_bit(EDF_RUNNING, &prev->ed_flags);
257 //if (!is_idle_task(next->domain) )
258 //send_guest_virq(next, VIRQ_TIMER);
259 load_region_regs(current);
260 }
262 void panic_domain(struct pt_regs *regs, const char *fmt, ...)
263 {
264 va_list args;
265 char buf[128];
266 struct exec_domain *ed = current;
267 static volatile int test = 1; // so can continue easily in debug
268 extern spinlock_t console_lock;
269 unsigned long flags;
271 printf("$$$$$ PANIC in domain %d (k6=%p): ",
272 ed->domain->id, ia64_get_kr(IA64_KR_CURRENT));
273 va_start(args, fmt);
274 (void)vsnprintf(buf, sizeof(buf), fmt, args);
275 va_end(args);
276 printf(buf);
277 if (regs) show_registers(regs);
278 domain_pause_by_systemcontroller(current->domain);
279 //while(test);
280 }