Changeset f77e591d in mainline for kernel/arch/amd64/src
- Timestamp:
- 2010-07-14T13:05:28Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 257ceb1, 4003861
- Parents:
- 2bf2e1d
- Location:
- kernel/arch/amd64/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/src/asm.S
r2bf2e1d rf77e591d 192 192 #define ERROR_WORD_INTERRUPT_LIST 0x00027D00 193 193 194 #define INTERRUPT_ALIGN 256 195 196 /** Declare interrupt handlers 197 * 198 * Declare interrupt handlers for n interrupt 199 * vectors starting at vector i. 200 * 201 * The handlers call exc_dispatch(). 202 * 203 */ 204 .macro handler i n 205 194 .macro handler i 195 .global int_\i 196 int_\i: 197 206 198 /* 207 199 * Choose between version with error code and version without error 208 * code. Both versions have to be of the same size. amd64 assembly is, 209 * however, a little bit tricky. For instance, subq $0x80, %rsp and 210 * subq $0x78, %rsp can result in two instructions with different 211 * op-code lengths. 212 * Therefore we align the interrupt handlers. 200 * code. 213 201 */ 214 202 … … 290 278 addq $(ISTATE_SOFT_SIZE + 8), %rsp 291 279 iretq 292 293 .align INTERRUPT_ALIGN294 .if (\n - \i) - 1295 handler "(\i + 1)", \n296 .endif297 280 .endm 298 281 299 .align INTERRUPT_ALIGN 282 #define LIST_0_63 \ 283 0, 1, 2, 3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,\ 284 28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,\ 285 53,54,55,56,57,58,59,60,61,62,63 286 300 287 interrupt_handlers: 301 h_start: 302 handler 0 IDT_ITEMS303 h_end: 288 .irp cnt, LIST_0_63 289 handler \cnt 290 .endr 304 291 305 292 /** Low-level syscall handler … … 545 532 ret 546 533 547 .data548 .global interrupt_handler_size549 550 interrupt_handler_size: .quad (h_end - h_start) / IDT_ITEMS -
kernel/arch/amd64/src/pm.c
r2bf2e1d rf77e591d 175 175 d->present = 1; 176 176 d->type = AR_INTERRUPT; /* masking interrupt */ 177 178 idt_setoffset(d, ((uintptr_t) interrupt_handlers) +179 i * interrupt_handler_size);180 177 } 178 179 d = &idt[0]; 180 idt_setoffset(d++, (uintptr_t) &int_0); 181 idt_setoffset(d++, (uintptr_t) &int_1); 182 idt_setoffset(d++, (uintptr_t) &int_2); 183 idt_setoffset(d++, (uintptr_t) &int_3); 184 idt_setoffset(d++, (uintptr_t) &int_4); 185 idt_setoffset(d++, (uintptr_t) &int_5); 186 idt_setoffset(d++, (uintptr_t) &int_6); 187 idt_setoffset(d++, (uintptr_t) &int_7); 188 idt_setoffset(d++, (uintptr_t) &int_8); 189 idt_setoffset(d++, (uintptr_t) &int_9); 190 idt_setoffset(d++, (uintptr_t) &int_10); 191 idt_setoffset(d++, (uintptr_t) &int_11); 192 idt_setoffset(d++, (uintptr_t) &int_12); 193 idt_setoffset(d++, (uintptr_t) &int_13); 194 idt_setoffset(d++, (uintptr_t) &int_14); 195 idt_setoffset(d++, (uintptr_t) &int_15); 196 idt_setoffset(d++, (uintptr_t) &int_16); 197 idt_setoffset(d++, (uintptr_t) &int_17); 198 idt_setoffset(d++, (uintptr_t) &int_18); 199 idt_setoffset(d++, (uintptr_t) &int_19); 200 idt_setoffset(d++, (uintptr_t) &int_20); 201 idt_setoffset(d++, (uintptr_t) &int_21); 202 idt_setoffset(d++, (uintptr_t) &int_22); 203 idt_setoffset(d++, (uintptr_t) &int_23); 204 idt_setoffset(d++, (uintptr_t) &int_24); 205 idt_setoffset(d++, (uintptr_t) &int_25); 206 idt_setoffset(d++, (uintptr_t) &int_26); 207 idt_setoffset(d++, (uintptr_t) &int_27); 208 idt_setoffset(d++, (uintptr_t) &int_28); 209 idt_setoffset(d++, (uintptr_t) &int_29); 210 idt_setoffset(d++, (uintptr_t) &int_30); 211 idt_setoffset(d++, (uintptr_t) &int_31); 212 idt_setoffset(d++, (uintptr_t) &int_32); 213 idt_setoffset(d++, (uintptr_t) &int_33); 214 idt_setoffset(d++, (uintptr_t) &int_34); 215 idt_setoffset(d++, (uintptr_t) &int_35); 216 idt_setoffset(d++, (uintptr_t) &int_36); 217 idt_setoffset(d++, (uintptr_t) &int_37); 218 idt_setoffset(d++, (uintptr_t) &int_38); 219 idt_setoffset(d++, (uintptr_t) &int_39); 220 idt_setoffset(d++, (uintptr_t) &int_40); 221 idt_setoffset(d++, (uintptr_t) &int_41); 222 idt_setoffset(d++, (uintptr_t) &int_42); 223 idt_setoffset(d++, (uintptr_t) &int_43); 224 idt_setoffset(d++, (uintptr_t) &int_44); 225 idt_setoffset(d++, (uintptr_t) &int_45); 226 idt_setoffset(d++, (uintptr_t) &int_46); 227 idt_setoffset(d++, (uintptr_t) &int_47); 228 idt_setoffset(d++, (uintptr_t) &int_48); 229 idt_setoffset(d++, (uintptr_t) &int_49); 230 idt_setoffset(d++, (uintptr_t) &int_50); 231 idt_setoffset(d++, (uintptr_t) &int_51); 232 idt_setoffset(d++, (uintptr_t) &int_52); 233 idt_setoffset(d++, (uintptr_t) &int_53); 234 idt_setoffset(d++, (uintptr_t) &int_54); 235 idt_setoffset(d++, (uintptr_t) &int_55); 236 idt_setoffset(d++, (uintptr_t) &int_56); 237 idt_setoffset(d++, (uintptr_t) &int_57); 238 idt_setoffset(d++, (uintptr_t) &int_58); 239 idt_setoffset(d++, (uintptr_t) &int_59); 240 idt_setoffset(d++, (uintptr_t) &int_60); 241 idt_setoffset(d++, (uintptr_t) &int_61); 242 idt_setoffset(d++, (uintptr_t) &int_62); 243 idt_setoffset(d++, (uintptr_t) &int_63); 181 244 } 182 245
Note:
See TracChangeset
for help on using the changeset viewer.