Changeset 1f12fab in mainline for kernel/arch/sparc32/src/userspace.c
- Timestamp:
- 2013-10-07T20:00:34Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a73ebf0
- Parents:
- 80d9d83
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc32/src/userspace.c
r80d9d83 r1f12fab 36 36 #include <typedefs.h> 37 37 #include <arch.h> 38 #include <arch/asm.h> 38 39 #include <abi/proc/uarg.h> 39 40 #include <mm/as.h> … … 41 42 void userspace(uspace_arg_t *kernel_uarg) 42 43 { 44 printf("userspace(): entry=%p, stack=%p, stacksize=%d\n", kernel_uarg->uspace_entry, kernel_uarg->uspace_stack, kernel_uarg->uspace_stack_size); 43 45 /* On real hardware this switches the CPU to user 44 46 space mode and jumps to kernel_uarg->uspace_entry. */ 45 47 48 uint32_t psr = psr_read(); 49 50 psr &= ~(1 << 7); 51 psr &= ~(1 << 6); 52 53 asm volatile ( 54 "mov %[stack], %%sp\n" 55 "mov %[psr], %%psr\n" 56 "nop\n" 57 "jmp %[entry]\n" 58 "nop\n" :: [entry] "r" (kernel_uarg->uspace_entry), 59 [psr] "r" (psr), 60 [stack] "r" (kernel_uarg->uspace_stack + kernel_uarg->uspace_stack_size)); 61 46 62 while (true); 47 63 }
Note:
See TracChangeset
for help on using the changeset viewer.