summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2022-11-10Sprinkle some #ifdef SUSPEND to unbreak the tree.Mark Kettenis
2022-11-10bring back r1.673: replace SRP with SMR in the if_idxmap.David Gwynne
when i first wrote if_idxmap i didn't realise (and no one thought to tell me) that index 0 was special and means "no interface", so while here use the 0th slot in the interface map to store the length of the map instead of prepending the map with a length field. if_get() now special cases index 0 and returns NULL directly. this also means the size of the map is now always a power of 2, which is a nicer fit with what the kernel malloc aprovides. the problem with r1.673 that hrvoje popovski found was that attaching a lot of interfaces during autoconf would lock up when growing the map called smr_barrier. the fix in this diff is to (ab)use the usedidx bitmap to store an smr_entry and defer the freeing of the interface pointer map with it. tested by hrvoje popovski tweaks and ok visa@
2022-11-10revert pf_state mtx commit, because it breaks tree.Alexandr Nedvedicky
pfctl does not build OK dlg@
2022-11-10Apparently we receive interrupts for both powerkey press and release, whichPatrick Wildt
isn't quite helpful when it's used to come back from suspend and then the second interrupt initiates powerdown. Ignore press, but handle release. ok kettenis@
2022-11-10Add mbr_get_fstype() and use it to translate MBR dp_typ fieldsKenneth R Westerback
into FS_* values. Similar to what gpt_get_fstype() does. Code is clearer and better positioned for planned enhancements to spoofing. No intentional functional change.
2022-11-10Use local variable for consistencyKlemens Nanni
OK claudio
2022-11-10Add a mutex to pf_state structure. Mutex retain a consistencyAlexandr Nedvedicky
of structure members without using a global state lock. The first member which uses protection by mutex is key[] array. more will follow. OK dlg@
2022-11-10Add suspend/resume support to control the power domain.Mark Kettenis
ok patrick@
2022-11-10typofix; ok dlgKlemens Nanni
2022-11-10Remove hack that uses a timeout to fake interrupts now that qcpdc(4) allowsPatrick Wildt
us to properly establish interrupts. The fixed IPL_BIO should probably be replaced by the highest IPL requested by our children. ok kettenis@
2022-11-10We need to turn a few more things on in the resume path. This makes itMark Kettenis
possible to ifconfig down the interface suspend/resume and ifconfig up the interface again afterwards in most cases. Suspend/resume with the interface up is still busted. ok patrick@, stsp@
2022-11-10Enable qcpdc(4)Patrick Wildt
ok kettenis@
2022-11-10Add qcpdc(4), a driver for the Qualcomm Power Domain controller found onPatrick Wildt
Qualcomm SoCs. This is mostly a shim torwards agintc(4). ok kettenis@
2022-11-10Move the code handling brightness keys into a task, since withMatthieu Herrb
inteldrm(4) it requires a process context. ok kettenis@
2022-11-10vmd(8): import mmio decode and emulation, disabled for now.Dave Voutila
The initial mmio support for vmd adds support for only specific MOV and MOVZX instructions. Plan is to begin iterating in-tree on other missing pieces. All functionality is gated behind an #if for now. Only change to vmm(4) is reordering register #define's in vmmvar.h. ok mlarkin@
2022-11-10Make the power button function as a wakeup button during suspend.Mark Kettenis
ok phessler@, patrick@, tobhe@
2022-11-10iWe must be careful to only disable power domains that are no longer inMark Kettenis
use by a device. So maintainer a counter and only disable the power domain if it drops to zero. ok deraadt@, tobhe@
2022-11-10arm64 can suspend without PSCI support nowMark Kettenis
ok deraadt@, phessler@
2022-11-10Put CPUs in the lowest P-state just before the final suspend step. TheMark Kettenis
firmware probably does this for us on ACPI systems with proper S3 support, but this doesn't happen on systems where we park CPUs in a low-power idle state ourselves. ok deraadt@
2022-11-10Convert amd64 clock and ipi event counters to per-cpuJonathan Matthew
ok kettenis@ jca@ cheloha@
2022-11-10Convert sparc64 clock event counter to per-cpu and increment usingJonathan Matthew
evcount_inc() rather than atomic operations. ok kettenis@ jca@ cheloha@
2022-11-10Add support for per-cpu event counters, to be used for clock and IPIJonathan Matthew
counters where the event being counted occurs across all CPUs in the system. Counter instances can be made per-cpu by calling evcount_percpu() after the counter is attached, and this can occur before or after all system CPUs are attached. Per-cpu counter instances should be incremented using evcount_inc(). ok kettenis@ jca@ cheloha@
2022-11-10Return error number instead of call panic().ASOU Masato
ok mpi@
2022-11-10fix build after 1.298Jonathan Gray
2022-11-09simplify expiration of 'once' rules.Alexandr Nedvedicky
let packet to mark 'once' rule as expired. The rule will be removed by pfctl(8) when rules are updated. OK kn@
2022-11-09Hook up gpiobl(4) to the screen burner instead of wsdisplay(4) brightnessTobias Heider
control. This enables automatic screen blanking with X and wscons(4) once wsfb(4) is fixed. "this is fine for now" kettenis@
2022-11-09Remove kernel lock here since msleep() with PCATCH no longer requires it.Claudio Jeker
OK mpi@
2022-11-09Some limited setsockopt/getsockopt are allowed in pledge "stdio".Theo de Raadt
Also allow IPPROTO_TCP:TCP_NODELAY It is very small kernel code, and will allow some software to drop "inet" requested by djm
2022-11-09revert r1.673: replace SRP with SMR in the if_idxmap.David Gwynne
if the map has to be reallocated during boot, there's an smr_barrier waiting for the old map to become unused. that barrier ends up waiting for cpus that aren't running yet because we haven't finished booting yet, so boot gets stuck. found by hrvoje popovski
2022-11-09Constify simplefb_formats[]; OK patrickKlemens Nanni
2022-11-09Enable qcpwm(4)Patrick Wildt
ok kettenis@ mlarkin@
2022-11-09Add qcpwm(4), a driver for the PWM found on Qualcomm PMICs. This is usedPatrick Wildt
on the Lenovo x13s to control the display backlight brightness. ok kettenis@ mlarkin@
2022-11-09Move input/output configuration into the correct function.Patrick Wildt
2022-11-09Implement wakeup interrupt support. For now this is only implemented forMark Kettenis
aplintc(4); other arm64 interrupt controllers will follow. ok patrick@
2022-11-09Add suspend/resume support to aplns(4).Mark Kettenis
ok dlg@, patrick@
2022-11-09Simplify the overly complex VXLOCK handling in spec_close.Claudio Jeker
The code only needs to know if the vnode is exclusive locked and this can be done on entry of the function. OK mpi@
2022-11-09vmm(4): treat vcpu lists as immutable, reducing complexity.Dave Voutila
Since vmm doesn't support hot-plug vcpus we can reduce complexity by treating the vcpu list per vm as immutable after creation. As a consequence, we can use the vm reference count to protect the lifetime of the vcpus, removing the need for reference counting individual vcpu objects. With an immutable list, we no longer need a rwlock protecting it either. Original diff from dlg@ that I reworked and tested. ok dlg@, mlarkin@
2022-11-09timeout(9): remove TIMEOUT_KCLOCK flagScott Soule Cheloha
I never should have added the TIMEOUT_KCLOCK flag. It is redundant and only serves to complicate the timeout(9) logic. In every place where we check for the flag we can just use timeout.to_kclock. So, remove the flag from <sys/timeout.h> and rewrite all affected logic to use the value of timeout.to_kclock instead. ok kn@
2022-11-09Make aplpmgr(4) work as a reset controller.Mark Kettenis
ok patrick@
2022-11-09Add missin 'e' in comment.Claudio Jeker
OK dlg@
2022-11-09Implement reading/writing pins on qcpmicgpio(4).Patrick Wildt
2022-11-09Recommit r1.669 "Unlock SIOCIFGCLONERS"Klemens Nanni
OK mvs
2022-11-09Push kernel lock from ifioctl() into ifioctl_get()Klemens Nanni
Recommit these two together: - r1.667 "Push kernel lock into ifioctl_get()" locked before the switch() without unlocking in its cases - r1.668 "Push kernel lock inside ifioctl_get()" locked cases individually, as intended I messed up splitting commits, but of course, Hrvoje managed to test a CVS checkout right inbetween those two. OK mpi mvs
2022-11-09replace SRP with SMR in the if_idxmap.David Gwynne
when i first wrote if_idxmap i didn't realise (and no one thought to tell me) that index 0 was special and means "no interface", so while here use the 0th slot in the interface map to store the length of the map instead of prepending the map with a length field. if_get() now special cases index 0 and returns NULL directly. this also means the size of the map is now always a power of 2, which is a nicer fit with what the kernel malloc aprovides. tweaks and ok visa@
2022-11-09regenMartin Pieuchot
2022-11-09gpt_get_fstype() doesn't modify its parameter so make saidKenneth R Westerback
parameter const.
2022-11-09Mark sched_yield(2) as NOLOCK.Martin Pieuchot
All the fields accessed in this syscall are protected by the SCHED_LOCK() so it isn't necessary to wait for another CPU to release the KERNEL_LOCK() before that. ok claudio@
2022-11-09vmm on !MULTIPROCESSOR kernels should still mark vpus with pending intrs.David Gwynne
the #ifdef MULTIPROCESSOR was a little broad. still grateful to anton and stsp for unbreaking the tree though.
2022-11-09translate Fn+(1-10,-,=) keys to F1-F12 on M1 laptops with a touchbarRobert Nagy
ok kettenis@, miod@
2022-11-09regenRobert Nagy