-
Notifications
You must be signed in to change notification settings - Fork 72
svc: Make svc_exports.h great again #375
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
Conversation
35bdff0 to
4dc15af
Compare
api/inc/register_gateway.h
Outdated
| #define __UVISOR_OFFSETOF(type, member) ((uint32_t) (&(((type *)(0))->member))) | ||
|
|
||
| /** Generate the SVCall opcode from the SVC ID. */ | ||
| #define UVISOR_SVC_OPCODE(id) ((uint16_t) 0xDF00 | (uint8_t) ((id) & 0xFF)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Patater the (uint8_t) cast in combination and the 0xFF seems to be too much - either one or the other?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This matches what we had before. I'm just moving it between files now. (It was in core/system/inc/svc.h)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't answer my question
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a commit to remove the extra casts from UVISOR_SVC_OPCODE.
We don't need the uint8_t cast. Performing a bitwise and with 0xFF is good enough to force the range of values `id` can become. Remove the uint8_t cast. Keep the uint16_t cast, as the opcode should be seen as a uint16_t.
4dc15af to
5b7aae2
Compare
Removing svc_exports.h broke the register-level gateway. Re-create svc_exports.h with just the minimum needed to make the register-level gateway work again. Fixes: f51198c ("Expose all uVisor API via a function table")
5b7aae2 to
a7ce44c
Compare
|
Tests pass on EFM32. |
niklarm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Removing svc_exports.h broke the register-level gateway. Re-create
svc_exports.h with just the minimum needed to make the register-level
gateway work again.
Fixes: f51198c ("Expose all uVisor API via a function table")
@AlessandroA @meriac @niklas-arm