blob: bc175c1ca89b7cd287bb2f3c3e3a32c8c42f8525 (
plain)
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
28
29
30
31
32
33
34
|
.section .text
.global fake_syscall_entry
.global fake_syscall_return
.extern fake_syscall_handler
fake_syscall_entry:
hlt;
fake_syscall_return:
cli
fake_syscall_swap:
mov %cs, %rax
pushq %rax
pushq %rdx
mov %ds, %rax
pushq %rax
sub $16, %rsp
sgdt (%rsp)
mov %rsp, (%rsi)
mov %rdi, %rsp
lgdt (%rsp)
add $16, %rsp
movw (%rsp), %ds
movw (%rsp), %es
movw (%rsp), %fs
movw (%rsp), %gs
movw (%rsp), %ss
add $8, %rsp
lretq
|