Define num_syscalls at compile time

This commit is contained in:
Kevin Lange 2014-05-02 18:52:43 -07:00
parent fe19f4ad19
commit 976c086e9c

View File

@ -659,7 +659,8 @@ static int (*syscalls[])() = {
[SYS_UNLINK] = sys_unlink,
[SYS_WAITPID] = sys_waitpid,
};
uint32_t num_syscalls;
uint32_t num_syscalls = sizeof(syscalls) / sizeof(int (*)());
typedef uint32_t (*scall_func)(unsigned int, ...);
@ -687,7 +688,6 @@ void syscall_handler(struct regs * r) {
}
void syscalls_install(void) {
num_syscalls = sizeof(syscalls) / sizeof(uintptr_t);
debug_print(NOTICE, "Initializing syscall table with %d functions", num_syscalls);
isrs_install_handler(0x7F, &syscall_handler);
}