c287d248fbb8f1101633ba76196061784be8c8c6
[pintos-anon] / src / tests / userprog / sc-boundary-2.c
1 #include <syscall-nr.h>
2 #include "tests/userprog/boundary.h"
3 #include "tests/lib.h"
4 #include "tests/main.h"
5
6 void
7 test_main (void) 
8 {
9   /* Make one byte of a syscall argument hang over into a second
10      page. */
11   int *p = (int *) ((char *) get_boundary_area () - 7);
12   p[0] = SYS_exit;
13   p[1] = 67;
14
15   /* Invoke the system call. */
16   asm volatile ("mov %%esp, %0; int 0x30" :: "g" (p));
17   fail ("should have called exit(67)");
18 }