brintos

brintos / linux-shallow public Read only

0
0
Text · 1.3 KiB · 7629819 Raw
82 lines · plain
1handle_exception:2	push %r153	push %r144	push %r135	push %r126	push %r117	push %r108	push %r99	push %r810 11	push %rdi12	push %rsi13	push %rbp14	push %rbx15	push %rdx16	push %rcx17	push %rax18	mov %rsp, %rdi19 20	call route_exception21 22	pop %rax23	pop %rcx24	pop %rdx25	pop %rbx26	pop %rbp27	pop %rsi28	pop %rdi29	pop %r830	pop %r931	pop %r1032	pop %r1133	pop %r1234	pop %r1335	pop %r1436	pop %r1537 38	/* Discard vector and error code. */39	add $16, %rsp40	iretq41 42/*43 * Build the handle_exception wrappers which push the vector/error code on the44 * stack and an array of pointers to those wrappers.45 */46.pushsection .rodata47.globl idt_handlers48idt_handlers:49.popsection50 51.macro HANDLERS has_error from to52	vector = \from53	.rept \to - \from + 154	.align 855 56	/* Fetch current address and append it to idt_handlers. */57666 :58.pushsection .rodata59	.quad 666b60.popsection61 62	.if ! \has_error63	pushq $064	.endif65	pushq $vector66	jmp handle_exception67	vector = vector + 168	.endr69.endm70 71.global idt_handler_code72idt_handler_code:73	HANDLERS has_error=0 from=0  to=774	HANDLERS has_error=1 from=8  to=875	HANDLERS has_error=0 from=9  to=976	HANDLERS has_error=1 from=10 to=1477	HANDLERS has_error=0 from=15 to=1678	HANDLERS has_error=1 from=17 to=1779	HANDLERS has_error=0 from=18 to=25580 81.section        .note.GNU-stack, "", %progbits82