Skip to content

Conversation

@Patater
Copy link
Contributor

@Patater Patater commented Nov 8, 2016

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

@Patater Patater changed the title svc: Make svc_exports.h great again WIP svc: Make svc_exports.h great again Nov 9, 2016
@Patater Patater force-pushed the make-svc-great-again branch from 35bdff0 to 4dc15af Compare November 10, 2016 13:13
@Patater Patater changed the title WIP svc: Make svc_exports.h great again svc: Make svc_exports.h great again Nov 10, 2016
#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))
Copy link
Contributor

@meriac meriac Nov 10, 2016

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?

Copy link
Contributor Author

@Patater Patater Nov 10, 2016

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)

Copy link
Contributor

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

Copy link
Contributor Author

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.
@Patater Patater force-pushed the make-svc-great-again branch from 4dc15af to 5b7aae2 Compare November 10, 2016 13:30
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")
@Patater Patater force-pushed the make-svc-great-again branch from 5b7aae2 to a7ce44c Compare November 10, 2016 13:33
@Patater
Copy link
Contributor Author

Patater commented Nov 10, 2016

Tests pass on EFM32.

Copy link
Contributor

@niklarm niklarm left a comment

Choose a reason for hiding this comment

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

LGTM

@meriac meriac merged commit b5ec8ba into ARMmbed:master Nov 10, 2016
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.

4 participants