From: Ben Pfaff Date: Wed, 17 May 2006 15:00:25 +0000 (+0000) Subject: Fully capitalize SYS_* syscall enum names. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=252579b95653c24a2fdd1691b36dede118631596;p=pintos-anon Fully capitalize SYS_* syscall enum names. --- diff --git a/src/lib/syscall-nr.h b/src/lib/syscall-nr.h index e1fc9e1..b20edfb 100644 --- a/src/lib/syscall-nr.h +++ b/src/lib/syscall-nr.h @@ -5,28 +5,28 @@ enum { /* Projects 2 and later. */ - SYS_halt, /* Halts the operating system. */ - SYS_exit, /* Terminates this process. */ - SYS_exec, /* Start another process. */ - SYS_wait, /* Waits for a child process to die. */ - SYS_create, /* Creates a file. */ - SYS_remove, /* Deletes a file. */ - SYS_open, /* Opens a file. */ - SYS_filesize, /* Obtains a file's size. */ - SYS_read, /* Reads from a file. */ - SYS_write, /* Writes to a file. */ - SYS_seek, /* Change position in a file. */ - SYS_tell, /* Report current position in a file. */ - SYS_close, /* Closes a file. */ + SYS_HALT, /* Halts the operating system. */ + SYS_EXIT, /* Terminates this process. */ + SYS_EXEC, /* Start another process. */ + SYS_WAIT, /* Waits for a child process to die. */ + SYS_CREATE, /* Creates a file. */ + SYS_REMOVE, /* Deletes a file. */ + SYS_OPEN, /* Opens a file. */ + SYS_FILESIZE, /* Obtains a file's size. */ + SYS_READ, /* Reads from a file. */ + SYS_WRITE, /* Writes to a file. */ + SYS_SEEK, /* Change position in a file. */ + SYS_TELL, /* Report current position in a file. */ + SYS_CLOSE, /* Closes a file. */ /* Project 3 and optionally project 4. */ - SYS_mmap, /* Maps a file into memory. */ - SYS_munmap, /* Removes a memory mapping. */ + SYS_MMAP, /* Maps a file into memory. */ + SYS_MUNMAP, /* Removes a memory mapping. */ /* Project 4 only. */ - SYS_chdir, /* Changes the current directory. */ - SYS_mkdir, /* Create a directory. */ - SYS_lsdir /* Lists the current directory to stdout. */ + SYS_CHDIR, /* Changes the current directory. */ + SYS_MKDIR, /* Create a directory. */ + SYS_LSDIR /* Lists the current directory to stdout. */ }; #endif /* lib/syscall-nr.h */ diff --git a/src/lib/user/syscall.c b/src/lib/user/syscall.c index 6fc26ed..2485530 100644 --- a/src/lib/user/syscall.c +++ b/src/lib/user/syscall.c @@ -64,110 +64,110 @@ void halt (void) { - syscall0 (SYS_halt); + syscall0 (SYS_HALT); NOT_REACHED (); } void exit (int status) { - syscall1 (SYS_exit, status); + syscall1 (SYS_EXIT, status); NOT_REACHED (); } pid_t exec (const char *file) { - return (pid_t) syscall1 (SYS_exec, file); + return (pid_t) syscall1 (SYS_EXEC, file); } int wait (pid_t pid) { - return syscall1 (SYS_wait, pid); + return syscall1 (SYS_WAIT, pid); } bool create (const char *file, unsigned initial_size) { - return syscall2 (SYS_create, file, initial_size); + return syscall2 (SYS_CREATE, file, initial_size); } bool remove (const char *file) { - return syscall1 (SYS_remove, file); + return syscall1 (SYS_REMOVE, file); } int open (const char *file) { - return syscall1 (SYS_open, file); + return syscall1 (SYS_OPEN, file); } int filesize (int fd) { - return syscall1 (SYS_filesize, fd); + return syscall1 (SYS_FILESIZE, fd); } int read (int fd, void *buffer, unsigned size) { - return syscall3 (SYS_read, fd, buffer, size); + return syscall3 (SYS_READ, fd, buffer, size); } int write (int fd, const void *buffer, unsigned size) { - return syscall3 (SYS_write, fd, buffer, size); + return syscall3 (SYS_WRITE, fd, buffer, size); } void seek (int fd, unsigned position) { - syscall2 (SYS_seek, fd, position); + syscall2 (SYS_SEEK, fd, position); } unsigned tell (int fd) { - return syscall1 (SYS_tell, fd); + return syscall1 (SYS_TELL, fd); } void close (int fd) { - syscall1 (SYS_close, fd); + syscall1 (SYS_CLOSE, fd); } mapid_t mmap (int fd, void *addr) { - return syscall2 (SYS_mmap, fd, addr); + return syscall2 (SYS_MMAP, fd, addr); } void munmap (mapid_t mapid) { - syscall1 (SYS_munmap, mapid); + syscall1 (SYS_MUNMAP, mapid); } bool chdir (const char *dir) { - return syscall1 (SYS_chdir, dir); + return syscall1 (SYS_CHDIR, dir); } bool mkdir (const char *dir) { - return syscall1 (SYS_mkdir, dir); + return syscall1 (SYS_MKDIR, dir); } void lsdir (void) { - syscall0 (SYS_lsdir); + syscall0 (SYS_LSDIR); } diff --git a/src/tests/userprog/sc-bad-arg.c b/src/tests/userprog/sc-bad-arg.c index e0cad15..aee48b0 100644 --- a/src/tests/userprog/sc-bad-arg.c +++ b/src/tests/userprog/sc-bad-arg.c @@ -1,4 +1,4 @@ -/* Sticks a system call number (SYS_exit) at the very top of the +/* Sticks a system call number (SYS_EXIT) at the very top of the stack, then invokes a system call with the stack pointer (%esp) set to its address. The process must be terminated with -1 exit code because the argument to the system call @@ -12,6 +12,6 @@ void test_main (void) { asm volatile ("movl $0xbffffffc, %%esp; movl %0, (%%esp); int $0x30" - :: "i" (SYS_exit)); + :: "i" (SYS_EXIT)); fail ("should have called exit(-1)"); } diff --git a/src/tests/userprog/sc-boundary-2.c b/src/tests/userprog/sc-boundary-2.c index de357fc..6dce992 100644 --- a/src/tests/userprog/sc-boundary-2.c +++ b/src/tests/userprog/sc-boundary-2.c @@ -13,7 +13,7 @@ test_main (void) /* Make one byte of a syscall argument hang over into a second page. */ int *p = (int *) ((char *) get_boundary_area () - 7); - p[0] = SYS_exit; + p[0] = SYS_EXIT; p[1] = 67; /* Invoke the system call. */ diff --git a/src/tests/userprog/sc-boundary.c b/src/tests/userprog/sc-boundary.c index 2852568..fd147bd 100644 --- a/src/tests/userprog/sc-boundary.c +++ b/src/tests/userprog/sc-boundary.c @@ -13,7 +13,7 @@ test_main (void) and its argument at the beginning of another. */ int *p = get_boundary_area (); p--; - p[0] = SYS_exit; + p[0] = SYS_EXIT; p[1] = 42; /* Invoke the system call. */