- Resolves the soundness issue with register_structs.
- Makes it relatively easy to unit-test driver implementations.
Meeting these requirements without using procedural macros is not really feasible (the complexity of the required macro vastly exceeds the amount of complexity manageable in a macro_rules! macro). As a result, I plan to use procedural macros in tock-registers, and furthermore, those procedural macros will need to depend on the syn, quote, and proc-macro2 crates.
I've opened
PR 4814 to extend Tock's external dependencies policy to allow for these macros. Please take a look at it and provide your input. Feedback has already resulted in one change: my tock-registers prototype now supports a build mode where macro expansion is performed up-front, allowing the procedural macros to be omitted from the final build.
For reference, my current prototype for the new tock-registers is at
tock-registers PR 11. Feel free to take a look at that and provide feedback on it as well!
Thank you,
Johnathan Van Why