mirror of
https://github.com/tailix/kernel.git
synced 2024-10-30 12:03:52 -04:00
Add function "tasks_switch_to_user"
This commit is contained in:
parent
285affc212
commit
4151273dbd
3 changed files with 27 additions and 0 deletions
|
@ -19,6 +19,7 @@ OBJS += kprintf.c.o
|
|||
OBJS += protected.c.o protected.asm.cpp.o
|
||||
|
||||
OBJS += tss.c.o tss.asm.cpp.o
|
||||
OBJS += tasks.asm.cpp.o
|
||||
|
||||
OBJS += interrupt.asm.cpp.o
|
||||
|
||||
|
|
20
arch/tasks.asm
Normal file
20
arch/tasks.asm
Normal file
|
@ -0,0 +1,20 @@
|
|||
#include "config.h"
|
||||
|
||||
[GLOBAL tasks_switch_to_user]
|
||||
|
||||
tasks_switch_to_user:
|
||||
mov ebx, [esp+4]
|
||||
|
||||
mov ax, GDT_USER_DS_SELECTOR
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
mov fs, ax
|
||||
mov gs, ax
|
||||
|
||||
mov eax, esp
|
||||
push GDT_USER_DS_SELECTOR
|
||||
push eax
|
||||
pushf
|
||||
push GDT_USER_CS_SELECTOR
|
||||
push ebx
|
||||
iret
|
6
arch/tasks.h
Normal file
6
arch/tasks.h
Normal file
|
@ -0,0 +1,6 @@
|
|||
#ifndef KERNELMQ_INCLUDED_TASKS
|
||||
#define KERNELMQ_INCLUDED_TASKS 1
|
||||
|
||||
void tasks_switch_to_user(unsigned long addr);
|
||||
|
||||
#endif
|
Loading…
Reference in a new issue