12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- #pragma once
- #include "../common/glib.h"
- #include "../common/kprint.h"
- #include "../process/ptrace.h"
- #include <common/unistd.h>
- #define MAX_SYSTEM_CALL_NUM 256
- #define ESYSCALL_NOT_EXISTS 1
- typedef unsigned long (*system_call_t)(struct pt_regs *regs);
- extern void ret_from_system_call(void);
- extern system_call_t system_call_table[MAX_SYSTEM_CALL_NUM];
- 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);
- ul sys_ahci_end_req(struct pt_regs *regs);
- void do_syscall_int(struct pt_regs *regs, unsigned long error_code);
|