Subversion Repositories HelenOS-historic

Rev

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

Rev 703 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 58... Line 58...
58
        "pushl %2\n"
58
        "pushl %2\n"
59
        "pushl %3\n"
59
        "pushl %3\n"
60
        "pushl %4\n"
60
        "pushl %4\n"
61
        "iret"
61
        "iret"
62
        :
62
        :
63
        : "i" (selector(UDATA_DES) | PL_USER), "r" (USTACK_ADDRESS+(THREAD_STACK_SIZE)), "r" (ipl), "i" (selector(UTEXT_DES) | PL_USER), "i" (UTEXT_ADDRESS)
63
        : "i" (selector(UDATA_DES) | PL_USER), "r" (USTACK_ADDRESS+(THREAD_STACK_SIZE)), "r" (ipl), "i" (selector(UTEXT_DES) | PL_USER), "r" (entry)
64
        : "eax");
64
        : "eax");
65
   
65
   
66
    /* Unreachable */
66
    /* Unreachable */
67
    for(;;)
67
    for(;;)
68
        ;
68
        ;