Arm Community
Site
Search
User
Site
Search
User
Groups
Education Hub
Distinguished Ambassadors
Open Source Software and Platforms
Research Collaboration and Enablement
Forums
AI and ML forum
Architectures and Processors forum
Arm Development Platforms forum
Arm Development Studio forum
Arm Virtual Hardware forum
Automotive forum
Compilers and Libraries forum
Graphics, Gaming, and VR forum
High Performance Computing (HPC) forum
Infrastructure Solutions forum
Internet of Things (IoT) forum
Keil forum
Morello forum
Operating Systems forum
SoC Design and Simulation forum
SystemReady Forum
Blogs
AI and ML blog
Announcements
Architectures and Processors blog
Automotive blog
Graphics, Gaming, and VR blog
High Performance Computing (HPC) blog
Infrastructure Solutions blog
Internet of Things (IoT) blog
Operating Systems blog
SoC Design and Simulation blog
Tools, Software and IDEs blog
Support
Arm Support Services
Documentation
Downloads
Training
Arm Approved program
Arm Design Reviews
Community Help
More
Cancel
Support forums
Architectures and Processors forum
Cortex-A8 - accessing banked registers from monitor mode
Jump...
Cancel
State
Not Answered
Locked
Locked
Replies
6 replies
Subscribers
347 subscribers
Views
7542 views
Users
0 members are here
Armv7-A
Cortex-A
Cortex-A8
Debugger
Options
Share
More actions
Cancel
Related
How was your experience today?
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion
Cortex-A8 - accessing banked registers from monitor mode
Jitesh Shah
over 11 years ago
Note: This was originally posted on 20th March 2012 at
http://forums.arm.com
Hi Group,
I am working on a Cortex A-8 Processor (ARMv7-a architecture). I am in the monitor mode and trying to access SP of the SVC mode.
I know two ways I can do it:
1) Using the "mrs" instruction.
eg. mrs r0, sp_svc
However, my compiler (code sourcery) says:
Error: Banked registers are not available with this architecture. -- `mrs r0,sp_svc'
My architecture manual does say that banked registers are accessible via this method, so I suppose this is a compiler issue. Anyway.
2) Changing the mode to svc, reading sp and getting back to the monitor mode.
eg. cps MODE_SVC
mov r0, sp
cps MODE_MON
where MODE_SVC = 0x13 and MODE_MON = 0x16
But, as soon as I execute "cps MODE_SVC" in monitor mode, my CPU hangs. There is no more activity.
So my question is this: Is SVC mode not accessible from Monitor mode? If thats not the case, how can I access SVC version of the registers from Monitor mode?
Thanks,
Jitesh
Parents
0
Peter Harris
over 11 years ago
Note: This was originally posted on 21st March 2012 at
http://forums.arm.com
Also worth noting ..
[color=#222222][size=2]Intention is to get the NS SVC mode SP
[/size][/color]
[color=#222222][size=2]
[/size][/color]
[size=2]There is no such thing as a "non-secure" SVC mode. The same physical registers are used for both secure and non-secure, so the SP value is the same irrespective of what the NS bit is, unless the monitor mode decides to modify it. So you can clear the NS bit, iterate save and restore all of the modes, and then drop into the secure world.[/size]
[size=2]
[/size]
Cancel
Up
0
Down
Cancel
Reply
0
Peter Harris
over 11 years ago
Note: This was originally posted on 21st March 2012 at
http://forums.arm.com
Also worth noting ..
[color=#222222][size=2]Intention is to get the NS SVC mode SP
[/size][/color]
[color=#222222][size=2]
[/size][/color]
[size=2]There is no such thing as a "non-secure" SVC mode. The same physical registers are used for both secure and non-secure, so the SP value is the same irrespective of what the NS bit is, unless the monitor mode decides to modify it. So you can clear the NS bit, iterate save and restore all of the modes, and then drop into the secure world.[/size]
[size=2]
[/size]
Cancel
Up
0
Down
Cancel
Children
No data