1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- #pragma once
- #include "../common/glib.h"
- #include "../common/kprint.h"
- #include "../process/ptrace.h"
- #define MAX_SYSTEM_CALL_NUM 128
- #define ESYSCALL_NOT_EXISTS 1
- typedef unsigned long (*system_call_t)(struct pt_regs *regs);
- extern void ret_from_system_call(void);
- void syscall_init();
- long enter_syscall(ul syscall_id,ul arg0, ul arg1, ul arg2, ul arg3, ul arg4, ul arg5, ul arg6, ul arg7);
- ul system_call_not_exists(struct pt_regs *regs)
- {
- kerror("System call [ ID #%d ] not exists.", regs->rax);
- return ESYSCALL_NOT_EXISTS;
- }
- ul sys_printf(struct pt_regs *regs);
- system_call_t system_call_table[MAX_SYSTEM_CALL_NUM] =
- {
- [0] = system_call_not_exists,
- [1] = sys_printf,
- [2 ... MAX_SYSTEM_CALL_NUM - 1] = system_call_not_exists
- };
|