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

hal/ia32: Implement HP timer #476

Merged
merged 3 commits into from
Nov 15, 2023
Merged

hal/ia32: Implement HP timer #476

merged 3 commits into from
Nov 15, 2023

Conversation

astalke
Copy link
Contributor

@astalke astalke commented Nov 14, 2023

Description

Add support for 2 timers that may be available in ia32: Local APIC Timer and High Precision Event Timers (HPET). If they are available, they will be used instead of old Programmable Interval Timer (PIT).

Motivation and Context

This change makes it possible to sleep times shorter than 10ms.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: ia32-generic-qemu, ia32-generic-pc

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

hal/ia32/init.h Outdated Show resolved Hide resolved
hal/ia32/init.h Outdated Show resolved Hide resolved
hal/ia32/timer.c Outdated Show resolved Hide resolved
hal/ia32/timer.c Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Nov 14, 2023

Unit Test Results

5 989 tests  +32   5 348 ✔️ +32   33m 0s ⏱️ + 2m 57s
   333 suites ±  0      641 💤 ±  0 
       1 files   ±  0          0 ±  0 

Results for commit 1e84866. ± Comparison against base commit cf8714a.

♻️ This comment has been updated with latest results.

hal/ia32/init.h Outdated Show resolved Hide resolved
hal/ia32/init.h Outdated Show resolved Hide resolved
hal/ia32/timer.c Outdated Show resolved Hide resolved
hal/ia32/init.h Outdated Show resolved Hide resolved
hal/ia32/timer.c Outdated Show resolved Hide resolved
hal/ia32/timer.c Outdated Show resolved Hide resolved
hal/ia32/init.h Show resolved Hide resolved
hal/ia32/init.h Show resolved Hide resolved
hal/ia32/init.h Show resolved Hide resolved
hal/ia32/init.h Show resolved Hide resolved
hal/ia32/timer.c Show resolved Hide resolved
hal/ia32/init.h Outdated Show resolved Hide resolved
@astalke astalke force-pushed the astalke/RTOS-530 branch 3 times, most recently from 2005a01 to 2ef32db Compare November 14, 2023 15:25
agkaminski
agkaminski previously approved these changes Nov 14, 2023
Copy link
Member

@agkaminski agkaminski left a comment

Choose a reason for hiding this comment

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

LGTM

- Reason: The old name `when` is misleadig, since it is time to wait
  and not a fixed moment in time. Changed it to `waitUs`.

JIRA: RTOS-530
- Move code reading and writing to Local APIC to its own functions.
- Add detection of Local APIC Timer's frequency.
- Make Local APIC timer the default timer for scheduling

JIRA: RTOS-530
JIRA: RTOS-530
@agkaminski agkaminski merged commit 6d4fdf2 into master Nov 15, 2023
29 of 30 checks passed
@agkaminski agkaminski deleted the astalke/RTOS-530 branch November 15, 2023 15:07
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.

2 participants