-
Notifications
You must be signed in to change notification settings - Fork 193
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
[RFC] opt-in Peripherals
steal
#201
Comments
Thanks for the heads-up! This looks sensible to me, and would solve the problem I reported in #163. |
Is |
@TeXitoi the framework internally uses |
I agree with the addition, but not with the default. |
@korken89 the multi-core default is to not take the peripherals, though, so in a way the two defaults wouldn't match if we go with I do see how @TeXitoi any thoughts on what the defaults should be? Modulo the defaults I think we have consensus on the rest of the RFC so I'm going to FCP this with disposition to merge. Let's solve the question about the defaults during the FCP. |
I don't like default values to be true. That's much more intuitive to have false when you don't set something. So my preference is to false even if that's the most common choice. OK for me for the rest. |
@TeXitoi True (no pun intended). The |
Technically I agree, from the old usage patterns I do not agree. |
🎉 This RFC with the single-core default of |
205: rtfm-syntax refactor + heterogeneous multi-core support r=japaric a=japaric this PR implements RFCs #178, #198, #199, #200, #201, #203 (only the refactor part), #204, #207, #211 and #212. most cfail tests have been removed because the test suite of `rtfm-syntax` already tests what was being tested here. The `rtfm-syntax` crate also has tests for the analysis pass which we didn't have here -- that test suite contains a regression test for #183. the remaining cfail tests have been upgraded into UI test so we can more thoroughly check / test the error message presented to the end user. the cpass tests have been converted into plain examples EDIT: I forgot, there are some examples of the multi-core API for the LPC541xx in [this repository](https://github.com/japaric/lpcxpresso54114) people that would like to try out this API but have no hardware can try out the x86_64 [Linux port] which also has multi-core support. [Linux port]: https://github.com/japaric/linux-rtfm closes #178 #198 #199 #200 #201 #203 #204 #207 #211 #212 closes #163 cc #209 (documents how to deal with errors) Co-authored-by: Jorge Aparicio <jorge@japaric.io>
205: rtfm-syntax refactor + heterogeneous multi-core support r=japaric a=japaric this PR implements RFCs #178, #198, #199, #200, #201, #203 (only the refactor part), #204, #207, #211 and #212. most cfail tests have been removed because the test suite of `rtfm-syntax` already tests what was being tested here. The `rtfm-syntax` crate also has tests for the analysis pass which we didn't have here -- that test suite contains a regression test for #183. the remaining cfail tests have been upgraded into UI test so we can more thoroughly check / test the error message presented to the end user. the cpass tests have been converted into plain examples EDIT: I forgot, there are some examples of the multi-core API for the LPC541xx in [this repository](https://github.com/japaric/lpcxpresso54114) people that would like to try out this API but have no hardware can try out the x86_64 [Linux port] which also has multi-core support. [Linux port]: https://github.com/japaric/linux-rtfm closes #178 #198 #199 #200 #201 #203 #204 #207 #211 #212 closes #163 cc #209 (documents how to deal with errors) Co-authored-by: Jorge Aparicio <jorge@japaric.io>
Done in PR #205 |
201: Add binary for armv8 hardfloat r=korken89 a=aurabindo Fixes build for `thumbv8m.main-none-eabihf` Co-authored-by: Aurabindo Jayamohanan <mail@aurabindo.in>
Current behavior
The
init::Context
struct includes adevice
field whose type is#device::Peripherals
, a singleton that's a collection of all the deviceperipherals.
Proposal
Don't include this
device
field by default. Add aperipheral
argument to the#[rtfm::app]
attribute that lets the user opt into today's behavior.Rationale
#device::Peripherals
is a singleton; in multi-core mode only one core cantake all the peripherals so it's necessary to specify which core will take the
singleton.
Detailed design
The
#[rtfm::app]
attribute will gain aperipherals
argument whose semanticsvaries between single-core and multi-core mode.
Single-core mode
In single core mode the argument takes a boolean that indicates whether the
device peripherals will be made available during the
init
function. When theperipherals
argument is omitted the peripherals will not be made available.Multi-core mode
In multi-core mode the
peripherals
argument takes a integer that indicateswhich core will take the device peripherals during
init
. If the argument isomitted then the peripherals will not be taken by the framework.
Alternatives
In single-core mode, should the default be to have RTFM take the peripherals?
That is
peripherals
would default totrue
matching today's behavior and onewould have to opt-out by writing
peripherals = false
.One could design a syntax to split the peripherals between the many
init
functions in multi-core mode but this can't be implemented today's without extra
help from
svd2rust
so this proposal doesn't delve into that question.cc @hannobraun #163
The text was updated successfully, but these errors were encountered: