- define jump_to_user_code as line function

git-svn-id: http://svn.lfbs.rwth-aachen.de/svn/scc/trunk/MetalSVM@395 315a16e6-25f9-4109-90ae-ca3045a26c18
This commit is contained in:
stefan 2011-02-08 19:47:49 +00:00
parent 9a9df5ed2e
commit 23ed873c24
2 changed files with 9 additions and 10 deletions

View file

@ -26,7 +26,15 @@
int create_default_frame(task_t* task, entry_point_t ep, void* arg);
int register_task(task_t* task);
int jump_to_user_code(uint32_t ep, uint32_t stack);
void reschedule(void);
static inline int jump_to_user_code(uint32_t ep, uint32_t stack)
{
asm volatile ("mov %0, %%ds; mov %0, %%fs; mov %0, %%gs; mov %0, %%es" :: "r"(0x23));
asm volatile ("push $0x23; push %0; push $0x1B; push %1" :: "r"(stack), "r"(ep));
asm volatile ("lret");
return 0;
}
#endif

View file

@ -94,15 +94,6 @@ int create_default_frame(task_t* task, entry_point_t ep, void* arg)
return 0;
}
int jump_to_user_code(uint32_t ep, uint32_t stack)
{
asm volatile ("mov %0, %%ds; mov %0, %%fs; mov %0, %%gs; mov %0, %%es" :: "r"(0x23));
asm volatile ("push $0x23; push %0; push $0x1B; push %1" :: "r"(stack), "r"(ep));
asm volatile ("lret");
return 0;
}
/* Setup a descriptor in the Global Descriptor Table */
static void gdt_set_gate(int num, unsigned long base, unsigned long limit,
unsigned char access, unsigned char gran)