aboutsummaryrefslogtreecommitdiff
path: root/kernel/features
diff options
context:
space:
mode:
authorMarvin Borner2021-03-12 19:40:49 +0100
committerMarvin Borner2021-03-12 19:40:49 +0100
commit928f2662d1469e815a7e32e04d6c68bae4a61c14 (patch)
tree4351e019020dedc3077f2d16fb988d4219aea315 /kernel/features
parentbbf700a0c6b2f8ca9a73c2a334973286d5b8afcc (diff)
Added user stack pushing
Diffstat (limited to 'kernel/features')
-rw-r--r--kernel/features/proc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/features/proc.c b/kernel/features/proc.c
index 38d88f8..e4b5105 100644
--- a/kernel/features/proc.c
+++ b/kernel/features/proc.c
@@ -437,6 +437,18 @@ static u8 procfs_ready(const char *path, struct device *dev)
return 1;
}
+static void proc_stack_push(struct proc *proc, u32 data)
+{
+ struct page_dir *prev;
+ memory_backup_dir(&prev);
+ memory_switch_dir(proc->page_dir);
+
+ proc->regs.useresp -= sizeof(data);
+ *(u32 *)proc->regs.useresp = data;
+
+ memory_switch_dir(prev);
+}
+
extern void proc_jump_userspace(void);
u32 _esp, _eip;