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

Fix incorrect clock calculation on macOS #60

Merged
merged 1 commit into from
Sep 12, 2024
Merged

Conversation

chiangkd
Copy link
Collaborator

@chiangkd chiangkd commented Sep 10, 2024

The current semu_timer_clocksource() returns the clock source in nanoseconds when building on macOS. Causing an abnormal timestamp in the boot log.

...
[ 3062.927108] sched_clock: 64 bits at 65MHz, resolution 15ns, wraps every 2199023255550ns

Divide the return value by 1e9, ensuring the clock source is provided in seconds.

@ChinYikMing
Copy link
Collaborator

Change MacOS in the commit title to macOS.

@ChinYikMing
Copy link
Collaborator

Issue found in #59.

@chiangkd chiangkd changed the title Fix incorrect clock calculation on MacOS Fix incorrect clock calculation on macOS Sep 10, 2024
@ChinYikMing
Copy link
Collaborator

Change MacOS in the commit title to macOS.

Also the title in the commit, you may force push after changing.

Copy link
Collaborator

@jserv jserv left a comment

Choose a reason for hiding this comment

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

Improve the git commit message.

The current implementation of 'semu_timer_clocksource()' returns
the clock source in nanoseconds, but it should return in seconds
for correct system integration.

Adjust the function on macOS to divide the return value by 1e9,
ensuring the clock source is provided in seconds.
@jserv jserv merged commit 1dc59cb into sysprog21:master Sep 12, 2024
2 checks passed
@jserv
Copy link
Collaborator

jserv commented Sep 12, 2024

Thank @chiangkd for contributing!

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.

3 participants