Subversion Repositories HelenOS-historic

Rev

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

Rev 1066 Rev 1078
Line 39... Line 39...
39
#include <arch/mm/page.h>
39
#include <arch/mm/page.h>
40
#include <mm/as.h>
40
#include <mm/as.h>
41
#include <config.h>
41
#include <config.h>
42
#include <userspace.h>
42
#include <userspace.h>
43
#include <console/console.h>
43
#include <console/console.h>
44
#include <proc/thread.h>
44
#include <proc/uarg.h>
45
 
45
 
46
void arch_pre_mm_init(void)
46
void arch_pre_mm_init(void)
47
{
47
{
48
    /* Set Interruption Vector Address (i.e. location of interruption vector table). */
48
    /* Set Interruption Vector Address (i.e. location of interruption vector table). */
49
    iva_write((__address) &ivt);
49
    iva_write((__address) &ivt);
Line 71... Line 71...
71
void arch_post_smp_init(void)
71
void arch_post_smp_init(void)
72
{
72
{
73
}
73
}
74
 
74
 
75
/** Enter userspace and never return. */
75
/** Enter userspace and never return. */
76
void userspace(uspace_arg_t *uarg)
76
void userspace(uspace_arg_t *kernel_uarg)
77
{
77
{
78
    psr_t psr;
78
    psr_t psr;
79
    rsc_t rsc;
79
    rsc_t rsc;
80
 
80
 
81
    psr.value = psr_read();
81
    psr.value = psr_read();
Line 89... Line 89...
89
    rsc.loadrs = 0;
89
    rsc.loadrs = 0;
90
    rsc.be = false;
90
    rsc.be = false;
91
    rsc.pl = PL_USER;
91
    rsc.pl = PL_USER;
92
    rsc.mode = 3;               /* eager mode */
92
    rsc.mode = 3;               /* eager mode */
93
 
93
 
-
 
94
    switch_to_userspace((__address) kernel_uarg->uspace_entry,
94
    switch_to_userspace(uarg->uspace_entry, uarg->uspace_stack+PAGE_SIZE-ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT), uarg->uspace_stack, psr.value, rsc.value);
95
                ((__address) kernel_uarg->uspace_stack)+PAGE_SIZE-ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT),
-
 
96
                (__address) kernel_uarg->uspace_stack,
-
 
97
                (__address) kernel_uarg->uspace_uarg,
-
 
98
                psr.value, rsc.value);
95
 
99
 
96
    while (1) {
100
    while (1) {
97
        ;
101
        ;
98
    }
102
    }
99
}
103
}