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

[kernel/libc] Allow for concurrent operation of libc and kernel precision timer #1964

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

ghaerr
Copy link
Owner

@ghaerr ghaerr commented Aug 14, 2024

The 8254 PIT countdown register is changed to be read during the interrupts disabled critical section, which allows for concurrent use of the precision timer get_ptime function from both the kernel and an application process performing measurements at the same time. This may be useful when measuring the ktcp main loop and also looking at a NIC driver packet read/write response time, for instance.

Discussed briefly in #1963 and Mellvik/TLVC#71.

Moves ptostr routine into libc/misc with the other numeric to string conversion routines.
Use write rather than printf for errors in init_ptime() to keep dependencies down.

@ghaerr ghaerr merged commit 7aba3e5 into master Aug 14, 2024
4 checks passed
@ghaerr ghaerr deleted the prectimer5 branch August 14, 2024 19:51
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.

1 participant