2018-12-16 01:50:03 +01:00
|
|
|
/*******************************************************************************/
|
|
|
|
/* COS2000 - Compatible Operating System - LGPL v3 - Hordé Nicolas */
|
|
|
|
/* */
|
|
|
|
|
|
|
|
.section .text
|
|
|
|
|
|
|
|
.macro exception num
|
|
|
|
.global wrapper_exception\num
|
|
|
|
wrapper_exception\num:
|
|
|
|
pushl %ss
|
|
|
|
pushl %esp
|
|
|
|
pushf
|
|
|
|
pushl %cs
|
|
|
|
pushl $\num
|
2018-12-19 16:13:47 +01:00
|
|
|
jmp exception_suite
|
2018-12-16 01:50:03 +01:00
|
|
|
.endm
|
|
|
|
|
2018-12-19 16:13:47 +01:00
|
|
|
.macro semidumpcpu
|
2018-12-20 17:16:51 +01:00
|
|
|
cli
|
2018-12-16 01:50:03 +01:00
|
|
|
pushl %ds
|
|
|
|
pushl %es
|
|
|
|
pushl %fs
|
|
|
|
pushl %gs
|
|
|
|
pushl %eax
|
|
|
|
pushl %ebx
|
|
|
|
pushl %ecx
|
|
|
|
pushl %edx
|
|
|
|
pushl %esi
|
|
|
|
pushl %edi
|
|
|
|
pushl %ebp
|
|
|
|
mov %cr0, %eax
|
|
|
|
pushl %eax
|
|
|
|
mov %cr2, %eax
|
|
|
|
pushl %eax
|
|
|
|
mov %cr3, %eax
|
|
|
|
pushl %eax
|
|
|
|
mov %cr4, %eax
|
|
|
|
pushl %eax
|
|
|
|
mov %dr0, %eax
|
|
|
|
pushl %eax
|
|
|
|
mov %dr1, %eax
|
|
|
|
pushl %eax
|
|
|
|
mov %dr2, %eax
|
|
|
|
pushl %eax
|
|
|
|
mov %dr3, %eax
|
|
|
|
pushl %eax
|
|
|
|
mov %dr6, %eax
|
|
|
|
pushl %eax
|
|
|
|
mov %dr7, %eax
|
|
|
|
pushl %eax
|
|
|
|
mov $0xC0000080, %ecx
|
|
|
|
rdmsr
|
|
|
|
pushl %edx
|
|
|
|
pushl %eax
|
|
|
|
pushl %esp
|
2018-12-19 16:13:47 +01:00
|
|
|
.endm
|
|
|
|
|
|
|
|
exception 0
|
|
|
|
exception 1
|
|
|
|
exception 2
|
|
|
|
exception 3
|
|
|
|
exception 4
|
|
|
|
exception 5
|
|
|
|
exception 6
|
|
|
|
exception 7
|
|
|
|
exception 8
|
|
|
|
exception 9
|
|
|
|
exception 10
|
|
|
|
exception 11
|
|
|
|
exception 12
|
|
|
|
exception 13
|
|
|
|
exception 14
|
|
|
|
exception 15
|
|
|
|
exception 16
|
|
|
|
exception 17
|
|
|
|
exception 18
|
|
|
|
|
|
|
|
exception_suite:
|
|
|
|
semidumpcpu
|
|
|
|
call exception_handler
|
|
|
|
|
|
|
|
.global wrapper_sysenter
|
|
|
|
wrapper_sysenter:
|
|
|
|
pushl %ss
|
|
|
|
pushl %esp
|
|
|
|
pushf
|
|
|
|
pushl %cs
|
|
|
|
pushl $0x00
|
|
|
|
semidumpcpu
|
2018-12-16 01:50:03 +01:00
|
|
|
call sysenter_handler
|
|
|
|
|
2018-12-20 17:16:51 +01:00
|
|
|
.global wrapper_interruption20
|
|
|
|
wrapper_interruption20:
|
|
|
|
pushl %ss
|
|
|
|
pushl %esp
|
|
|
|
pushf
|
|
|
|
pushl %cs
|
|
|
|
pushl $0x14
|
|
|
|
semidumpcpu
|
|
|
|
call interruption_handler
|
|
|
|
|
2018-12-19 16:13:47 +01:00
|
|
|
.global wrapper_interruption
|
|
|
|
wrapper_interruption:
|
|
|
|
pushl %ss
|
2018-12-16 01:50:03 +01:00
|
|
|
pushl %esp
|
2018-12-19 16:13:47 +01:00
|
|
|
pushf
|
|
|
|
pushl %cs
|
|
|
|
pushl $0x00
|
|
|
|
semidumpcpu
|
|
|
|
call interruption_handler
|
|
|
|
|
|
|
|
.global wrapper_timer
|
|
|
|
wrapper_timer:
|
|
|
|
pushl %ss
|
|
|
|
pushl %esp
|
|
|
|
pushf
|
|
|
|
pushl %cs
|
|
|
|
pushl $0x00
|
|
|
|
semidumpcpu
|
|
|
|
call timer_handler
|