following piece of code is part of program present at this link http://dune.scs.stanford.edu/. I/we am/are not able to understand its dune.S file specifically following piece. I hope this piece is calling DUNE_ENTER ioctl command defined as
#define DUNE_ENTER _IOR(DUNE_MINOR, 0x01, struct dune_config)
Am I right?
.globl __dune_enter
__dune_enter://called in entry.c::do_dune_enter
pushfq
subq $REG_END, %rsp
SAVE_REGS 1, 0
SAVE_REST
movq %rsp, DUNE_CFG_RSP(%rsi)
movq %rsi, %rdx
movq $0x8020e901, %rsi /* XXX DUNE_ENTER */ //me: how does he in advance knows the address of dune_enter
movq $16, %rax /* __NR_ioctl */
syscall //me:is instruction just like sysenter or int 80 for x86_64
cmpq $0, %rax
jnz __dune_ret
movq DUNE_CFG_RET(%rdx), %rdi
movq $60, %rax /* __NR_exit */
syscall
.globl __dune_ret
__dune_ret:
RESTORE_REST
RESTORE_REGS 1, 0
addq $REG_END, %rsp
popfq
retq
Any comment or help even you feel simple and already understood will be much appreciated