#
24ee467d |
| 04-Feb-2023 |
cheloha <cheloha@openbsd.org> |
timecounting: remove incomplete PPS support
The timecounting code has had stubs for pulse-per-second (PPS) polling since it was imported in 2004. At this point it seems unlikely that anyone is goin
timecounting: remove incomplete PPS support
The timecounting code has had stubs for pulse-per-second (PPS) polling since it was imported in 2004. At this point it seems unlikely that anyone is going to finish adding PPS support, so let's remove the stubs:
- Delete the dead tc_poll_pps() call from tc_windup(). - Remove all tc_poll_pps symbols from the kernel.
Link: https://marc.info/?l=openbsd-tech&m=167519035723210&w=2
ok miod@
show more ...
|
#
6a28311c |
| 08-Nov-2022 |
cheloha <cheloha@openbsd.org> |
acpihpet(4): disable/reenable acpihpet_delay() during suspend/resume
We can't use the HPET to delay(9) after we halt it during suspend. Disable acpihpet_delay() before we halt the HPET and reenable
acpihpet(4): disable/reenable acpihpet_delay() during suspend/resume
We can't use the HPET to delay(9) after we halt it during suspend. Disable acpihpet_delay() before we halt the HPET and reenable it after we restart the HPET during resume.
ok mlarkin@
show more ...
|
#
81ef0162 |
| 12-Sep-2022 |
cheloha <cheloha@openbsd.org> |
acpihpet(4): acpihpet_delay: only use lower 32 bits of counter
We can't use acpihpet_r() to implement acpihpet_delay(). Even if we made acpihpet_r() atomic on amd64, i386 would still be incapable o
acpihpet(4): acpihpet_delay: only use lower 32 bits of counter
We can't use acpihpet_r() to implement acpihpet_delay(). Even if we made acpihpet_r() atomic on amd64, i386 would still be incapable of doing atomic 8-byte reads. As-is, the code does a split read on all platforms, which may or may not already be causing problems with TSC calibration:
https://marc.info/?l=openbsd-tech&m=166220561709496&w=2
Switch from acpihpet_r() to bus_space_read_4() and only use the lower 32 bits of the counter. This makes acpihpet_delay() slightly larger, but unless we want two acpihpet_delay() implementations we have no choice.
Link: https://marc.info/?l=openbsd-tech&m=166165347220077&w=2
ok jsg@
show more ...
|
#
55cc0373 |
| 25-Aug-2022 |
cheloha <cheloha@openbsd.org> |
acpihpet(4): don't truncate HPET frequency to 32-bit value
timecounter.tc_frequency is a 64-bit value: this cast is unnecessary.
Split off from the acpihpet_delay() commit at jsg@'s suggestion.
Li
acpihpet(4): don't truncate HPET frequency to 32-bit value
timecounter.tc_frequency is a 64-bit value: this cast is unnecessary.
Split off from the acpihpet_delay() commit at jsg@'s suggestion.
Link1: https://marc.info/?l=openbsd-tech&m=166053729104923&w=2 Link2: https://marc.info/?l=openbsd-tech&m=166132727120528&w=2
probably ok jsg@
show more ...
|
#
7de1614a |
| 25-Aug-2022 |
cheloha <cheloha@openbsd.org> |
acpihpet(4): add acpihpet_delay(), another delay(9) implementation
When lapic_delay() is removed from the tree in the near future, older machines without a constant/invariant TSC will need a delay(9
acpihpet(4): add acpihpet_delay(), another delay(9) implementation
When lapic_delay() is removed from the tree in the near future, older machines without a constant/invariant TSC will need a delay(9) implementation better than i8254_delay().
This patch adds acpihpet_delay(), a delay(9) implementation based on the ACPI HPET timer. It is preferable to i8254_delay() (0) and acpitimer_delay() (1000), so set its quality to 2000.
On newer machines, the HPET is slower to read than the PMT on newer machines for reasons unknown, so _technically_ this quality hierarchy is not always accurate. However, we expect these newer machines to have a constant/invariant TSC available, so the inaccuracy is harmless because tsc_delay() will be available, which is better than both the PMT and the HPET.
In general, on real hardware that predates wide availability of the constant/invariant TSC, the HPET is preferable to the PMT.
With input from jsg@.
Link: https://marc.info/?l=openbsd-tech&m=166053729104923&w=2
ok mlarkin@ jsg@
show more ...
|
#
471aeecf |
| 06-Apr-2022 |
naddy <naddy@openbsd.org> |
constify struct cfattach
|
#
8611d3cd |
| 23-Feb-2021 |
cheloha <cheloha@openbsd.org> |
timecounting: use C99-style initialization for all timecounter structs
The timecounter struct is large and I think it may change in the future. Changing it later will be easier if we use C99-style
timecounting: use C99-style initialization for all timecounter structs
The timecounter struct is large and I think it may change in the future. Changing it later will be easier if we use C99-style initialization for all timecounter structs. It also makes reading the code a bit easier.
For reasons I cannot explain, switching to C99-style initialization sometimes changes the hash of the resulting object file, even though the resulting struct should be the same. So there is a binary change here, but only sometimes. No behavior should change in either case.
I can't compile-test this everywhere but I have been staring at the diff for days now and I'm relatively confident this will not break compilation. Fingers crossed.
ok gnezdo@
show more ...
|
#
d82e6535 |
| 06-Jul-2020 |
pirofti <pirofti@openbsd.org> |
Add support for timeconting in userland.
This diff exposes parts of clock_gettime(2) and gettimeofday(2) to userland via libc eliberating processes from the need for a context switch everytime they
Add support for timeconting in userland.
This diff exposes parts of clock_gettime(2) and gettimeofday(2) to userland via libc eliberating processes from the need for a context switch everytime they want to count the passage of time.
If a timecounter clock can be exposed to userland than it needs to set its tc_user member to a non-zero value. Tested with one or multiple counters per architecture.
The timing data is shared through a pointer found in the new ELF auxiliary vector AUX_openbsd_timekeep containing timehands information that is frequently updated by the kernel.
Timing differences between the last kernel update and the current time are adjusted in userland by the tc_get_timecount() function inside the MD usertc.c file.
This permits a much more responsive environment, quite visible in browsers, office programs and gaming (apparently one is are able to fly in Minecraft now).
Tested by robert@, sthen@, naddy@, kmos@, phessler@, and many others!
OK from at least kettenis@, cheloha@, naddy@, sthen@
show more ...
|
#
d2eaebe9 |
| 29-Jun-2018 |
kettenis <kettenis@openbsd.org> |
Use <stdint.h> types.
ok mpi@, jung@, krw@, deraadt@
|
#
eb35b7b4 |
| 06-Oct-2017 |
mikeb <mikeb@openbsd.org> |
Recalibrate TSC timecounter with HPET and PM timer
If frequency of an invariant (non-stop) time stamp counter is measured using an independent working timecounter that has a known frequency, we can
Recalibrate TSC timecounter with HPET and PM timer
If frequency of an invariant (non-stop) time stamp counter is measured using an independent working timecounter that has a known frequency, we can assume that the measured TSC frequency is as good as the resolution of the timecounter that we use to perform the measurement. This lets us switch from this high quality but expensive source to the cheaper TSC without sacrificing precision on a wide range of modern CPUs.
From Adam Steen <adam@adamsteen.com.au> with tweaks from reyk@ and myself.
Tested by brynet@, sthen@ and others, OK mlarkin, sthen
show more ...
|
#
26e3a3e8 |
| 06-Oct-2015 |
matthew <matthew@openbsd.org> |
0xffffffff is 32 bits, not 24 bits
ok deraadt
|
#
a02f4b6c |
| 12-Aug-2015 |
mlarkin <mlarkin@openbsd.org> |
Check proper HPET period value during attach.
Pointed out by patrick keshishian <pkeshish at gmail.com>, thanks.
|
#
5c01e489 |
| 04-Aug-2015 |
deraadt <deraadt@openbsd.org> |
do not save & restore a capability register, it is RO. issue noticed by patrick kehishian, ok mlarkin
|
#
21dab745 |
| 14-Mar-2015 |
jsg <jsg@openbsd.org> |
Remove some includes include-what-you-use claims don't have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels.
ok tedu@ deraadt@
|
#
3add14d5 |
| 05-Mar-2014 |
deraadt <deraadt@openbsd.org> |
force cfattach decl to same form as others
|
#
83270512 |
| 21-Dec-2013 |
deraadt <deraadt@openbsd.org> |
save/restore hpet configuration. Perhaps a little more than we need to do, since we do not use many hpet features. ok kettenis millert
|
#
47f416ed |
| 19-Dec-2013 |
deraadt <deraadt@openbsd.org> |
be more careful during suspend/resume cycles, as roughly detailed in the spec. More might be required. ok jordan matthew mlarkin
|
#
97c0407e |
| 16-Aug-2012 |
tedu <tedu@openbsd.org> |
we are past the point where timecounters may disappear ok miod
|
#
7a772371 |
| 10-Jan-2011 |
mikeb <mikeb@openbsd.org> |
Attach acpihpet only once. The matching code is changed because acpi bus can be enumerated which means match routine should do the right thing and prevent further attachments.
With input from kette
Attach acpihpet only once. The matching code is changed because acpi bus can be enumerated which means match routine should do the right thing and prevent further attachments.
With input from kettenis, deraadt, miod; ok deraadt, kettenis
show more ...
|
#
16da9be3 |
| 21-Jul-2010 |
deraadt <deraadt@openbsd.org> |
spacing and indents that are driving me crazy
|
#
26506b25 |
| 23-Nov-2009 |
deraadt <deraadt@openbsd.org> |
knf
|
#
ef0fa280 |
| 23-Nov-2009 |
pirofti <pirofti@openbsd.org> |
Fix pckbd and acpihpet suspend/resume cases to fit with the future framework that's going to get in really soon.
Okay mlarkin@, deraadt@.
|
#
e78728c7 |
| 13-Oct-2009 |
pirofti <pirofti@openbsd.org> |
Get rid of devact enum, substitute it with an int and coresponding defines.
This is needed for the addition of further suspend/resume actions.
Okay deraadt@, marco@.
|
#
3ccb1ee2 |
| 12-Aug-2009 |
pirofti <pirofti@openbsd.org> |
Add wake support to acpihpet(4).
Patch initially from mlarkin@. KNF and refactoring by me. Okay deraadt@.
|
#
5648a1ff |
| 20-Jan-2009 |
kettenis <kettenis@openbsd.org> |
Add workaround for broken ATI southbridges; inspired by how Linux handles this. Fixes PR 5916 & 5959.
ok toby@
|