Changeset 53f9821 in mainline for arch/ia32/src/asm.S
- Timestamp:
- 2006-03-20T20:32:17Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 018d957e
- Parents:
- 9d3e185
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/src/asm.S
r9d3e185 r53f9821 69 69 ret 70 70 71 # Clear nested flag 72 # overwrites %ecx 73 .macro CLEAR_NT_FLAG 74 pushfl 75 pop %ecx 76 and $0xffffbfff,%ecx 77 push %ecx 78 popfl 79 .endm 71 80 72 81 ## Declare interrupt handlers … … 78 87 # and call exc_dispatch(). 79 88 # 89 #define INTERRUPT_ALIGN 64 80 90 .macro handler i n 81 91 92 .ifeq \i-0x30 # Syscall handler 93 push %ds 94 push %es 95 push %fs 96 push %gs 97 98 # Push arguments on stack 99 push %edi 100 push %esi 101 push %edx 102 push %ecx 103 push %eax 104 105 # we must fill the data segment registers 106 movw $16,%ax 107 movw %ax,%ds 108 movw %ax,%es 109 110 sti 111 call syscall_handler # syscall_handler(ax,cx,dx,si,di) 112 cli 113 addl $20, %esp # clean-up of parameters 114 115 pop %gs 116 pop %fs 117 pop %es 118 pop %ds 119 120 CLEAR_NT_FLAG 121 iret 122 .else 82 123 /* 83 124 * This macro distinguishes between two versions of ia32 exceptions. … … 86 127 * handlers and istate_t can be the same for both types. 87 128 */ 88 89 129 .iflt \i-32 90 130 .if (1 << \i) & ERROR_WORD_INTERRUPT_LIST 91 /* 92 * Version with error word. 93 * Just take space equal to subl $4, %esp. 131 /* 132 * With error word, do nothing 94 133 */ 95 nop96 nop97 nop98 134 .else 99 135 /* … … 107 143 */ 108 144 subl $4, %esp 109 .endif 110 111 pusha 112 movl %esp, %ebp 145 .endif 146 113 147 push %ds 114 148 push %es … … 116 150 push %gs 117 151 152 #ifdef CONFIG_DEBUG_ALLREGS 153 push %ebx 154 push %ebp 155 push %edi 156 push %esi 157 #else 158 sub $16, %esp 159 #endif 160 push %edx 161 push %ecx 162 push %eax 163 118 164 # we must fill the data segment registers 119 165 movw $16,%ax … … 121 167 movw %ax,%es 122 168 123 pushl %ebp 124 pushl $(\i) 125 call exc_dispatch 126 addl $8,%esp 127 169 pushl %esp # *istate 170 pushl $(\i) # intnum 171 call exc_dispatch # excdispatch(intnum, *istate) 172 addl $8,%esp # Clear arguments from stack 173 174 CLEAR_NT_FLAG # Modifies %ecx 175 176 pop %eax 177 pop %ecx 178 pop %edx 179 #ifdef CONFIG_DEBUG_ALLREGS 180 pop %esi 181 pop %edi 182 pop %ebp 183 pop %ebx 184 #else 185 add $16, %esp 186 #endif 187 128 188 pop %gs 129 189 pop %fs … … 131 191 pop %ds 132 192 133 # Clear Nested Task flag.134 pushfl135 pop %eax136 and $0xffffbfff,%eax137 push %eax138 popfl139 140 popa141 193 addl $4,%esp # Skip error word, no matter whether real or fake. 142 194 iret 143 195 .endif 196 197 .align INTERRUPT_ALIGN 144 198 .if (\n-\i)-1 145 199 handler "(\i+1)",\n … … 149 203 # keep in sync with pm.h !!! 150 204 IDT_ITEMS=64 205 .align INTERRUPT_ALIGN 151 206 interrupt_handlers: 152 207 h_start: 153 handler 0 64 154 # handler 64 128 155 # handler 128 192 156 # handler 192 256 208 handler 0 IDT_ITEMS 157 209 h_end: 158 210
Note:
See TracChangeset
for help on using the changeset viewer.