Skip to content

add high level API to set priority of system handlers #117

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

Merged
merged 6 commits into from
Oct 26, 2018
Merged

Conversation

japaric
Copy link
Member

@japaric japaric commented Oct 24, 2018

needed for cortex-m-rtfm v0.4.x (it makes my life easier / it makes it easier to
support ARMv6-M)

r? @rust-embedded/cortex-m (anyone)

@japaric japaric requested a review from a team as a code owner October 24, 2018 09:48
/// SV call interrupt
SVCall,

// #[cfg(not(armv6m))]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not so hot about having this commented out bit in here. Can we figure out whether it has configurable priority and either take it in or leave it out?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the ARMv7 ARM it says (B1.5.1)...

image

Is there reason to believe it is not configurable?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's got PRI_12 in SHPR3 too:
image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adamgreig Thanks. PRI_12 was omitted in the Cortex-M4 documentation I read. (Not the first time ARM omits information about debugging / profiling capabilities in some revisions of their docs)

/// SV call interrupt
SVCall,

// #[cfg(not(armv6m))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the ARMv7 ARM it says (B1.5.1)...

image

Is there reason to believe it is not configurable?

{
// NOTE(unsafe) atomic read with no side effects
let shpr = unsafe { (*Self::ptr()).shpr[usize::from((index - 8) / 4)].read() };
let prio = (shpr >> (index % 4)) & 0x000000ff;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be (index % 4) * 8?

#[cfg(armv6m)]
{
self.shpr[usize::from((index - 8) / 4)].modify(|value| {
let shift = index % 4;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As previous comment, (index % 4) * 8?

it was there to maybe support adding DebugMonitor in the future but it has
already been added
lints have changed between nightly and stable
@japaric
Copy link
Member Author

japaric commented Oct 26, 2018

Addressed review comments

@therealprof
Copy link
Contributor

bors try

bors bot added a commit that referenced this pull request Oct 26, 2018
@bors
Copy link
Contributor

bors bot commented Oct 26, 2018

try

Build succeeded

@therealprof
Copy link
Contributor

bors r+

bors bot added a commit that referenced this pull request Oct 26, 2018
117: add high level API to set priority of system handlers r=therealprof a=japaric

needed for cortex-m-rtfm v0.4.x (it makes my life easier / it makes it easier to
support ARMv6-M)

r? @rust-embedded/cortex-m (anyone)

Co-authored-by: Jorge Aparicio <[email protected]>
@bors
Copy link
Contributor

bors bot commented Oct 26, 2018

Build succeeded

@bors bors bot merged commit e2bda1a into master Oct 26, 2018
@bors bors bot deleted the handler-priority branch October 26, 2018 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants