Changeset ebb1489 in mainline for kernel/arch/arm32/src/userspace.c
- Timestamp:
- 2024-10-13T08:23:40Z (8 weeks ago)
- Children:
- 0472cf17
- Parents:
- 2a0c827c (diff), b3b79981 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- boba-buba <120932204+boba-buba@…> (2024-10-13 08:23:40)
- git-committer:
- GitHub <noreply@…> (2024-10-13 08:23:40)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/arm32/src/userspace.c
r2a0c827c rebb1489 61 61 } ustate_t; 62 62 63 uintptr_t arch_get_initial_sp(uintptr_t stack_base, uintptr_t stack_size) 64 { 65 return stack_base + stack_size; 66 } 67 63 68 /** Change processor mode 64 69 * … … 66 71 * 67 72 */ 68 void userspace(u space_arg_t *kernel_uarg)73 void userspace(uintptr_t pc, uintptr_t sp) 69 74 { 70 volatile ustate_t ustate; 71 72 /* set first parameter */ 73 ustate.r0 = kernel_uarg->uspace_uarg; 74 75 /* %r1 is defined to hold pcb_ptr - set it to 0 */ 76 ustate.r1 = 0; 75 volatile ustate_t ustate = { }; 77 76 78 77 /* pass the RAS page address in %r2 */ 79 78 ustate.r2 = (uintptr_t) ras_page; 80 79 81 /* clear other registers */ 82 ustate.r3 = 0; 83 ustate.r4 = 0; 84 ustate.r5 = 0; 85 ustate.r6 = 0; 86 ustate.r7 = 0; 87 ustate.r8 = 0; 88 ustate.r9 = 0; 89 ustate.r10 = 0; 90 ustate.r11 = 0; 91 ustate.r12 = 0; 92 ustate.lr = 0; 93 94 /* set user stack */ 95 ustate.sp = kernel_uarg->uspace_stack + 96 kernel_uarg->uspace_stack_size; 97 98 /* set where uspace execution starts */ 99 ustate.pc = kernel_uarg->uspace_entry; 80 ustate.sp = sp; 81 ustate.pc = pc; 100 82 101 83 /* status register in user mode */
Note:
See TracChangeset
for help on using the changeset viewer.