Skip to content
Snippets Groups Projects
Commit bd113e42 authored by iliya's avatar iliya
Browse files

feat: using stack with offset through value stored and loaded from R1

parent 04ca9ab1
No related branches found
No related tags found
No related merge requests found
...@@ -22,12 +22,11 @@ switch_to_user_mode: ...@@ -22,12 +22,11 @@ switch_to_user_mode:
// R0: user_starting_address // R0: user_starting_address
/*************************/ /*************************/
change_ret: change_ret:
ldr r1, =user_stack mrs r1, PSP
//mrs r1, PSP ldr r1, [r1]
//str r0, [r1, #76]
str r0, [r1, #24] str r0, [r1, #24]
msr PSP, r1 msr PSP, r1
bx lr bx lr
.equ bad_addr,0x90000 .equ bad_addr,0x90000
......
...@@ -120,7 +120,7 @@ int main(void) { ...@@ -120,7 +120,7 @@ int main(void) {
switch_to_user_mode(); // to be implemented switch_to_user_mode(); // to be implemented
// testing memory accesses in user mode: // testing memory accesses in user mode:
//test_user_mode(); // to be removed after checking test_user_mode(); // to be removed after checking
while (1) { while (1) {
exec_user_read_write(); exec_user_read_write();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment