aboutsummaryrefslogtreecommitdiff
path: root/include/mach/time_value.h
Commit message (Collapse)AuthorAgeFilesLines
* Drop spurious tabsSamuel Thibault2023-03-131-11/+11
|
* Track task and thread time using time_value64_t.Flavio Cruz2023-03-131-0/+5
| | | | | | | | Changed kern/timer.c to use the higher precision time_value64_t. Of course, this won't suffer from the 2038 overflow but it does provide nanosecond precision (if gnumach ever uses a better timer) and moves us closer to only having time_value64_t. Message-Id: <ZA63tGcv3bETUJFJ@jupiter.tail36e24.ts.net>
* Add TIME_VALUE64_TO_TIMESPEC and TIMESPEC_TO_TIME_VALUE64Flavio Cruz2023-02-231-0/+12
| | | | | We can use these in userland with the new time_value64_t struct. Message-Id: <Y/RRck2JffqNenif@jupiter.tail36e24.ts.net>
* time_value: Fix rpc_time_value_t compatibility.Samuel Thibault2023-02-131-1/+6
| | | | | | | 5fdc928d3d29 ("fix rpc time value for 64 bit") broke hurd build because structures are never compatible in C. For userland we however know that rpc_time_value is the same as time_value, so we can just typedef rpc_time_value_t to struct time_value as userland is used to.
* Add host_get_time64 RPC to return the time as time_value64_tFlavio Cruz2023-01-191-13/+31
| | | | | | Also updated the mapped time to support the new 64-bit time while keeping compatible with the user land programs currently using it so they can be migrated in parallel.
* Introduce time_value64_t to keep track of real time in the kernelFlavio Cruz2023-01-031-1/+26
| | | | | | | | | | | | time_value64_t uses int64_t to track seconds and nanoseconds and hence is Y2038 proof. It does not have nano second resolution but it could be provided in the future. Removed include/sys/time.h as it remaps time_value_t into timeval which can create confusion. The timestamp from keyboard and mouse events is no longer set and replaced with rpc_time_value for better compatibility.
* time_value: Fix usage in e.g. c89 programsSamuel Thibault2022-12-191-2/+2
| | | | | | The inline keyword was not defined there, so we need to use __inline__. This fixes make check in glibc.
* Use struct for time_value_t and define seconds as long_integer_t.Flavio Cruz2022-12-171-1/+26
| | | | | | | On 64 bit kernels, seconds will be 64 bits long and won't suffer from the 2038 problem. We also add a new type rpc_time_value_t to handle the conversion between 32 bit userland and 64 bit kernel. Message-Id: <Y50kIaIgaIdGjDAk@mars>
* Add macros to convert between time_value_t and timespecFlávio Cruz2015-09-191-0/+12
| | | | | * include/mach/time_value.h (TIME_VALUE_TO_TIMESPEC, TIMESPEC_TO_TIME_VALUE): New macros
* kern: use proper memory fences when handling the mapped timeJustus Winter2015-09-071-0/+2
| | | | | | | | * include/mach/time_value.h (struct mapped_time_value): Adjust comment. * kern/mach_clock.c (mtime): Likewise. Also make it volatile. (update_mapped_time): Use full hardware barriers. (read_mapped_time): New macro with proper fences. (record_time_stamp, host_get_time): Use the new macro.
* include: provide time-value substractionJustus Winter2015-07-251-7/+24
| | | | | | | | | * include/mach/time_value.h (time_value_assert): New macro to assert that the given value is well-formed. (time_value_add_usec): Use the new macro. (time_value_sub_usec): New macro. (time_value_add): Use `time_value_add_usec'. (time_value_sub_usec): New macro.
* Initial sourceThomas Bushnell1997-02-251-0/+80