123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- #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);
- long enter_syscall_int(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);
- void do_syscall_int(struct pt_regs *regs, unsigned long error_code);
- 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};
|