Refactor syscall to follow PintOS style in adding space after after function name in calls

This commit is contained in:
sBubshait
2024-11-04 00:48:36 +00:00
parent 79f6a8e808
commit 0d057da3dc

View File

@@ -20,14 +20,16 @@ static void exit (int status);
static void *validate_user_pointer (void *ptr, size_t size); static void *validate_user_pointer (void *ptr, size_t size);
/* A struct defining a syscall_function pointer along with its arity. */ /* A struct defining a syscall_function pointer along with its arity. */
typedef struct { typedef struct
{
syscall_function function; /* Function pointer. */ syscall_function function; /* Function pointer. */
int arity; /* Number of arguments of the function. */ int arity; /* Number of arguments of the function. */
} syscall_arguments; } syscall_arguments;
/* A look-up table mapping numbers to system call functions with their number of /* A look-up table mapping numbers to system call functions with their number of
arguments. */ arguments. */
static const syscall_arguments syscall_lookup[] = { static const syscall_arguments syscall_lookup[] =
{
[SYS_HALT] = {(syscall_function) halt, 0}, [SYS_HALT] = {(syscall_function) halt, 0},
[SYS_EXIT] = {(syscall_function) exit, 1}, [SYS_EXIT] = {(syscall_function) exit, 1},
}; };