Subversion Repositories HelenOS-historic

Rev

Rev 802 | Rev 1078 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 802 Rev 938
Line 37... Line 37...
37
/** Enter userspace
37
/** Enter userspace
38
 *
38
 *
39
 * Change CPU protection level to 3, enter userspace.
39
 * Change CPU protection level to 3, enter userspace.
40
 *
40
 *
41
 */
41
 */
42
void userspace(void)
42
void userspace(__address entry)
43
{
43
{
44
    ipl_t ipl;
44
    ipl_t ipl;
45
   
45
   
46
    ipl = interrupts_disable();
46
    ipl = interrupts_disable();
47
 
47
 
Line 59... Line 59...
59
              "iretq;"
59
              "iretq;"
60
              : : "i" (gdtselector(UDATA_DES) | PL_USER),
60
              : : "i" (gdtselector(UDATA_DES) | PL_USER),
61
              "i" (USTACK_ADDRESS+THREAD_STACK_SIZE),
61
              "i" (USTACK_ADDRESS+THREAD_STACK_SIZE),
62
              "r" (ipl),
62
              "r" (ipl),
63
              "i" (gdtselector(UTEXT_DES) | PL_USER),
63
              "i" (gdtselector(UTEXT_DES) | PL_USER),
64
              "i" (UTEXT_ADDRESS));
64
              "r" (entry));
65
   
65
   
66
    /* Unreachable */
66
    /* Unreachable */
67
    for(;;);
67
    for(;;);
68
}
68
}