From b5f0874cd96ee2a62aabc645b9626c2749cb6a01 Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 26 Mar 2012 12:54:45 +0200 Subject: initial pintos checkin --- pintos-progos/tests/userprog/sc-boundary.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 pintos-progos/tests/userprog/sc-boundary.c (limited to 'pintos-progos/tests/userprog/sc-boundary.c') diff --git a/pintos-progos/tests/userprog/sc-boundary.c b/pintos-progos/tests/userprog/sc-boundary.c new file mode 100644 index 0000000..d889535 --- /dev/null +++ b/pintos-progos/tests/userprog/sc-boundary.c @@ -0,0 +1,22 @@ +/* Invokes a system call with the system call number and its + argument on separate pages. This must work. */ + +#include +#include "tests/userprog/boundary.h" +#include "tests/lib.h" +#include "tests/main.h" + +void +test_main (void) +{ + /* Put a syscall number at the end of one page + and its argument at the beginning of another. */ + int *p = get_boundary_area (); + p--; + p[0] = SYS_EXIT; + p[1] = 42; + + /* Invoke the system call. */ + asm volatile ("movl %0, %%esp; int $0x30" : : "g" (p)); + fail ("should have called exit(42)"); +} -- cgit v1.2.3