|
|
1.1 root 1: /*
1.1.1.2 root 2: * linux/kernel/asm.s
3: *
4: * (C) 1991 Linus Torvalds
5: */
6:
7: /*
1.1 root 8: * asm.s contains the low-level code for most hardware faults.
9: * page_exception is handled by the mm, so that isn't here. This
10: * file also handles (hopefully) fpu-exceptions due to TS-bit, as
11: * the fpu must be properly saved/resored. This hasn't been tested.
12: */
13:
14: .globl _divide_error,_debug,_nmi,_int3,_overflow,_bounds,_invalid_op
1.1.1.3 root 15: .globl _double_fault,_coprocessor_segment_overrun
1.1 root 16: .globl _invalid_TSS,_segment_not_present,_stack_segment
1.1.1.2 root 17: .globl _general_protection,_coprocessor_error,_irq13,_reserved
1.1.1.4 root 18: .globl _alignment_check
1.1.1.5 ! root 19: .globl _page_fault
1.1 root 20:
21: _divide_error:
1.1.1.5 ! root 22: pushl $0 # no error code
1.1 root 23: pushl $_do_divide_error
1.1.1.5 ! root 24: error_code:
! 25: push %fs
! 26: push %es
! 27: push %ds
! 28: pushl %eax
! 29: pushl %ebp
1.1 root 30: pushl %edi
31: pushl %esi
1.1.1.5 ! root 32: pushl %edx
! 33: pushl %ecx
! 34: pushl %ebx
! 35: cld
! 36: movl $-1, %eax
! 37: xchgl %eax, 0x2c(%esp) # orig_eax (get the error code. )
! 38: xorl %ebx,%ebx # zero ebx
! 39: mov %gs,%bx # get the lower order bits of gs
! 40: xchgl %ebx, 0x28(%esp) # get the address and save gs.
! 41: pushl %eax # push the error code
! 42: lea 52(%esp),%edx
1.1 root 43: pushl %edx
44: movl $0x10,%edx
45: mov %dx,%ds
46: mov %dx,%es
47: mov %dx,%fs
1.1.1.5 ! root 48: call *%ebx
1.1 root 49: addl $8,%esp
1.1.1.5 ! root 50: popl %ebx
! 51: popl %ecx
! 52: popl %edx
1.1 root 53: popl %esi
54: popl %edi
1.1.1.5 ! root 55: popl %ebp
1.1 root 56: popl %eax
1.1.1.5 ! root 57: pop %ds
! 58: pop %es
! 59: pop %fs
! 60: pop %gs
! 61: addl $4,%esp
1.1 root 62: iret
63:
64: _debug:
1.1.1.5 ! root 65: pushl $0
1.1 root 66: pushl $_do_int3 # _do_debug
1.1.1.5 ! root 67: jmp error_code
1.1 root 68:
69: _nmi:
1.1.1.5 ! root 70: pushl $0
1.1 root 71: pushl $_do_nmi
1.1.1.5 ! root 72: jmp error_code
1.1 root 73:
74: _int3:
1.1.1.5 ! root 75: pushl $0
1.1 root 76: pushl $_do_int3
1.1.1.5 ! root 77: jmp error_code
1.1 root 78:
79: _overflow:
1.1.1.5 ! root 80: pushl $0
1.1 root 81: pushl $_do_overflow
1.1.1.5 ! root 82: jmp error_code
1.1 root 83:
84: _bounds:
1.1.1.5 ! root 85: pushl $0
1.1 root 86: pushl $_do_bounds
1.1.1.5 ! root 87: jmp error_code
1.1 root 88:
89: _invalid_op:
1.1.1.5 ! root 90: pushl $0
1.1 root 91: pushl $_do_invalid_op
1.1.1.5 ! root 92: jmp error_code
1.1 root 93:
94: _coprocessor_segment_overrun:
1.1.1.5 ! root 95: pushl $0
1.1 root 96: pushl $_do_coprocessor_segment_overrun
1.1.1.5 ! root 97: jmp error_code
1.1 root 98:
99: _reserved:
1.1.1.5 ! root 100: pushl $0
1.1 root 101: pushl $_do_reserved
1.1.1.5 ! root 102: jmp error_code
1.1 root 103:
1.1.1.2 root 104: _irq13:
105: pushl %eax
106: xorb %al,%al
107: outb %al,$0xF0
108: movb $0x20,%al
109: outb %al,$0x20
110: jmp 1f
111: 1: jmp 1f
112: 1: outb %al,$0xA0
113: popl %eax
1.1.1.3 root 114: jmp _coprocessor_error
1.1 root 115:
116: _double_fault:
117: pushl $_do_double_fault
1.1.1.5 ! root 118: jmp error_code
1.1 root 119:
120: _invalid_TSS:
121: pushl $_do_invalid_TSS
122: jmp error_code
123:
124: _segment_not_present:
125: pushl $_do_segment_not_present
126: jmp error_code
127:
128: _stack_segment:
129: pushl $_do_stack_segment
130: jmp error_code
131:
132: _general_protection:
133: pushl $_do_general_protection
134: jmp error_code
135:
1.1.1.4 root 136: _alignment_check:
137: pushl $_do_alignment_check
138: jmp error_code
139:
1.1.1.5 ! root 140: _page_fault:
! 141: pushl $_do_page_fault
! 142: jmp error_code
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.