Skip to content
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

Use far-ranged jumps for DH_TRAMPOLINE #139

Merged
merged 1 commit into from
Sep 7, 2017
Merged

Use far-ranged jumps for DH_TRAMPOLINE #139

merged 1 commit into from
Sep 7, 2017

Conversation

jonas-schievink
Copy link
Contributor

@jonas-schievink jonas-schievink commented Sep 5, 2017

Fixes japaric/cortex-m-rtfm#42

Note that this will make all generated crates that target an armv6
device fail to compile unless they add a build script enabling the added
cfg.
(this is no longer the case, everything should Just Work™)

@japaric
Copy link
Member

japaric commented Sep 6, 2017

@jonas-schievink thanks for tackling this.

It just occurred to me that instead of using a #[cfg] and requiring a build script in the device crate we could (a) add a new --target, e.g. armv6m, to svd2rust to make it generate this extra function only (so no #[cfg] required) when generating code for an ARMv6 device; or, perhaps even better, (b) we could make svd2rust parse the <cpu> information in the SVD file to generate the extra function when dealing with Cortex-M0 and Cortex-M0+ devices. Now, I don't recall if <cpu> info is mandatory in SVD files so it may not be available, and it could be the case that it's in the SVD file but it could be incorrect (some SVD files are very low quality).

Thoughts?

@Samonitari
Copy link

Hi @japaric!
👍 for proposition b): reading the <cpu> element.
You also added const NVIC_PRIO_BITS generation, and ARM documentation says the whole <cpu> is mandatory in case it is used for header generation. svd2rust is as close as it gets...

It reminds me, I should commit somewhere some fixed NXP SVD files, to spare others from the uninspiring labor I had to do.

@jonas-schievink
Copy link
Contributor Author

jonas-schievink commented Sep 6, 2017

@japaric Using the SVD seems like the best idea, I've pushed a commit doing that.

@japaric
Copy link
Member

japaric commented Sep 7, 2017

@homunkulus r+

Thanks all for chimming in :-)

@homunkulus
Copy link
Contributor

📌 Commit 87ac8d8 has been approved by japaric

@homunkulus
Copy link
Contributor

🔒 Merge conflict

@homunkulus
Copy link
Contributor

☔ The latest upstream changes (presumably bab6f3e) made this pull request unmergeable. Please resolve the merge conflicts.

Fixes japaric/cortex-m-rtfm#42

Note that this will make all generated crates that target an armv6
device fail to compile unless they add a build script enabling the added
`cfg`.
@japaric
Copy link
Member

japaric commented Sep 7, 2017

@homunkulus r+

@homunkulus
Copy link
Contributor

📌 Commit a8994ef has been approved by japaric

@homunkulus
Copy link
Contributor

⌛ Testing commit a8994ef with merge a8994ef...

@homunkulus
Copy link
Contributor

☀️ Test successful - status-appveyor, status-travis
Approved by: japaric
Pushing a8994ef to master...

@homunkulus homunkulus merged commit a8994ef into rust-embedded:master Sep 7, 2017
@jonas-schievink jonas-schievink deleted the v6trampoline branch September 7, 2017 23:35
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.

5 participants