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
e780bcbf
Commit
e780bcbf
authored
1 year ago
by
Brian
Browse files
Options
Downloads
Patches
Plain Diff
tentative artie 3
parent
afa941e0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
assembleur.s
+4
-1
4 additions, 1 deletion
assembleur.s
mpu_user_console_etu.c
+8
-0
8 additions, 0 deletions
mpu_user_console_etu.c
with
12 additions
and
1 deletion
assembleur.s
+
4
−
1
View file @
e780bcbf
...
...
@@ -7,9 +7,9 @@
.
global
asm_test_fault
.
global
switch_to_user_mode
.
global
set_psp
.
extern
user_stack
DATA
//
this
adress
can
be
read
like
:
ldr
Rx
,
=
user_stack
switch_to_user_mode
:
ldr
r0
,
=
user_stack
msr
PSP
,
r0
...
...
@@ -17,6 +17,9 @@ switch_to_user_mode:
msr
CONTROL
,
r1
bx
lr
set_psp
:
mrs
r0
,
psp
bx
lr
.
equ
bad_addr
,0
x90000
...
...
This diff is collapsed.
Click to expand it.
mpu_user_console_etu.c
+
8
−
0
View file @
e780bcbf
...
...
@@ -36,6 +36,7 @@ volatile static unsigned idx_error;
void
switch_to_user_mode
();
void
asm_test_fault
();
void
set_psp
();
void
MemManage_Handler
()
{
arr_addr
[
idx_error
]
=
MMFAR
;
...
...
@@ -44,6 +45,13 @@ void MemManage_Handler() {
SCB
->
CFSR
=
0xFFFF
;
LPC_GPIO2
->
FIOPIN
=
idx_error
;
uint32_t
*
user_psp
;
set_psp
(
user_psp
);
user_psp
[
6
]
=
(
uint32_t
)
user_stating_address
;
}
void
test_supervisor_mode
()
{
...
...
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