#ifndef _JOVE_ARCH_x86_64_SYSCALL_WRAPPERS_H #define _JOVE_ARCH_x86_64_SYSCALL_WRAPPERS_H 1 #include "arch/x86_64/page-mapping.h" #include "syscall/handles.h" #define SYSCALL_PAYLOAD_TAKEPML(payload, at, pml4, depth, pml) \ SYSCALL_PAYLOAD_TAKEL(payload, at, depth, uint8_t); \ if(((depth + 1) * sizeof(uint16_t)) + at >= KO_MESSAGE_BYTES) return KE_BADMSG; \ if(depth == 0 && *(uint16_t*)&payload[at] > 255) return KE_OOB; \ pml = page_mapping_traverse(pml4, depth, (uint16_t*)&payload[at]); \ at += (depth + 1) * sizeof(uint16_t) #endif