Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
G4_mpu
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ISC2
pro
G4_mpu
Commits
d007212b
Commit
d007212b
authored
1 year ago
by
iliya
Browse files
Options
Downloads
Patches
Plain Diff
feat: one function for permutting between modes & computing user stack size dynamically
parent
6fae3c24
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
assembleur.s
+10
-16
10 additions, 16 deletions
assembleur.s
with
10 additions
and
16 deletions
assembleur.s
+
10
−
16
View file @
d007212b
...
...
@@ -9,30 +9,24 @@
.
global
reset_user_stack
.
global
switch_to_user_mode
.
global
switch_to_supervisor_mode
.
global
switch_mode
.
global
change_ret
.
extern
user_stack
DATA
//
this
adress
can
be
read
like
:
ldr
Rx
,
=
user_stack
reset_user_stack
:
ldr
r0
,
=
user_stack
add
r0
,
r0
,
#
8192
//
2048
*
word_size
mov
r1
,
USER_STACK_SIZE
lsl
r1
,
r1
,
#
2
//
(
e
.
g
.
multiply
by
word
size
==
4
bytes
)
add
r0
,
r1
msr
PSP
,
r0
mov
r1
,
#
3
msr
CONTROL
,
r1
isb
mov
r2
,
#
3
msr
CONTROL
,
r2
bx
lr
switch_to_user_mode
:
mrs
r0
,
control
mov
r0
,
#
3
msr
control
,
r0
isb
bx
lr
switch_to_supervisor_mode
:
mrs
r0
,
control
mov
r0
,
#
0
msr
control
,
r0
isb
switch_mode
:
mrs
r1
,
control
mov
r1
,
r0
msr
control
,
r1
bx
lr
/*************************/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment