Skip to content
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

eintr: support for blocking syscall INTR (interrupted) mode #13

Merged
merged 2 commits into from
Aug 7, 2024

Conversation

pthierry-ledger
Copy link
Member

@pthierry-ledger pthierry-ledger commented Aug 7, 2024

When sys_waitforevent() task is preempted due to no input read, the syscall is interrupted.
In that very case, if another task push an IPC and awake the target task, the uapi implementation is continuing its execution just after the effective svc() call, but has not read effective data (due to previous preemption when nothing was read).
In that very case, the waitforevent() uapi implementation must detect such interruption in order to read back the content now that the peer send_ipc() is made.
To do that, a STATUS_INTR (interrupted sycall) has been added, so that the uapi is able to re-execute the sysgate.

This allows fully transparent and homogeneous behavior of waitforevent() whatever the sequential task execution is.

STATUS_INTR has also been added for signal and irq input events, for the very same reason.
For the sleep() case, EINTR is also added for early awoking from sleep() mode, to easily differenciate such case from timeouted sleep, in replacement of the STATUS_OK status code.

@pthierry-ledger pthierry-ledger added bug Something isn't working enhancement request for code evolution labels Aug 7, 2024
@pthierry-ledger pthierry-ledger added this to the Sentry-v0.3.0 milestone Aug 7, 2024
support EINTR for early awokened sleep
Copy link
Contributor

@fvalette-ledger fvalette-ledger left a comment

Choose a reason for hiding this comment

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

Form is okay for me, to be confirmed that works well.

@pthierry-ledger pthierry-ledger merged commit ae96237 into main Aug 7, 2024
45 checks passed
Copy link
Contributor

@iartemov-ledger iartemov-ledger left a comment

Choose a reason for hiding this comment

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

Works on the target with complete project and without a weird sys_yield() in application part.

@pthierry-ledger pthierry-ledger deleted the wfe-intr-syscall-support branch September 11, 2024 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement request for code evolution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants