diff options
| author | Eugen Wissner <belka@caraus.de> | 2018-04-22 08:07:20 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2018-04-22 08:07:20 +0200 |
| commit | e8222123e648b41c4d25ea3a98c63242fc0648f1 (patch) | |
| tree | f9e7e480e7af508556dd74c056cfc88d5da2fbb0 /arch | |
| parent | 5cac28c0931c2575e3809f7a0d738ed77d54d87a (diff) | |
| download | tanya-e8222123e648b41c4d25ea3a98c63242fc0648f1.tar.gz | |
Use syscall instead of mmap and munmap
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/x64/linux/syscall.S | 41 |
1 files changed, 14 insertions, 27 deletions
diff --git a/arch/x64/linux/syscall.S b/arch/x64/linux/syscall.S index 9261d87..7c00036 100644 --- a/arch/x64/linux/syscall.S +++ b/arch/x64/linux/syscall.S @@ -22,44 +22,31 @@ syscall1: ret - .globl syscall2 - .type syscall2, @function +// 2 parameters. + .globl _D5tanya3sys5linux7syscall7syscallFNbNilllZl + .type _D5tanya3sys5linux7syscall7syscallFNbNilllZl, @function -syscall2: - // Store registers. - movq %rdi, %r8 - - movq %rdx, %rax // Syscall number. - - // Syscall arguments. - movq %rsi, %rdi - movq %r8, %rsi +_D5tanya3sys5linux7syscall7syscallFNbNilllZl: + movq %rdx, %rax syscall - // Restore registers. - movq %rdi, %rsi - movq %r8, %rdi - ret - .globl syscall3 - .type syscall3, @function +// 6 parameters. + .globl _D5tanya3sys5linux7syscall7syscallFNbNilllllllZl + .type _D5tanya3sys5linux7syscall7syscallFNbNilllllllZl, @function -syscall3: - // Store registers. - movq %rdi, %r8 +_D5tanya3sys5linux7syscall7syscallFNbNilllllllZl: + pushq %rbp + movq %rsp, %rbp - movq %rcx, %rax // Syscall number. + movq 16(%rbp), %rax - // Syscall arguments. - movq %rdx, %rdi - movq %r8, %rdx + mov %rcx, %r10 syscall - // Restore registers. - movq %r8, %rdi - + leave ret |
