custom syscall example

This commit is contained in:
Toby Jaffey 2025-12-10 18:52:01 +00:00
parent 508d41c8c5
commit 30b7ff4791
5 changed files with 120 additions and 0 deletions

View file

@ -0,0 +1,13 @@
TOPDIR=../../../
PROJECT:=$(shell basename ${PWD})
SRCS=${PROJECT}.c ${TOPDIR}/apps/crt0.S
all: all_common
@# Convert ROM to C file and header
@xxd -i ${PROJECT}.bin > ${PROJECT}-header.c
@echo "extern unsigned char ${PROJECT}_bin[]; extern int ${PROJECT}_bin_len;" > ${PROJECT}-header.h
test: test_common
clean: clean_common
rm -f ${PROJECT}-header.h ${PROJECT}-header.c
include ${TOPDIR}/apps/makefile.common

View file

@ -0,0 +1,10 @@
#include "uvm32_target.h"
void main(void) {
if (0xAABBCCDD == syscall(0xDEADBEEF, 0xABCD1234, 0xDECAFBAD)) {
print("ok");
} else {
print("fail");
}
}