diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-26 16:07:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-26 16:07:55 -0400 |
commit | b278240839e20fa9384ea430df463b367b90e04e (patch) | |
tree | f99f0c8cdd4cc7f177cd75440e6bd181cded7fb3 /arch/i386/kernel/head.S | |
parent | dd77a4ee0f3981693d4229aa1d57cea9e526ff47 (diff) | |
parent | 3f75f42d7733e73aca5c78326489efd4189e0111 (diff) |
Merge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6
* 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6: (225 commits)
[PATCH] Don't set calgary iommu as default y
[PATCH] i386/x86-64: New Intel feature flags
[PATCH] x86: Add a cumulative thermal throttle event counter.
[PATCH] i386: Make the jiffies compares use the 64bit safe macros.
[PATCH] x86: Refactor thermal throttle processing
[PATCH] Add 64bit jiffies compares (for use with get_jiffies_64)
[PATCH] Fix unwinder warning in traps.c
[PATCH] x86: Allow disabling early pci scans with pci=noearly or disallowing conf1
[PATCH] x86: Move direct PCI scanning functions out of line
[PATCH] i386/x86-64: Make all early PCI scans dependent on CONFIG_PCI
[PATCH] Don't leak NT bit into next task
[PATCH] i386/x86-64: Work around gcc bug with noreturn functions in unwinder
[PATCH] Fix some broken white space in ia32_signal.c
[PATCH] Initialize argument registers for 32bit signal handlers.
[PATCH] Remove all traces of signal number conversion
[PATCH] Don't synchronize time reading on single core AMD systems
[PATCH] Remove outdated comment in x86-64 mmconfig code
[PATCH] Use string instructions for Core2 copy/clear
[PATCH] x86: - restore i8259A eoi status on resume
[PATCH] i386: Split multi-line printk in oops output.
...
Diffstat (limited to 'arch/i386/kernel/head.S')
-rw-r--r-- | arch/i386/kernel/head.S | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/arch/i386/kernel/head.S b/arch/i386/kernel/head.S index a6b8bd89aa27..be9d883c62ce 100644 --- a/arch/i386/kernel/head.S +++ b/arch/i386/kernel/head.S | |||
@@ -371,8 +371,65 @@ rp_sidt: | |||
371 | addl $8,%edi | 371 | addl $8,%edi |
372 | dec %ecx | 372 | dec %ecx |
373 | jne rp_sidt | 373 | jne rp_sidt |
374 | |||
375 | .macro set_early_handler handler,trapno | ||
376 | lea \handler,%edx | ||
377 | movl $(__KERNEL_CS << 16),%eax | ||
378 | movw %dx,%ax | ||
379 | movw $0x8E00,%dx /* interrupt gate - dpl=0, present */ | ||
380 | lea idt_table,%edi | ||
381 | movl %eax,8*\trapno(%edi) | ||
382 | movl %edx,8*\trapno+4(%edi) | ||
383 | .endm | ||
384 | |||
385 | set_early_handler handler=early_divide_err,trapno=0 | ||
386 | set_early_handler handler=early_illegal_opcode,trapno=6 | ||
387 | set_early_handler handler=early_protection_fault,trapno=13 | ||
388 | set_early_handler handler=early_page_fault,trapno=14 | ||
389 | |||
374 | ret | 390 | ret |
375 | 391 | ||
392 | early_divide_err: | ||
393 | xor %edx,%edx | ||
394 | pushl $0 /* fake errcode */ | ||
395 | jmp early_fault | ||
396 | |||
397 | early_illegal_opcode: | ||
398 | movl $6,%edx | ||
399 | pushl $0 /* fake errcode */ | ||
400 | jmp early_fault | ||
401 | |||
402 | early_protection_fault: | ||
403 | movl $13,%edx | ||
404 | jmp early_fault | ||
405 | |||
406 | early_page_fault: | ||
407 | movl $14,%edx | ||
408 | jmp early_fault | ||
409 | |||
410 | early_fault: | ||
411 | cld | ||
412 | #ifdef CONFIG_PRINTK | ||
413 | movl $(__KERNEL_DS),%eax | ||
414 | movl %eax,%ds | ||
415 | movl %eax,%es | ||
416 | cmpl $2,early_recursion_flag | ||
417 | je hlt_loop | ||
418 | incl early_recursion_flag | ||
419 | movl %cr2,%eax | ||
420 | pushl %eax | ||
421 | pushl %edx /* trapno */ | ||
422 | pushl $fault_msg | ||
423 | #ifdef CONFIG_EARLY_PRINTK | ||
424 | call early_printk | ||
425 | #else | ||
426 | call printk | ||
427 | #endif | ||
428 | #endif | ||
429 | hlt_loop: | ||
430 | hlt | ||
431 | jmp hlt_loop | ||
432 | |||
376 | /* This is the default interrupt "handler" :-) */ | 433 | /* This is the default interrupt "handler" :-) */ |
377 | ALIGN | 434 | ALIGN |
378 | ignore_int: | 435 | ignore_int: |
@@ -386,6 +443,9 @@ ignore_int: | |||
386 | movl $(__KERNEL_DS),%eax | 443 | movl $(__KERNEL_DS),%eax |
387 | movl %eax,%ds | 444 | movl %eax,%ds |
388 | movl %eax,%es | 445 | movl %eax,%es |
446 | cmpl $2,early_recursion_flag | ||
447 | je hlt_loop | ||
448 | incl early_recursion_flag | ||
389 | pushl 16(%esp) | 449 | pushl 16(%esp) |
390 | pushl 24(%esp) | 450 | pushl 24(%esp) |
391 | pushl 32(%esp) | 451 | pushl 32(%esp) |
@@ -431,9 +491,16 @@ ENTRY(stack_start) | |||
431 | 491 | ||
432 | ready: .byte 0 | 492 | ready: .byte 0 |
433 | 493 | ||
494 | early_recursion_flag: | ||
495 | .long 0 | ||
496 | |||
434 | int_msg: | 497 | int_msg: |
435 | .asciz "Unknown interrupt or fault at EIP %p %p %p\n" | 498 | .asciz "Unknown interrupt or fault at EIP %p %p %p\n" |
436 | 499 | ||
500 | fault_msg: | ||
501 | .ascii "Int %d: CR2 %p err %p EIP %p CS %p flags %p\n" | ||
502 | .asciz "Stack: %p %p %p %p %p %p %p %p\n" | ||
503 | |||
437 | /* | 504 | /* |
438 | * The IDT and GDT 'descriptors' are a strange 48-bit object | 505 | * The IDT and GDT 'descriptors' are a strange 48-bit object |
439 | * only used by the lidt and lgdt instructions. They are not | 506 | * only used by the lidt and lgdt instructions. They are not |