-
Notifications
You must be signed in to change notification settings - Fork 639
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
mcs: more uniformly handle ready and release queue updates #1176
Conversation
This also affects non-MCS configs, so we can only merge once we have ported the verification of it to the master branch as well. Maybe some words on the background of this: factoring out the queue updates means we only have to verify them once, not twice. The change in type is there to achieve that genericity, and the head/tail type is the same mechanism used for |
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.
Looks functionally correct to me.
It's mostly the insert operation that's different, but that can be solved by first finding the spot and then inserting the item. The rest seems pretty generic. Still at this point it's probably not quite worth it. Especially
The problem is not C, in C you would let the next/prev pointers point to It's worth doing if more complex structures than lists are used in the future, like heaps or trees. |
de51820
to
c9f7a50
Compare
This introduces library functions for updating the linked lists which use the tcbSchedNext and tcbSchedPrev pointers of a TCB, and uses these to perform the updates to the ready queues and the release queue. In order to accommodate this, ksReleaseQueue is now of type tcb_queue_t. Co-authored-by: Gerwin Klein <gerwin.klein@proofcraft.systems> Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
c9f7a50
to
717c6b1
Compare
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 is now ready to merge if all tests pass.
This introduces library functions for updating the linked lists which use the
tcbSchedNext
andtcbSchedPrev
pointers of a TCB, and uses these to perform the updates to the ready queues and the release queue.In order to accommodate this,
ksReleaseQueue
is now of typetcb_queue_t
.