aboutsummaryrefslogtreecommitdiff
path: root/src/user/syscall.c
blob: 9ed75da90e62c51518f3a1f5b2e4eb0ebe9eb76b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "user/syscall.h"

#include <stdint.h>

#include "arch.h"

void __attribute__((noinline))
do_syscall(volatile uint32_t id, volatile uint32_t arg)
{
#ifdef ARCH_STM32L4
  asm volatile("svc #0x04");
#endif
}

#define SYSCALL(id, fn, kernfn, argt) \
  void fn(argt arg) { do_syscall(id, (uint32_t)arg); }
#include "kern/syscall/syscall_tbl.inc"