Age | Commit message (Collapse) | Author |
|
have stored the struct cpu_info * in the wrapper around the interrupt
handler cookie, but since we can have a few layers inbetween, this does
not seem very nice. Instead have each and every interrupt controller
provide a barrier function. This means that intr_barrier(9) will in the
end be executed by the interrupt controller that actually wired the pin
to a core. And that's the only place where the information is stored.
ok kettenis@
|
|
in the chipset tag for establishing interrupts now takes a struct cpu_info *.
The normal pci_intr_establish() macro passes NULL as ci, which indicates that
the primary CPU is to be used.
The PCI controller drivers can then simply pass the ci on to our arm64/armv7
interrupt establish "framework".
Prompted by dlg@
ok kettenis@
|
|
a struct cpu_info *. From a driver point of view the fdt_intr_establish_*
API now also exist same functions with a *_cpu suffix. Internally the
"old" functions now call their *_cpu counterparts, passing NULL as ci.
NULL will be interpreted as primary CPU in the interrupt controller code.
The internal framework for interrupt controllers has been changed so that
the establish methods provided by an interrupt controller function always
takes a struct cpu_info *.
Some drivers, like imxgpio(4) and rkgpio(4), only have a single interrupt
line for multiple pins. On those we simply disallow trying to establish
an interrupt on a non-primary CPU, returning NULL.
Since we do not have MP yet on armv7, all armv7 interrupt controllers do
return NULL if an attempt is made to establish an interrupt on a different
CPU. That said, so far there's no way this can happen. If we ever gain
MP support, this is a reminder that the interrupt controller drivers have
to be adjusted.
Prompted by dlg@
ok kettenis@
|
|
Checked against
* ARM Architecture Reference Manual (agtimer)
* ARM Cortex-A9 MPCore Technical Reference Manual (amptimer)
* OMAP35x Applications Processor Technical Reference Manual (gptimer)
Artturi Alm had independently suggested this in the past.
|
|
ok dlg@ tobhe@
|
|
"new" API.
ok dlg@ tobhe@
|
|
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@
|
|
|
|
functionality is provided by <sys/stdarg.h> using compiler builtins.
Tested in a ports bulk build on amd64 by naddy@
OK naddy@ mpi@
|
|
Tested on a Cubieboard2.
OK patrick@
|
|
OK patrick@
|
|
ok kettenis@
|
|
rnd.c uses nanotime to get access to some bits that change quickly
between events that it can mix into the entropy pool. it doesn't
use nanotime to get a monotonically increasing set or ordered and
accurate timestamps, it just wants something with bits that change.
there's been discussions for years about letting rnd use a clock
that's super fast to read, but not necessarily accurate, but it
wasn't until recently that i figured out it wasn't interested in
time at all, so things like keeping a fast clock coherent between
cpu cores or correct according to ntp is unecessary. this means we
can just let rnd read the cycle counters on cpus and things will
be fine. cpus with cycle counters that vary in their speed and
arent kept consistent between cores may even be desirable in this
context.
so this is the first step in converting rnd.c to reading cycle
counter. it copies the nanotime backend to each arch, and they can
replace it with something MD as a second step later on.
djm@ suggested rnd_messybytes, but we landed on cpu_rnd_messybits.
thanks to visa for his eyes.
ok deraadt@ visa@
deraadt@ says he will help handle any MD fallout that occurs.
|
|
conversion steps). it only contains kernel prototypes for 4 interfaces,
all of which legitimately belong in sys/systm.h, which are already included
by all enqueue_randomness() users.
|
|
|
|
miod explained it was initially a long as it was thought drivers may
need to allocate storage but in practice they don't need more than
32 bits for an attribute.
suggested and reviewed by miod@
|
|
Suggested by John Carmack. miod agrees a rename would make sense and
explained it was initially thought drivers may need to allocate storage
but in practice they don't need more than 32 bits for an attribute.
ok mpi@
|
|
code in line with arm64.
ok deraadt@
|
|
on U-Boot anymore, since we checked if the method is provided, but
now U-Boot provides a simple stub that only returns EFI_UNSUPPORTED.
A proper UEFI would throw EFI_INVALID_PARAMETER if we pass NULL
as first parameter, but U-Boot doesn't. This way we can see if
the method is actually provided and not just a stub.
ok kettenis@
|
|
it anymore.
jsg@
|
|
/dev/fdt.
ok patrick@, visa@
|
|
openbsd,boothowto property under /chosen.
ok patrick@
|
|
|
|
DMA remapping in the same way as arm64. This relies on the dma-ranges
property in the device tree and allows us to get rid of the hack for
the Raspberry Pi in the dwctwo(4) driver.
Note that this does not include the hack in simplebus(4) that we have on
arm64 since firmware that has the dma-ranges is in widespread use now.
ok patrick@
|
|
can't be enabled.
|
|
perfectly happy without it.
ok patrick@
|
|
arrm32_machdep.c.
ok mpi@
|
|
ok kettenis@
|
|
ok kettenis@
|
|
ok jsg kettenis, testing by kmos also
|
|
structure that is used in current mainline Linux device trees.
ok jsg@
|
|
ok jsg@
|
|
|
|
ok jsg@
|
|
ok jsg@
|
|
ok jsg@
|
|
ok jsg@
|
|
Add code to enable the clock which is present in new device trees.
ok jsg@
|
|
ok jsg@
|
|
ok kettenis@ deraadt@
|
|
|
|
property; it contains on offset in the parent's address space instead.
Since the driver needs the address of the CPPI RAM to program the
descriptors, use bus_space_vaddr(9) and pmap_extract(9) to get it.
ok jsg@
|
|
generic pinctrl(4) driver and intc(4) now attaches using the device
tree.
ok jsg@
|
|
ok patrick@
|
|
find a media device path node. Fixes booting OpenBSD on some older U-Boot
versions that are in wide circulation such as 2017.09 and 2017.11.
ok patrick@
|
|
|
|
Do not include <sys/kthread.h> where it is not needed and stop including
<sys/proc.h> in it.
ok visa@, anton@
|
|
in ticks was meant to be in msecs.
Pointed out by and ok patrick@
|
|
seconds and use tsleep_nsec(9).
ok patrick@
|
|
ok patrick@
|