1 /* (CC-BY-NC-SA) ROBIN KRENS - ROBIN @ ROBINKRENS.NL
4 * 2019/9/21 - ROBIN KRENS
8 * System calls for various user functions
16 #include <lib/syscall.h>
18 /* Arguments are placed in r0, r1, r2 by convention
19 * And "parsed" to the the kernel
20 * Right after the svc call, r0 contains status
21 * of call (ie. OK, SYSERR) */
25 asm volatile("svc 7");
27 asm volatile("mov %0, r0" : "=r" (ret));
32 int theos_init(uint32_t * p) {
33 asm volatile("svc 1");
38 __attribute__ ((naked))
39 int theos_switch(uint32_t * p1, uint32_t * p2) {
41 asm volatile("push {lr}");
42 asm volatile("svc 4");
43 asm volatile("pop {lr}");
44 asm volatile("bx lr");
50 int theos_test(int arg1, int arg2, int arg3) {
52 asm volatile("svc 11");
54 asm volatile("mov %0, r0" : "=r" (ret));