~pmdj/ubuntu/trusty/qemu/2.9+applesmc+fadtv3

« back to all changes in this revision

Viewing changes to roms/ipxe/src/arch/x86_64/core/linux/linux_syscall.S

  • Committer: Phil Dennis-Jordan
  • Date: 2017-07-21 08:03:43 UTC
  • mfrom: (1.1.1)
  • Revision ID: phil@philjordan.eu-20170721080343-2yr2vdj7713czahv
New upstream release 2.9.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
        .section ".data"
 
3
        .globl linux_errno
 
4
 
 
5
linux_errno:    .int 0
 
6
 
 
7
        .section ".text"
 
8
        .code64
 
9
        .globl linux_syscall
 
10
        .type  linux_syscall, @function
 
11
 
 
12
linux_syscall:
 
13
        movq    %rdi, %rax    // C arg1 -> syscall number
 
14
        movq    %rsi, %rdi    // C arg2 -> syscall arg1
 
15
        movq    %rdx, %rsi    // C arg3 -> syscall arg2
 
16
        movq    %rcx, %rdx    // C arg4 -> syscall arg3
 
17
        movq    %r8, %r10     // C arg5 -> syscall arg4
 
18
        movq    %r9, %r8      // C arg6 -> syscall arg5
 
19
        movq    8(%rsp), %r9  // C arg7 -> syscall arg6
 
20
 
 
21
        syscall
 
22
 
 
23
        cmpq    $-4095, %rax
 
24
        jae     1f
 
25
        ret
 
26
 
 
27
1:
 
28
        negq    %rax
 
29
        movl    %eax, linux_errno
 
30
        movq    $-1, %rax
 
31
        ret
 
32
 
 
33
        .size linux_syscall, . - linux_syscall