Changeset 7c5a8dd in mainline for kernel/arch/xen32/src/asm.S
- Timestamp:
- 2006-08-01T23:34:02Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- adf7f9c
- Parents:
- 5b23a82
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/xen32/src/asm.S
r5b23a82 r7c5a8dd 38 38 .global xen_failsafe_callback 39 39 .global enable_l_apic_in_msr 40 .global interrupt_handlers41 40 .global memcpy 42 41 .global memcpy_from_uspace … … 124 123 pop %eax 125 124 ret 126 127 # Clear nested flag128 # overwrites %ecx129 .macro CLEAR_NT_FLAG130 pushfl131 pop %ecx132 and $0xffffbfff,%ecx133 push %ecx134 popfl135 .endm136 137 ## Declare interrupt handlers138 #139 # Declare interrupt handlers for n interrupt140 # vectors starting at vector i.141 #142 # The handlers setup data segment registers143 # and call exc_dispatch().144 #145 #define INTERRUPT_ALIGN 64146 .macro handler i n147 148 .ifeq \i-0x30 # Syscall handler149 push %ds150 push %es151 push %fs152 push %gs153 154 # Push arguments on stack155 push %edi156 push %esi157 push %edx158 push %ecx159 push %eax160 161 # we must fill the data segment registers162 movw $16,%ax163 movw %ax,%ds164 movw %ax,%es165 166 sti167 168 call syscall_handler # syscall_handler(ax,cx,dx,si,di)169 cli170 addl $20, %esp # clean-up of parameters171 172 pop %gs173 pop %fs174 pop %es175 pop %ds176 177 CLEAR_NT_FLAG178 iret179 .else180 /*181 * This macro distinguishes between two versions of ia32 exceptions.182 * One version has error word and the other does not have it.183 * The latter version fakes the error word on the stack so that the184 * handlers and istate_t can be the same for both types.185 */186 .iflt \i-32187 .if (1 << \i) & ERROR_WORD_INTERRUPT_LIST188 /*189 * With error word, do nothing190 */191 .else192 /*193 * Version without error word,194 */195 subl $4, %esp196 .endif197 .else198 /*199 * Version without error word,200 */201 subl $4, %esp202 .endif203 204 push %ds205 push %es206 push %fs207 push %gs208 209 #ifdef CONFIG_DEBUG_ALLREGS210 push %ebx211 push %ebp212 push %edi213 push %esi214 #else215 sub $16, %esp216 #endif217 push %edx218 push %ecx219 push %eax220 221 # we must fill the data segment registers222 movw $16,%ax223 movw %ax,%ds224 movw %ax,%es225 226 pushl %esp # *istate227 pushl $(\i) # intnum228 call exc_dispatch # excdispatch(intnum, *istate)229 addl $8,%esp # Clear arguments from stack230 231 CLEAR_NT_FLAG # Modifies %ecx232 233 pop %eax234 pop %ecx235 pop %edx236 #ifdef CONFIG_DEBUG_ALLREGS237 pop %esi238 pop %edi239 pop %ebp240 pop %ebx241 #else242 add $16, %esp243 #endif244 245 pop %gs246 pop %fs247 pop %es248 pop %ds249 250 addl $4,%esp # Skip error word, no matter whether real or fake.251 iret252 .endif253 254 .align INTERRUPT_ALIGN255 .if (\n-\i)-1256 handler "(\i+1)",\n257 .endif258 .endm259 260 # keep in sync with pm.h !!!261 IDT_ITEMS=64262 .align INTERRUPT_ALIGN263 interrupt_handlers:264 h_start:265 handler 0 IDT_ITEMS266 h_end:267 268 .data269 .global interrupt_handler_size270 271 interrupt_handler_size: .long (h_end-h_start)/IDT_ITEMS
Note:
See TracChangeset
for help on using the changeset viewer.