summaryrefslogtreecommitdiffstats
path: root/tests/userprog/sc-bad-arg.c
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2012-03-27 11:51:08 +0200
committermanuel <manuel@mausz.at>2012-03-27 11:51:08 +0200
commit4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b (patch)
tree868c52e06f207b5ec8a3cc141f4b8b2bdfcc165c /tests/userprog/sc-bad-arg.c
parenteae0bd57f0a26314a94785061888d193d186944a (diff)
downloadprogos-4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b.tar.gz
progos-4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b.tar.bz2
progos-4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b.zip
reorganize file structure to match the upstream requirements
Diffstat (limited to 'tests/userprog/sc-bad-arg.c')
-rw-r--r--tests/userprog/sc-bad-arg.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/userprog/sc-bad-arg.c b/tests/userprog/sc-bad-arg.c
new file mode 100644
index 0000000..0b512a0
--- /dev/null
+++ b/tests/userprog/sc-bad-arg.c
@@ -0,0 +1,17 @@
1/* Sticks a system call number (SYS_EXIT) at the very top of the
2 stack, then invokes a system call with the stack pointer
3 (%esp) set to its address. The process must be terminated
4 with -1 exit code because the argument to the system call
5 would be above the top of the user address space. */
6
7#include <syscall-nr.h>
8#include "tests/lib.h"
9#include "tests/main.h"
10
11void
12test_main (void)
13{
14 asm volatile ("movl $0xbffffffc, %%esp; movl %0, (%%esp); int $0x30"
15 : : "i" (SYS_EXIT));
16 fail ("should have called exit(-1)");
17}