ia64/xen-unstable

view xen/arch/ia64/xen/xenmisc.c @ 10785:e585c2dade14

[IA64] increase buffer size in panic_domain().

128 bytes is too short.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author awilliam@xenbuild.aw
date Wed Jul 26 09:02:43 2006 -0600 (2006-07-26)
parents 00f20f7c0e23
children a10ef8002af6
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.h>
23 #include <asm/vmx_vcpu.h>
24 #include <asm/vcpu.h>
26 unsigned long loops_per_jiffy = (1<<12); // from linux/init/main.c
28 /* FIXME: where these declarations should be there ? */
29 extern void show_registers(struct pt_regs *regs);
31 void hpsim_setup(char **x)
32 {
33 #ifdef CONFIG_SMP
34 init_smp_config();
35 #endif
36 }
38 // called from mem_init... don't think s/w I/O tlb is needed in Xen
39 //void swiotlb_init(void) { } ...looks like it IS needed
41 long
42 is_platform_hp_ski(void)
43 {
44 int i;
45 long cpuid[6];
47 for (i = 0; i < 5; ++i)
48 cpuid[i] = ia64_get_cpuid(i);
49 if ((cpuid[0] & 0xff) != 'H') return 0;
50 if ((cpuid[3] & 0xff) != 0x4) return 0;
51 if (((cpuid[3] >> 8) & 0xff) != 0x0) return 0;
52 if (((cpuid[3] >> 16) & 0xff) != 0x0) return 0;
53 if (((cpuid[3] >> 24) & 0x7) != 0x7) return 0;
54 return 1;
55 }
57 struct pt_regs *guest_cpu_user_regs(void) { return vcpu_regs(current); }
59 ///////////////////////////////
60 // from arch/ia64/traps.c
61 ///////////////////////////////
63 int is_kernel_text(unsigned long addr)
64 {
65 extern char _stext[], _etext[];
66 if (addr >= (unsigned long) _stext &&
67 addr <= (unsigned long) _etext)
68 return 1;
70 return 0;
71 }
73 unsigned long kernel_text_end(void)
74 {
75 extern char _etext[];
76 return (unsigned long) _etext;
77 }
79 ///////////////////////////////
80 // from common/keyhandler.c
81 ///////////////////////////////
82 void dump_pageframe_info(struct domain *d)
83 {
84 printk("dump_pageframe_info not implemented\n");
85 }
87 ///////////////////////////////
88 // called from arch/ia64/head.S
89 ///////////////////////////////
91 void console_print(char *msg)
92 {
93 printk("console_print called, how did start_kernel return???\n");
94 }
96 ////////////////////////////////////
97 // called from unaligned.c
98 ////////////////////////////////////
100 void die_if_kernel(char *str, struct pt_regs *regs, long err) /* __attribute__ ((noreturn)) */
101 {
102 if (user_mode(regs))
103 return;
105 printk("%s: %s %ld\n", __func__, str, err);
106 debugtrace_dump();
107 show_registers(regs);
108 domain_crash_synchronous();
109 }
111 void vmx_die_if_kernel(char *str, struct pt_regs *regs, long err) /* __attribute__ ((noreturn)) */
112 {
113 if (vmx_user_mode(regs))
114 return;
116 printk("%s: %s %ld\n", __func__, str, err);
117 debugtrace_dump();
118 show_registers(regs);
119 domain_crash_synchronous();
120 }
122 long
123 ia64_peek (struct task_struct *child, struct switch_stack *child_stack,
124 unsigned long user_rbs_end, unsigned long addr, long *val)
125 {
126 printk("ia64_peek: called, not implemented\n");
127 return 1;
128 }
130 long
131 ia64_poke (struct task_struct *child, struct switch_stack *child_stack,
132 unsigned long user_rbs_end, unsigned long addr, long val)
133 {
134 printk("ia64_poke: called, not implemented\n");
135 return 1;
136 }
138 void
139 ia64_sync_fph (struct task_struct *task)
140 {
141 printk("ia64_sync_fph: called, not implemented\n");
142 }
144 void
145 ia64_flush_fph (struct task_struct *task)
146 {
147 printk("ia64_flush_fph: called, not implemented\n");
148 }
150 ////////////////////////////////////
151 // called from irq_ia64.c:init_IRQ()
152 // (because CONFIG_IA64_HP_SIM is specified)
153 ////////////////////////////////////
154 void hpsim_irq_init(void) { }
157 // accomodate linux extable.c
158 //const struct exception_table_entry *
159 void *search_module_extables(unsigned long addr) { return NULL; }
160 void *__module_text_address(unsigned long addr) { return NULL; }
161 void *module_text_address(unsigned long addr) { return NULL; }
164 void arch_dump_domain_info(struct domain *d)
165 {
166 }
168 void audit_domains_key(unsigned char key)
169 {
170 }
172 void panic_domain(struct pt_regs *regs, const char *fmt, ...)
173 {
174 va_list args;
175 char buf[256];
176 struct vcpu *v = current;
178 printf("$$$$$ PANIC in domain %d (k6=0x%lx): ",
179 v->domain->domain_id,
180 __get_cpu_var(cpu_kr)._kr[IA64_KR_CURRENT]);
181 va_start(args, fmt);
182 (void)vsnprintf(buf, sizeof(buf), fmt, args);
183 va_end(args);
184 printf(buf);
185 if (regs) show_registers(regs);
186 if (regs) {
187 debugger_trap_fatal(0 /* don't care */, regs);
188 } else {
189 debugger_trap_immediate();
190 }
191 domain_crash_synchronous ();
192 }