debuggers.hg

view xen/arch/ia64/patch/linux-2.6.11/entry.S @ 4619:5b9e241131fb

bitkeeper revision 1.1329 (42661815u5WPq8d5f4_axi2xWheybA)

Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk
into firebug.cl.cam.ac.uk:/local/scratch/kaf24/xeno-unstable-ia64.bk
author kaf24@firebug.cl.cam.ac.uk
date Wed Apr 20 08:51:33 2005 +0000 (2005-04-20)
parents 58efb3448933
children ba75d06d25c5 79b7835ac75d
line source
1 entry.S | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
2 1 files changed, 85 insertions(+), 1 deletion(-)
4 Index: linux-2.6.11-xendiffs/arch/ia64/kernel/entry.S
5 ===================================================================
6 --- linux-2.6.11-xendiffs.orig/arch/ia64/kernel/entry.S 2005-04-08 13:32:07.636308237 -0500
7 +++ linux-2.6.11-xendiffs/arch/ia64/kernel/entry.S 2005-04-08 13:37:04.612542509 -0500
8 @@ -35,7 +35,9 @@
10 #include <asm/asmmacro.h>
11 #include <asm/cache.h>
12 +#ifndef XEN
13 #include <asm/errno.h>
14 +#endif
15 #include <asm/kregs.h>
16 #include <asm/offsets.h>
17 #include <asm/pgtable.h>
18 @@ -46,6 +48,25 @@
20 #include "minstate.h"
22 +#ifdef XEN
23 +#define sys_execve 0
24 +#define do_fork 0
25 +#define syscall_trace_enter 0
26 +#define syscall_trace_leave 0
27 +#define schedule 0
28 +#define do_notify_resume_user 0
29 +#define ia64_rt_sigsuspend 0
30 +#define ia64_rt_sigreturn 0
31 +#define ia64_handle_unaligned 0
32 +#define errno 0
33 +#define sys_ni_syscall 0
34 +#define unw_init_frame_info 0
35 +#define sys_call_table 0
36 +#define do_sigdelayed 0
37 +#endif
38 +
39 + /*
40 +
41 /*
42 * execve() is special because in case of success, we need to
43 * setup a null register window frame.
44 @@ -187,11 +208,14 @@ GLOBAL_ENTRY(ia64_switch_to)
45 DO_SAVE_SWITCH_STACK
46 .body
48 +#ifdef XEN
49 +//#undef IA64_TASK_THREAD_KSP_OFFSET
50 +//#define IA64_TASK_THREAD_KSP_OFFSET 0x38
51 adds r22=IA64_TASK_THREAD_KSP_OFFSET,r13
52 movl r25=init_task
53 mov r27=IA64_KR(CURRENT_STACK)
54 adds r21=IA64_TASK_THREAD_KSP_OFFSET,in0
55 - dep r20=0,in0,61,3 // physical address of "next"
56 + dep r20=0,in0,60,4 // physical address of "next"
57 ;;
58 st8 [r22]=sp // save kernel stack pointer of old task
59 shr.u r26=r20,IA64_GRANULE_SHIFT
60 @@ -203,6 +227,22 @@ GLOBAL_ENTRY(ia64_switch_to)
61 (p6) cmp.eq p7,p6=r26,r27
62 (p6) br.cond.dpnt .map
63 ;;
64 +#else
65 + adds r22=IA64_TASK_THREAD_KSP_OFFSET,r13
66 + mov r27=IA64_KR(CURRENT_STACK)
67 + dep r20=0,in0,61,3 // physical address of "current"
68 + ;;
69 + st8 [r22]=sp // save kernel stack pointer of old task
70 + shr.u r26=r20,IA64_GRANULE_SHIFT
71 + adds r21=IA64_TASK_THREAD_KSP_OFFSET,in0
72 + ;;
73 + /*
74 + * If we've already mapped this task's page, we can skip doing it again.
75 + */
76 + cmp.eq p7,p6=r26,r27
77 +(p6) br.cond.dpnt .map
78 + ;;
79 +#endif
80 .done:
81 (p6) ssm psr.ic // if we had to map, reenable the psr.ic bit FIRST!!!
82 ;;
83 @@ -220,6 +260,16 @@ GLOBAL_ENTRY(ia64_switch_to)
84 br.ret.sptk.many rp // boogie on out in new context
86 .map:
87 +#ifdef XEN
88 + // avoid overlapping with kernel TR
89 + movl r25=KERNEL_START
90 + dep r23=0,in0,0,KERNEL_TR_PAGE_SHIFT
91 + ;;
92 + cmp.eq p7,p0=r25,r23
93 + ;;
94 +(p7) mov IA64_KR(CURRENT_STACK)=r26 // remember last page we mapped...
95 +(p7) br.cond.sptk .done
96 +#endif
97 rsm psr.ic // interrupts (psr.i) are already disabled here
98 movl r25=PAGE_KERNEL
99 ;;
100 @@ -376,7 +426,11 @@ END(save_switch_stack)
101 * - b7 holds address to return to
102 * - must not touch r8-r11
103 */
104 +#ifdef XEN
105 +GLOBAL_ENTRY(load_switch_stack)
106 +#else
107 ENTRY(load_switch_stack)
108 +#endif
109 .prologue
110 .altrp b7
112 @@ -604,6 +658,11 @@ GLOBAL_ENTRY(ia64_ret_from_clone)
113 */
114 br.call.sptk.many rp=ia64_invoke_schedule_tail
115 }
116 +#ifdef XEN
117 + // new domains are cloned but not exec'ed so switch to user mode here
118 + cmp.ne pKStk,pUStk=r0,r0
119 + br.cond.spnt ia64_leave_kernel
120 +#else
121 .ret8:
122 adds r2=TI_FLAGS+IA64_TASK_SIZE,r13
123 ;;
124 @@ -614,6 +673,7 @@ GLOBAL_ENTRY(ia64_ret_from_clone)
125 ;;
126 cmp.ne p6,p0=r2,r0
127 (p6) br.cond.spnt .strace_check_retval
128 +#endif
129 ;; // added stop bits to prevent r8 dependency
130 END(ia64_ret_from_clone)
131 // fall through
132 @@ -700,9 +760,14 @@ ENTRY(ia64_leave_syscall)
133 .work_processed_syscall:
134 adds r2=PT(LOADRS)+16,r12
135 adds r3=PT(AR_BSPSTORE)+16,r12
136 +#ifdef XEN
137 + mov r31=r0
138 + ;;
139 +#else
140 adds r18=TI_FLAGS+IA64_TASK_SIZE,r13
141 ;;
142 (p6) ld4 r31=[r18] // load current_thread_info()->flags
143 +#endif
144 ld8 r19=[r2],PT(B6)-PT(LOADRS) // load ar.rsc value for "loadrs"
145 mov b7=r0 // clear b7
146 ;;
147 @@ -757,7 +822,11 @@ ENTRY(ia64_leave_syscall)
148 ;;
149 ld8.fill r12=[r2] // restore r12 (sp)
150 ld8.fill r15=[r3] // restore r15
151 +#ifdef XEN
152 + movl r3=THIS_CPU(ia64_phys_stacked_size_p8)
153 +#else
154 addl r3=THIS_CPU(ia64_phys_stacked_size_p8),r0
155 +#endif
156 ;;
157 (pUStk) ld4 r3=[r3] // r3 = cpu_data->phys_stacked_size_p8
158 (pUStk) st1 [r14]=r17
159 @@ -814,9 +883,18 @@ GLOBAL_ENTRY(ia64_leave_kernel)
160 (pUStk) cmp.eq.unc p6,p0=r0,r0 // p6 <- pUStk
161 #endif
162 .work_processed_kernel:
163 +#ifdef XEN
164 + alloc loc0=ar.pfs,0,1,1,0
165 + adds out0=16,r12
166 + ;;
167 +(p6) br.call.sptk.many b0=deliver_pending_interrupt
168 + mov ar.pfs=loc0
169 + mov r31=r0
170 +#else
171 adds r17=TI_FLAGS+IA64_TASK_SIZE,r13
172 ;;
173 (p6) ld4 r31=[r17] // load current_thread_info()->flags
174 +#endif
175 adds r21=PT(PR)+16,r12
176 ;;
178 @@ -934,7 +1012,11 @@ GLOBAL_ENTRY(ia64_leave_kernel)
179 shr.u r18=r19,16 // get byte size of existing "dirty" partition
180 ;;
181 mov r16=ar.bsp // get existing backing store pointer
182 +#ifdef XEN
183 + movl r17=THIS_CPU(ia64_phys_stacked_size_p8)
184 +#else
185 addl r17=THIS_CPU(ia64_phys_stacked_size_p8),r0
186 +#endif
187 ;;
188 ld4 r17=[r17] // r17 = cpu_data->phys_stacked_size_p8
189 (pKStk) br.cond.dpnt skip_rbs_switch
190 @@ -1323,6 +1405,7 @@ GLOBAL_ENTRY(unw_init_running)
191 br.ret.sptk.many rp
192 END(unw_init_running)
194 +#ifndef XEN
195 .rodata
196 .align 8
197 .globl sys_call_table
198 @@ -1585,3 +1668,4 @@ sys_call_table:
199 data8 sys_ni_syscall
201 .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls
202 +#endif