The system calls:
-Input and output registers in order: %rdi, %rsi, %rdx, %r10, %r8, %r9.
+Input registers in order: %rdi, %rsi, %rdx, %r10, %r8, %r9.
In %rax, the syscall id is specified.
If the operation succeeds, %rax contains the result (think SystemV ABI) (≥ 0). If it fails, %rax contains the opposite of the error code. (< 0)
+The only registers clobbered are %rcx, %r11, %rax, %rdx. (The last two are the return registers.)
sport_t make_sport();
Creates a server port, with no associated clients.
result.PML4T = phys_ptr<paging::PML4T>(os::paging::page_allocator.allocate(1).ptr.get_phys_addr());
result.rip = std::uint64_t(elf_header.entry);
result.rsp = std::uint64_t(stack + stack_size);
+ result.rax = 0;
result.rbx = 0;
+ result.rcx = 0;
+ result.rdx = 0;
result.rbp = 0;
+ result.rsi = 0;
+ result.rdi = 0;
+ result.r8 = 0;
+ result.r9 = 0;
+ result.r10 = 0;
+ result.r11 = 0;
result.r12 = 0;
result.r13 = 0;
result.r14 = 0;
std::uint64_t r15;
std::uint64_t rip;
port ports[2043];
- char padding[16];
};
-static_assert(sizeof(process) == 4096 * 16);
static_assert(0xFFFF'C000'0000'0000 + sizeof(process) * 2048 < 0xFFFF'FFFF'8000'0000);
extern "C" process& get_process(std::uint64_t pid);