Rev 1007 | Rev 1267 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1007 | Rev 1220 | ||
---|---|---|---|
Line 28... | Line 28... | ||
28 | 28 | ||
29 | #include <arch/asm/regname.h> |
29 | #include <arch/asm/regname.h> |
30 | 30 | ||
31 | .text |
31 | .text |
32 | 32 | ||
- | 33 | .global userspace_asm |
|
33 | .global iret |
34 | .global iret |
34 | .global memsetb |
35 | .global memsetb |
35 | .global memcpy |
36 | .global memcpy |
36 | 37 | ||
- | 38 | userspace_asm: |
|
- | 39 | ||
- | 40 | # r3 = uspace_uarg |
|
- | 41 | # r4 = stack |
|
- | 42 | # r5 = entry |
|
- | 43 | ||
- | 44 | mfmsr r31 |
|
- | 45 | rlwinm r31, r31, 0, 17, 15 |
|
- | 46 | mtmsr r31 |
|
- | 47 | ||
- | 48 | # set entry point |
|
- | 49 | ||
- | 50 | mtsrr0 r5 |
|
- | 51 | ||
- | 52 | # set problem state, enable interrupts |
|
- | 53 | ||
- | 54 | ori r31, r31, 1 << 14 |
|
- | 55 | ori r31, r31, 1 << 15 |
|
- | 56 | mtsrr1 r31 |
|
- | 57 | ||
- | 58 | # set stack |
|
- | 59 | ||
- | 60 | mr sp, r4 |
|
- | 61 | ||
- | 62 | # jump to userspace |
|
- | 63 | ||
- | 64 | rfi |
|
- | 65 | ||
37 | iret: |
66 | iret: |
38 | lwz r3, 144(sp) |
67 | lwz r3, 144(sp) |
39 | mtxer r3 |
68 | mtxer r3 |
40 | 69 | ||
41 | lwz r3, 140(sp) |
70 | lwz r3, 140(sp) |