[PATCH v2 0/1] Integrate HPET so the functions used for getting time can have a higher accuracy

2025-03-22 Thread Zhaoming Luo
Compared with RFC version: - Call them hpc (high-precision clock) instead of hpet. - Move the function signatures to kern/mach_clock.h. - Cap the value in time_value64_add_hpet(). Zhaoming Luo (1): Integrate HPET so the functions used for getting time can have a higher accuracy i386/i386/a

[PATCH mach v2 1/1] Integrate HPET so the functions used for getting time can have a higher accuracy

2025-03-22 Thread Zhaoming Luo
Integrate HPET so host_get_time, host_get_time64, and host_get_uptime64 are more precise. The highest precision can be 10ns when this patch is applied. * i386/i386/apic.c: Implement the two high-precision clock interface functions added in this patch for i386. * i386/i386at/model_dep.c: Initiali

Re: [RFC PATCH gnumach] kern: Integrate HPET so the functions used for getting time can have a higher accuracy

2025-03-22 Thread Zhaoming Luo
On Sun, Mar 23, 2025 at 12:48:52AM +0100, Samuel Thibault wrote: > Hello, > Thanks for the review > Zhaoming Luo, le sam. 22 mars 2025 15:24:50 +0800, a ecrit: > > > diff --git a/i386/i386at/model_dep.c b/i386/i386at/model_dep.c > > index 30449c37..aa8451ac 100644 > > --- a/i386/i386at/model_dep

[PATCH v2 0/1] mach: Use the host_get_time64 to replace the deprecated host_get_time for CLOCK_REALTIME when it's available

2025-03-22 Thread Zhaoming Luo
Thank you Samuel for the review. Compared with v1: - Check if host_get_time64 RPC is available and use it for CLOCK_REALTIME when it is Zhaoming Luo (1): mach: Use the host_get_time64 to replace the deprecated host_get_time for CLOCK_REALTIME config.h.in | 3 +++ sysde

[PATCH v2 1/1] mach: Use the host_get_time64 to replace the deprecated host_get_time for CLOCK_REALTIME when it's available

2025-03-22 Thread Zhaoming Luo
Check the availability of host_get_time64 and use it to replace host_get_time for CLOCK_REALTIME when it's available. host_get_time is deprecated See https://git.savannah.gnu.org/cgit/hurd/gnumach.git/commit/?id=569df850cd7badd1e36132ad3b44aa76a4d27c25 However, it's kept for backward compactbilit

Re: [PATCH] mach: Use the host_get_time64 to replace the deprecated host_get_time for CLOCK_REALTIME

2025-03-22 Thread Samuel Thibault
Hello, Zhaoming Luo, le dim. 23 mars 2025 09:50:33 +0800, a ecrit: > Use the host_get_time64 to replace the deprecated host_get_time for > CLOCK_REALTIME. host_get_time64 is not always available, not with older gnumach. Please use #if machinery like above in the monotonic case. In general, pleas

[PATCH] mach: Use the host_get_time64 to replace the deprecated host_get_time for CLOCK_REALTIME

2025-03-22 Thread Zhaoming Luo
Use the host_get_time64 to replace the deprecated host_get_time for CLOCK_REALTIME. See https://git.savannah.gnu.org/cgit/hurd/gnumach.git/commit/?id=569df850cd7badd1e36132ad3b44aa76a4d27c25 --- sysdeps/mach/clock_gettime.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --g

Re: [RFC PATCH gnumach] kern: Integrate HPET so the functions used for getting time can have a higher accuracy

2025-03-22 Thread Samuel Thibault
Hello, Zhaoming Luo, le sam. 22 mars 2025 15:24:50 +0800, a ecrit: > The HPET counter is read once in every clock interrupt. When any of the > functions used for getting time is used, the HPET counter is read again and > the difference between these two read is multiplied by the HPET period > and

[RFC PATCH gnumach] kern: Integrate HPET so the functions used for getting time can have a higher accuracy

2025-03-22 Thread Zhaoming Luo
The HPET counter is read once in every clock interrupt. When any of the functions used for getting time is used, the HPET counter is read again and the difference between these two read is multiplied by the HPET period and added to the read value from time or uptime to get a more accurate time read