CVSROOT: /cvs Module name: src Changes by: gkoeh...@cvs.openbsd.org 2022/10/21 16:42:36
Modified files: sys/arch/macppc/dev: adb.c pm_direct.c pm_direct.h sys/arch/macppc/include: cpu.h sys/arch/macppc/macppc: machdep.c sys/dev/adb : adb.h akbd.c Log message: hw.power, machdep.lidaction, machdep.pwraction for macppc I can now use the power button to power off my macppcs running OpenBSD. The new sysctls machdep.lidaction and machdep.pwraction act like acpibtn(4), but we are missing code to suspend or hibernate a macppc. Small kernels (bsd.rd) continue to ignore the power button. adb(4) sends an environment interrupt when I unplug my PowerBook's AC or close its lid. Rename PMU_INT_WAKEUP to PMU_INT_ENVIRONMENT like other BSDs and Linux. Handle PMU_ENV_LID_CLOSED as a lid sensor and PMU_ENV_AC_POWER by setting sysctl hw.power. Power buttons can either use PMU_ENV_POWER_BUTTON or go through akbd(4); handle both kinds of power buttons in the same way. Other models of macppc, with different power buttons or lids, might not work yet. The lid sensor looks like, $ sysctl hw.sensors hw.sensors.adb0.indicator0=On (lid open) kettenis@ warned against calling prsignal() from interrupt context, and pointed me to task_add(9).