-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CBAR register and fix TE bit #6
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rustc already has target cfg's for these
Add an SVC example too.
If we boot at EL2, we manage to switch to EL1, however performing a 'SVC' instruction puts us in a mode where our stack pointer is NULL, crashing the CPU. The default exception handler also does semihosting now.
* Tested on armv7r-none-eabi, armv7r-none-eabihf and an armv8r-none-eabihf machine that boots into EL2 * Used macros to de-duplicate the exception entry and exit code. * Set up different stacks for the various different modes.
Let the compiler pick A32 or T32.
It would be bad for an operation that should be in a critical-section to move to the other side.
This helped me find a bug in my IRQ handler, where Armv7-R and Armv8-R AArch32 both state that an IRQ exception is given an address in LR that is four bytes larger than the actual return address. Because of pipeline issues back in the mid-1980s or something.
We need the const-asm support that was added.
We can get LLVM to store LR, if and only if it needs to, by marking it as clobbered. The SPRS is handled by the SVC trampoline, even if we SVC inside an SVC.
Helps the debugger understand where one function ends and another begins.
Both my test chip and QEMU return zero from CBAR though, which is unhelpful.
f62a363
to
96338fc
Compare
As we can't compile any Thumb code for Armv7-R or Armv8-R in Rust (as it stands), we're always going to have Arm Exceptions not Thumb Exceptions.
96338fc
to
8226985
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds access to the CBAR register, and ensures the TE bit is not set so we don't attempt to execute Exceptions in Thumb mode (the Rust compiler can only generate A32 instructions for this target).
Requires #5