ia64/linux-2.6.18-xen.hg

view include/asm-i386/unwind.h @ 452:c7ed6fe5dca0

kexec: dont initialise regions in reserve_memory()

There is no need to initialise efi_memmap_res and boot_param_res in
reserve_memory() for the initial xen domain as it is done in
machine_kexec_setup_resources() using values from the kexec hypercall.

Signed-off-by: Simon Horman <horms@verge.net.au>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Feb 28 10:55:18 2008 +0000 (2008-02-28)
parents 831230e53067
children
line source
1 #ifndef _ASM_I386_UNWIND_H
2 #define _ASM_I386_UNWIND_H
4 /*
5 * Copyright (C) 2002-2006 Novell, Inc.
6 * Jan Beulich <jbeulich@novell.com>
7 * This code is released under version 2 of the GNU GPL.
8 */
10 #ifdef CONFIG_STACK_UNWIND
12 #include <linux/sched.h>
13 #include <asm/fixmap.h>
14 #include <asm/ptrace.h>
15 #include <asm/uaccess.h>
17 struct unwind_frame_info
18 {
19 struct pt_regs regs;
20 struct task_struct *task;
21 };
23 #define UNW_PC(frame) (frame)->regs.eip
24 #define UNW_SP(frame) (frame)->regs.esp
25 #ifdef CONFIG_FRAME_POINTER
26 #define UNW_FP(frame) (frame)->regs.ebp
27 #define FRAME_RETADDR_OFFSET 4
28 #define FRAME_LINK_OFFSET 0
29 #define STACK_BOTTOM(tsk) STACK_LIMIT((tsk)->thread.esp0)
30 #define STACK_TOP(tsk) ((tsk)->thread.esp0)
31 #endif
32 #define STACK_LIMIT(ptr) (((ptr) - 1) & ~(THREAD_SIZE - 1))
34 #define UNW_REGISTER_INFO \
35 PTREGS_INFO(eax), \
36 PTREGS_INFO(ecx), \
37 PTREGS_INFO(edx), \
38 PTREGS_INFO(ebx), \
39 PTREGS_INFO(esp), \
40 PTREGS_INFO(ebp), \
41 PTREGS_INFO(esi), \
42 PTREGS_INFO(edi), \
43 PTREGS_INFO(eip)
45 static inline void arch_unw_init_frame_info(struct unwind_frame_info *info,
46 /*const*/ struct pt_regs *regs)
47 {
48 if (user_mode_vm(regs))
49 info->regs = *regs;
50 else {
51 memcpy(&info->regs, regs, offsetof(struct pt_regs, esp));
52 info->regs.esp = (unsigned long)&regs->esp;
53 info->regs.xss = __KERNEL_DS;
54 }
55 }
57 static inline void arch_unw_init_blocked(struct unwind_frame_info *info)
58 {
59 memset(&info->regs, 0, sizeof(info->regs));
60 info->regs.eip = info->task->thread.eip;
61 info->regs.xcs = __KERNEL_CS;
62 __get_user(info->regs.ebp, (long *)info->task->thread.esp);
63 info->regs.esp = info->task->thread.esp;
64 info->regs.xss = __KERNEL_DS;
65 info->regs.xds = __USER_DS;
66 info->regs.xes = __USER_DS;
67 }
69 extern asmlinkage int arch_unwind_init_running(struct unwind_frame_info *,
70 asmlinkage int (*callback)(struct unwind_frame_info *,
71 void *arg),
72 void *arg);
74 static inline int arch_unw_user_mode(const struct unwind_frame_info *info)
75 {
76 #if 0 /* This can only work when selector register and EFLAGS saves/restores
77 are properly annotated (and tracked in UNW_REGISTER_INFO). */
78 return user_mode_vm(&info->regs);
79 #else
80 return info->regs.eip < PAGE_OFFSET
81 || (info->regs.eip >= __fix_to_virt(FIX_VDSO)
82 && info->regs.eip < __fix_to_virt(FIX_VDSO) + PAGE_SIZE)
83 || info->regs.esp < PAGE_OFFSET;
84 #endif
85 }
87 #else
89 #define UNW_PC(frame) ((void)(frame), 0)
90 #define UNW_SP(frame) ((void)(frame), 0)
92 static inline int arch_unw_user_mode(const void *info)
93 {
94 return 0;
95 }
97 #endif
99 #endif /* _ASM_I386_UNWIND_H */