direct-io.hg

view xen/arch/ia64/xen/xenmisc.c @ 10418:7f67c15e2c91

[IA64] enable Xen compilation with debug=y

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
author awilliam@xenbuild.aw
date Thu Jun 15 10:02:53 2006 -0600 (2006-06-15)
parents 75f791c710df
children 602f5965e217
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>
19 #include <public/sched.h>
20 #include <asm/vhpt.h>
21 #include <asm/debugger.h>
22 #include <asm/vmx_vcpu.h>
23 #include <asm/vcpu.h>
25 unsigned long loops_per_jiffy = (1<<12); // from linux/init/main.c
27 /* FIXME: where these declarations should be there ? */
28 extern void show_registers(struct pt_regs *regs);
30 void ia64_mca_init(void) { printf("ia64_mca_init() skipped (Machine check abort handling)\n"); }
31 void ia64_mca_cpu_init(void *x) { }
32 void hpsim_setup(char **x)
33 {
34 #ifdef CONFIG_SMP
35 init_smp_config();
36 #endif
37 }
39 // called from mem_init... don't think s/w I/O tlb is needed in Xen
40 //void swiotlb_init(void) { } ...looks like it IS needed
42 long
43 is_platform_hp_ski(void)
44 {
45 int i;
46 long cpuid[6];
48 for (i = 0; i < 5; ++i)
49 cpuid[i] = ia64_get_cpuid(i);
50 if ((cpuid[0] & 0xff) != 'H') return 0;
51 if ((cpuid[3] & 0xff) != 0x4) return 0;
52 if (((cpuid[3] >> 8) & 0xff) != 0x0) return 0;
53 if (((cpuid[3] >> 16) & 0xff) != 0x0) return 0;
54 if (((cpuid[3] >> 24) & 0x7) != 0x7) return 0;
55 return 1;
56 }
58 struct pt_regs *guest_cpu_user_regs(void) { return vcpu_regs(current); }
60 ///////////////////////////////
61 // from arch/ia64/traps.c
62 ///////////////////////////////
64 int is_kernel_text(unsigned long addr)
65 {
66 extern char _stext[], _etext[];
67 if (addr >= (unsigned long) _stext &&
68 addr <= (unsigned long) _etext)
69 return 1;
71 return 0;
72 }
74 unsigned long kernel_text_end(void)
75 {
76 extern char _etext[];
77 return (unsigned long) _etext;
78 }
80 ///////////////////////////////
81 // from common/keyhandler.c
82 ///////////////////////////////
83 void dump_pageframe_info(struct domain *d)
84 {
85 printk("dump_pageframe_info not implemented\n");
86 }
88 ///////////////////////////////
89 // called from arch/ia64/head.S
90 ///////////////////////////////
92 void console_print(char *msg)
93 {
94 printk("console_print called, how did start_kernel return???\n");
95 }
97 ////////////////////////////////////
98 // called from unaligned.c
99 ////////////////////////////////////
101 void die_if_kernel(char *str, struct pt_regs *regs, long err) /* __attribute__ ((noreturn)) */
102 {
103 if (user_mode(regs))
104 return;
106 printk("%s: %s %ld\n", __func__, str, err);
107 debugtrace_dump();
108 show_registers(regs);
109 domain_crash_synchronous();
110 }
112 long
113 ia64_peek (struct task_struct *child, struct switch_stack *child_stack,
114 unsigned long user_rbs_end, unsigned long addr, long *val)
115 {
116 printk("ia64_peek: called, not implemented\n");
117 return 1;
118 }
120 long
121 ia64_poke (struct task_struct *child, struct switch_stack *child_stack,
122 unsigned long user_rbs_end, unsigned long addr, long val)
123 {
124 printk("ia64_poke: called, not implemented\n");
125 return 1;
126 }
128 void
129 ia64_sync_fph (struct task_struct *task)
130 {
131 printk("ia64_sync_fph: called, not implemented\n");
132 }
134 void
135 ia64_flush_fph (struct task_struct *task)
136 {
137 printk("ia64_flush_fph: called, not implemented\n");
138 }
140 ////////////////////////////////////
141 // called from irq_ia64.c:init_IRQ()
142 // (because CONFIG_IA64_HP_SIM is specified)
143 ////////////////////////////////////
144 void hpsim_irq_init(void) { }
147 // accomodate linux extable.c
148 //const struct exception_table_entry *
149 void *search_module_extables(unsigned long addr) { return NULL; }
150 void *__module_text_address(unsigned long addr) { return NULL; }
151 void *module_text_address(unsigned long addr) { return NULL; }
154 void arch_dump_domain_info(struct domain *d)
155 {
156 }
158 void audit_domains_key(unsigned char key)
159 {
160 }
162 void panic_domain(struct pt_regs *regs, const char *fmt, ...)
163 {
164 va_list args;
165 char buf[128];
166 struct vcpu *v = current;
168 printf("$$$$$ PANIC in domain %d (k6=0x%lx): ",
169 v->domain->domain_id,
170 __get_cpu_var(cpu_kr)._kr[IA64_KR_CURRENT]);
171 va_start(args, fmt);
172 (void)vsnprintf(buf, sizeof(buf), fmt, args);
173 va_end(args);
174 printf(buf);
175 if (regs) show_registers(regs);
176 if (regs) {
177 debugger_trap_fatal(0 /* don't care */, regs);
178 } else {
179 debugger_trap_immediate();
180 }
181 domain_crash_synchronous ();
182 }