-
Notifications
You must be signed in to change notification settings - Fork 38
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
Interrupt latency benchmark #44
Conversation
b2963fc
to
6b73198
Compare
sdk/core/scheduler/main.cc
Outdated
@@ -413,19 +413,19 @@ int __cheri_compartment("sched") | |||
} | |||
return typed_op<Event>(evt, [&](Event &event) { | |||
return event.bits_wait( | |||
retBits, bitsToWait, clearOnExit, waitAll, timeout); | |||
retBits, bitsToWait, flags & EventWaitClearOnExit, flags & EventWaitAll, timeout); |
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.
It would be nice to wrap this in the same kind of template that I did for PAL features in snmalloc. Something like:
template<EventWaitFlags Desired>
bool has_event_flag(int eventFlags)
{
return eventFlags & int(Desired);
}
I am always somewhat nervous of raw &
for checking bitfields because you're relying on the implicit conversion to bool, which can happen in a different place if you don't put enough brackets around the expression. Putting it in a separate function forces it to happen at the evaluation of the return and better expresses intentionality.
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.
Better now?
6b73198
to
1e7761b
Compare
sdk/include/event.h
Outdated
@@ -98,3 +121,24 @@ int __cheri_compartment("sched") | |||
event_delete(struct SObjStruct *heapCapability, void *evt); | |||
|
|||
__END_DECLS | |||
|
|||
#ifdef __cplusplus |
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.
Not sure these should go in the public header: I don't see them as being useful for anything other than the scheduler (a helper for constructing the flags would be).
Marking as draft due to unresolved issues especially around |
5a529b6
to
7ef216b
Compare
After some consideration have decided that we don't need the |
This can mess up the interrupt latency benchmark because an interrupt can fire in call to event_wait_bits even though we called from an interrupt disabled context. We need to evaluate whether we really need to enable intererupts here.
7ef216b
to
0022710
Compare
No description provided.