proc: add current_pt_regs
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
b838b53942
commit
3ca26e6068
2 changed files with 6 additions and 0 deletions
|
|
@ -38,5 +38,6 @@ struct cpu_local *tls_get();
|
|||
struct proc *get_cur_proc();
|
||||
struct thread *get_cur_thread();
|
||||
void enter_userspace_init(struct thread *thread, uaddr_t entry);
|
||||
struct pt_regs *current_pt_regs();
|
||||
|
||||
#endif /* _ARCH_PROC_H_ */
|
||||
|
|
|
|||
|
|
@ -2,6 +2,11 @@
|
|||
#include <kernel/syscall.h>
|
||||
#include <arch/proc.h>
|
||||
|
||||
struct pt_regs *current_pt_regs()
|
||||
{
|
||||
return (struct pt_regs *)(tls_get()->kernel_rsp - sizeof(struct pt_regs));
|
||||
}
|
||||
|
||||
static inline i64 _do_syscall(struct pt_regs *regs)
|
||||
{
|
||||
syscall_t c = get_syscall(regs->rax);
|
||||
|
|
|
|||
Loading…
Reference in a new issue