aboutsummaryrefslogblamecommitdiff
path: root/src/lib/libkogata/syscall.c
blob: dc7e64837332375e04969879f7254a76d0f11c0e (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12


                    

                   
                                 





                                                              


              




                                                          
 
#include <debug.h>
#include <syscall.h>

#include <string.h>

void dbg_print(const char* str) {

	char buf[256];
	strncpy(buf, str, 256);
	buf[255] = 0;

	asm volatile("int $0x40"::"a"(SC_DBG_PRINT),"b"(buf));
}

void yield() {
	asm volatile("int $0x40"::"a"(SC_YIELD));
}

void exit(int code) {
	asm volatile("int $0x40"::"a"(SC_EXIT),"b"(code));
}