00001 /* Invokes a system call with the system call number and its 00002 argument on separate pages. This must work. */ 00003 00004 #include <syscall-nr.h> 00005 #include "tests/userprog/boundary.h" 00006 #include "tests/lib.h" 00007 #include "tests/main.h" 00008 00009 void 00010 test_main (void) 00011 { 00012 /* Put a syscall number at the end of one page 00013 and its argument at the beginning of another. */ 00014 int *p = get_boundary_area (); 00015 p--; 00016 p[0] = SYS_EXIT; 00017 p[1] = 42; 00018 00019 /* Invoke the system call. */ 00020 asm volatile ("movl %0, %%esp; int $0x30" : : "g" (p)); 00021 fail ("should have called exit(42)"); 00022 }