libk  Diff

Differences From Artifact [0ee1179d8c]:

To Artifact [ceb93a428c]:


     1      1   bits 64
     2      2   %include "../arch/x86.lin.64.s"
     3      3   %include "../arch/x86.cdecl.64.s"
     4      4   ; vim: ft=nasm
     5      5   
     6         -global kmem_posix_mmap
     7         -kmem_posix_mmap:
            6  +global kmem_platform_mmap
            7  +kmem_platform_mmap:
     8      8   	; to call mmap, we need to translate the cdecl64
     9      9   	; register arguments to their appropriate syscall64
    10     10   	; registers. these are mostly the same, with one
    11     11   	; obnoxious exception. the NOPs have been written
    12     12   	; in as comments to aid in understanding.
    13     13   
    14     14   	  mov sys.reg.1, ccall.reg.0 ;nop - rdi → rdi
................................................................................
    18     18   	  mov sys.reg.5, ccall.reg.4 ;nop - r8 → r8
    19     19   	  mov sys.reg.6, ccall.reg.5 ;nop - r9 → r9
    20     20   
    21     21   	mov sys.reg.0, sys.mmap
    22     22   	sys.call
    23     23   
    24     24   	mov ccall.reg.ret, sys.reg.ret ; rax → rdi
           25  +	ret