diff options
author | 2015-08-05 00:16:15 -0700 | |
---|---|---|
committer | 2015-08-05 00:16:15 -0700 | |
commit | d6f9239d73d5045cb2771b69d807de4d94219ee7 (patch) | |
tree | fe81e2fe293c871c9b91f6ed89a86e511ff6677d /src/syscall.rs | |
parent | 8ca29d86e6cfd96a136f4654b4fac626bf58b4c5 (diff) | |
download | rust-x86-d6f9239d73d5045cb2771b69d807de4d94219ee7.tar.gz rust-x86-d6f9239d73d5045cb2771b69d807de4d94219ee7.tar.zst rust-x86-d6f9239d73d5045cb2771b69d807de4d94219ee7.zip |
Fix comment.
Diffstat (limited to 'src/syscall.rs')
-rw-r--r-- | src/syscall.rs | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/syscall.rs b/src/syscall.rs index 29faf2f..a1fa036 100644 --- a/src/syscall.rs +++ b/src/syscall.rs @@ -1,13 +1,16 @@ /// SYSCALL invokes an OS system-call handler at privilege level 0. -/// It does so by loading RIP from the IA32_LSTAR -/// MSR (after saving the address of the instruction following SYSCALL into RCX). +/// +/// It does so by loading RIP from the IA32_LSTAR MSR (after saving the address of the instruction following SYSCALL into RCX). +/// /// "A.2 AMD64 Linux Kernel Conventions" of System V Application Binary Interface AMD64 Architecture Processor Supplement: -/// A) The kernel interface uses %rdi, %rsi, %rdx, %r10, %r8 and %r9. -/// B) A system-call is done via the syscall instruction. The kernel destroys registers %rcx and %r11. -/// C) The number of the syscall has to be passed in register %rax. -/// D) System-calls are limited to six arguments, no argument is passed directly on the stack. -/// E) Returning from the syscall, register %rax contains the result of the system-call. A value in the range between -4095 and -1 indicates an error, it is -errno. -/// F) Only values of class INTEGER or class MEMORY are passed to the kernel. +/// +/// * The kernel interface uses %rdi, %rsi, %rdx, %r10, %r8 and %r9. +/// * A system-call is done via the syscall instruction. The kernel destroys registers %rcx and %r11. +/// * The number of the syscall has to be passed in register %rax. +/// * System-calls are limited to six arguments, no argument is passed directly on the stack. +/// * Returning from the syscall, register %rax contains the result of the system-call. A value in the range between -4095 and -1 indicates an error, it is -errno. +/// * Only values of class INTEGER or class MEMORY are passed to the kernel. +/// /// This code is inspired by the syscall.rs (https://github.com/kmcallister/syscall.rs/) project. #[macro_export] |