From c826bd8176c764a7ae385ba6567afc0cd91cfc69 Mon Sep 17 00:00:00 2001 From: Frans Kaashoek Date: Sun, 25 Sep 2022 20:00:42 -0400 Subject: traps lab --- user/call.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 user/call.c (limited to 'user/call.c') diff --git a/user/call.c b/user/call.c new file mode 100644 index 0000000..f725dcb --- /dev/null +++ b/user/call.c @@ -0,0 +1,17 @@ +#include "kernel/param.h" +#include "kernel/types.h" +#include "kernel/stat.h" +#include "user/user.h" + +int g(int x) { + return x+3; +} + +int f(int x) { + return g(x); +} + +void main(void) { + printf("%d %d\n", f(8)+1, 13); + exit(0); +} -- cgit v1.2.3