[ros-kernel] Kernel system time query - is it really working?

Hartmut Birr hartmut.birr at gmx.de
Tue Mar 9 18:20:13 CET 2004


> -----Original Message-----
> From: ros-kernel-bounces at reactos.com 
> [mailto:ros-kernel-bounces at reactos.com] On Behalf Of Mike Nordell
> Sent: Tuesday, March 09, 2004 2:43 PM
> To: ros-kernel
> Subject: [ros-kernel] Kernel system time query - is it really working?
> 
> 
> Either I have my head screwed on the wrong way today, or 
> KeQuerySystemTime
> requires some commenting.
> 
> This function busy-waits for 
> SharedUserData->SystemTime.High2Part to be
> changed. Now, I don't really see the reson for these 
> High1Part/High2Part
> variables. Is this really how they are named and used in NT?
> 

This is not a busy wait. If there is an update by the timer interrupt,
the values are changed in the sequence High2Part, LowPart and High1Part.
The query functions read these values in the reverse sequence
(High1Part, LowPart, High2Part). If the query function is intercepted by
the interrupt and the high value are changed (overrun of the low value),
than High1Part and High2Part are different. The query function can
detect this and reread the values. The query function must not be
synchronized with the interrupt and the user mode query function must
not call the kernel mode function because the values are available from
the shared user page.

- Hartmut




More information about the Ros-kernel mailing list