summaryrefslogtreecommitdiffstats
path: root/lib/libjove/include/arch/x86_64/syscall.h
blob: 74fb389ee532e6188b236e3da6d5d937c4229cba (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef _LIBJOVE_ARCH_x86_64_SYSCALL_H
#define _LIBJOVE_ARCH_x86_64_SYSCALL_H 1

#include <stdint.h>

#include <kernel/object.h>
#include <jove/arch/x86_64/object-pagemap.h>
#include <jove/syscall.h>

#define SYSCALL_PAYLOAD_PUTPML(payload, payload_at, depth, path) \
    if(payload_at + 1 + ((depth + 1) * sizeof(uint16_t)) > KO_MESSAGE_BYTES) return -1; \
    *((uint8_t*)&payload[payload_at++]) = depth; \
    for(uint8_t i = 0; i < depth + 1; i++) *((uint16_t*)&payload[payload_at + (i * 2)]) = path[i]; \
    payload_at += (depth + 1) * 2

int _syscall_invoke_mapping_exists(KernelObjectPageMap *map, uint8_t depth, uint16_t *path);
int _syscall_invoke_mapping_map(KernelObjectPageMap *map, uint8_t depth, uint16_t *path, KernelObjectUntyped *untyped);
int _syscall_invoke_mapping_unmap(KernelObjectPageMap *map, uint8_t depth, uint16_t *path, KernelObjectUntyped *dest);

#endif