Просмотр исходного кода

spacing/indentation changes for my preference

tsdedhar 6 лет назад
Родитель
Сommit
f18d7fd9f1
2 измененных файлов с 20 добавлено и 19 удалено
  1. 9 6
      kern/arch/mips/syscall/syscall.c
  2. 11 13
      kern/syscall/proc_syscalls.c

+ 9 - 6
kern/arch/mips/syscall/syscall.c

@@ -1,4 +1,4 @@
-/*
+http://git.tareef.tech/tarfeef101/cs350/src/master/kern/include/syscall.h/*
  * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009
  *	The President and Fellows of Harvard College.
  *
@@ -76,7 +76,7 @@
  * registerized values, with copyin().
  */
 void
-syscall(struct trapframe *tf)
+syscall(struct trapframe * tf)
 {
 	int callno;
 	int32_t retval;
@@ -93,13 +93,14 @@ syscall(struct trapframe *tf)
 	 * really return a value, just 0 for success and -1 on
 	 * error. Since retval is the value returned on success,
 	 * initialize it to 0 by default; thus it's not necessary to
-	 * deal with it except for calls that return other values, 
+	 * deal with it except for calls that return other values,
 	 * like write.
 	 */
 
 	retval = 0;
 
-	switch (callno) {
+	switch (callno)
+	{
 	    case SYS_reboot:
 		err = sys_reboot(tf->tf_a0);
 		break;
@@ -140,7 +141,8 @@ syscall(struct trapframe *tf)
 	}
 
 
-	if (err) {
+	if (err)
+	{
 		/*
 		 * Return the error code. This gets converted at
 		 * userlevel to a return value of -1 and the error
@@ -149,7 +151,8 @@ syscall(struct trapframe *tf)
 		tf->tf_v0 = err;
 		tf->tf_a3 = 1;      /* signal an error */
 	}
-	else {
+	else
+	{
 		/* Success. */
 		tf->tf_v0 = retval;
 		tf->tf_a3 = 0;      /* signal no error */

+ 11 - 13
kern/syscall/proc_syscalls.c

@@ -13,10 +13,11 @@
   /* this implementation of sys__exit does not do anything with the exit code */
   /* this needs to be fixed to get exit() and waitpid() working properly */
 
-void sys__exit(int exitcode) {
+void sys__exit(int exitcode)
+{
 
-  struct addrspace *as;
-  struct proc *p = curproc;
+  struct addrspace * as;
+  struct proc * p = curproc;
   /* for now, just include this to keep the compiler from complaining about
      an unused variable */
   (void)exitcode;
@@ -50,8 +51,7 @@ void sys__exit(int exitcode) {
 
 
 /* stub handler for getpid() system call                */
-int
-sys_getpid(pid_t *retval)
+int sys_getpid(pid_t * retval)
 {
   /* for now, this is just a stub that always returns a PID of 1 */
   /* you need to fix this to make it work properly */
@@ -61,31 +61,29 @@ sys_getpid(pid_t *retval)
 
 /* stub handler for waitpid() system call                */
 
-int
-sys_waitpid(pid_t pid,
-	    userptr_t status,
-	    int options,
-	    pid_t *retval)
+int sys_waitpid(pid_t pid, userptr_t status, int options, pid_t *retval)
 {
   int exitstatus;
   int result;
 
   /* this is just a stub implementation that always reports an
      exit status of 0, regardless of the actual exit status of
-     the specified process.   
+     the specified process.
      In fact, this will return 0 even if the specified process
      is still running, and even if it never existed in the first place.
 
      Fix this!
   */
 
-  if (options != 0) {
+  if (options != 0)
+  {
     return(EINVAL);
   }
   /* for now, just pretend the exitstatus is 0 */
   exitstatus = 0;
   result = copyout((void *)&exitstatus,status,sizeof(int));
-  if (result) {
+  if (result)
+  {
     return(result);
   }
   *retval = pid;