Index: head/sys/conf/files.i386 =================================================================== --- head/sys/conf/files.i386 (revision 366545) +++ head/sys/conf/files.i386 (revision 366546) @@ -1,257 +1,256 @@ # This file tells config what files go into building a kernel, # files marked standard are always included. # # $FreeBSD$ # # common files stuff between i386 and amd64 include "conf/files.x86" # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and # dependency lines other than the first are silently ignored. # cloudabi32_vdso.o optional compat_cloudabi32 \ dependency "$S/contrib/cloudabi/cloudabi_vdso_i686.S" \ compile-with "${CC} -x assembler-with-cpp -shared -nostdinc -nostdlib -Wl,-T$S/compat/cloudabi/cloudabi_vdso.lds $S/contrib/cloudabi/cloudabi_vdso_i686.S -o ${.TARGET}" \ no-obj no-implicit-rule \ clean "cloudabi32_vdso.o" # cloudabi32_vdso_blob.o optional compat_cloudabi32 \ dependency "cloudabi32_vdso.o" \ compile-with "${OBJCOPY} --input-target binary --output-target elf32-i386-freebsd --binary-architecture i386 cloudabi32_vdso.o ${.TARGET}" \ no-implicit-rule \ clean "cloudabi32_vdso_blob.o" # linux_genassym.o optional compat_linux \ dependency "$S/i386/linux/linux_genassym.c offset.inc" \ compile-with "${CC} ${CFLAGS:N-flto:N-fno-common} -fcommon -c ${.IMPSRC}" \ no-obj no-implicit-rule \ clean "linux_genassym.o" # linux_assym.h optional compat_linux \ dependency "$S/kern/genassym.sh linux_genassym.o" \ compile-with "sh $S/kern/genassym.sh linux_genassym.o > ${.TARGET}" \ no-obj no-implicit-rule before-depend \ clean "linux_assym.h" # linux_locore.o optional compat_linux \ dependency "linux_assym.h $S/i386/linux/linux_locore.asm" \ compile-with "${CC} -x assembler-with-cpp -DLOCORE -shared -s -pipe -I. -I$S ${WERROR} -Wall -fPIC -fno-common -nostdinc -nostdlib -Wl,-T$S/i386/linux/linux_vdso.lds.s -Wl,-soname=linux_vdso.so,--eh-frame-hdr,-warn-common ${.IMPSRC} -o ${.TARGET}" \ no-obj no-implicit-rule \ clean "linux_locore.o" # linux_vdso.so optional compat_linux \ dependency "linux_locore.o" \ compile-with "${OBJCOPY} --input-target binary --output-target elf32-i386-freebsd --binary-architecture i386 linux_locore.o ${.TARGET}" \ no-implicit-rule \ clean "linux_vdso.so" # cddl/contrib/opensolaris/common/atomic/i386/opensolaris_atomic.S optional zfs | dtrace compile-with "${ZFS_S}" cddl/dev/dtrace/i386/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/i386/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" compat/linprocfs/linprocfs.c optional linprocfs compat/linsysfs/linsysfs.c optional linsysfs compat/linux/linux_event.c optional compat_linux compat/linux/linux_emul.c optional compat_linux compat/linux/linux_errno.c optional compat_linux compat/linux/linux_file.c optional compat_linux compat/linux/linux_fork.c optional compat_linux compat/linux/linux_futex.c optional compat_linux compat/linux/linux_getcwd.c optional compat_linux compat/linux/linux_ioctl.c optional compat_linux compat/linux/linux_ipc.c optional compat_linux compat/linux/linux_mib.c optional compat_linux compat/linux/linux_misc.c optional compat_linux compat/linux/linux_mmap.c optional compat_linux compat/linux/linux_signal.c optional compat_linux compat/linux/linux_socket.c optional compat_linux compat/linux/linux_stats.c optional compat_linux compat/linux/linux_sysctl.c optional compat_linux compat/linux/linux_time.c optional compat_linux compat/linux/linux_timer.c optional compat_linux compat/linux/linux_uid16.c optional compat_linux compat/linux/linux_util.c optional compat_linux compat/linux/linux_vdso.c optional compat_linux compat/linux/linux.c optional compat_linux compat/ndis/winx32_wrap.S optional ndisapi pci crypto/aesni/aeskeys_i386.S optional aesni crypto/des/arch/i386/des_enc.S optional netsmb dev/agp/agp_ali.c optional agp dev/agp/agp_amd.c optional agp dev/agp/agp_amd64.c optional agp dev/agp/agp_ati.c optional agp dev/agp/agp_i810.c optional agp dev/agp/agp_intel.c optional agp dev/agp/agp_nvidia.c optional agp dev/agp/agp_sis.c optional agp dev/agp/agp_via.c optional agp dev/ce/ceddk.c optional ce dev/ce/if_ce.c optional ce dev/ce/tau32-ddk.c optional ce \ compile-with "${NORMAL_C} ${NO_WCONSTANT_CONVERSION} ${NO_WMISLEADING_INDENTATION}" dev/cp/cpddk.c optional cp \ compile-with "${NORMAL_C} ${NO_WMISLEADING_INDENTATION}" dev/cp/if_cp.c optional cp dev/glxiic/glxiic.c optional glxiic dev/glxsb/glxsb.c optional glxsb dev/glxsb/glxsb_hash.c optional glxsb dev/hyperv/vmbus/i386/hyperv_machdep.c optional hyperv dev/hyperv/vmbus/i386/vmbus_vector.S optional hyperv dev/le/if_le_isa.c optional le isa dev/nctgpio/nctgpio.c optional nctgpio dev/nfe/if_nfe.c optional nfe pci dev/ntb/if_ntb/if_ntb.c optional if_ntb dev/ntb/ntb_transport.c optional ntb_transport | if_ntb dev/ntb/ntb.c optional ntb | ntb_transport | if_ntb | ntb_hw_amd | ntb_hw_intel | ntb_hw_plx | ntb_hw dev/ntb/ntb_if.m optional ntb | ntb_transport | if_ntb | ntb_hw_amd | ntb_hw_intel | ntb_hw_plx | ntb_hw dev/ntb/ntb_hw/ntb_hw_amd.c optional ntb_hw_amd | ntb_hw dev/ntb/ntb_hw/ntb_hw_intel.c optional ntb_hw_intel | ntb_hw dev/ntb/ntb_hw/ntb_hw_plx.c optional ntb_hw_plx | ntb_hw dev/ntb/test/ntb_tool.c optional ntb_tool dev/nvram/nvram.c optional nvram isa dev/ofw/ofwpci.c optional fdt pci dev/pcf/pcf_isa.c optional pcf dev/random/ivy.c optional rdrand_rng !random_loadable dev/random/nehemiah.c optional padlock_rng !random_loadable dev/sbni/if_sbni.c optional sbni dev/sbni/if_sbni_isa.c optional sbni isa dev/sbni/if_sbni_pci.c optional sbni pci dev/speaker/spkr.c optional speaker dev/superio/superio.c optional superio isa dev/syscons/scvesactl.c optional sc vga vesa dev/syscons/scvgarndr.c optional sc vga dev/tpm/tpm.c optional tpm dev/tpm/tpm_acpi.c optional tpm acpi dev/tpm/tpm_isa.c optional tpm isa dev/uart/uart_cpu_x86.c optional uart dev/viawd/viawd.c optional viawd dev/vmware/vmxnet3/if_vmx.c optional vmx dev/vmware/vmci/vmci.c optional vmci dev/vmware/vmci/vmci_datagram.c optional vmci dev/vmware/vmci/vmci_doorbell.c optional vmci dev/vmware/vmci/vmci_driver.c optional vmci dev/vmware/vmci/vmci_event.c optional vmci dev/vmware/vmci/vmci_hashtable.c optional vmci dev/vmware/vmci/vmci_kernel_if.c optional vmci dev/vmware/vmci/vmci_qpair.c optional vmci dev/vmware/vmci/vmci_queue_pair.c optional vmci dev/vmware/vmci/vmci_resource.c optional vmci dev/vmware/pvscsi/pvscsi.c optional pvscsi dev/acpi_support/acpi_wmi_if.m standard dev/wbwd/wbwd.c optional wbwd i386/acpica/acpi_machdep.c optional acpi acpi_wakecode.o optional acpi \ dependency "$S/i386/acpica/acpi_wakecode.S assym.inc" \ compile-with "${NORMAL_S}" \ no-obj no-implicit-rule before-depend \ clean "acpi_wakecode.o" acpi_wakecode.bin optional acpi \ dependency "acpi_wakecode.o" \ compile-with "${OBJCOPY} -S -O binary acpi_wakecode.o ${.TARGET}" \ no-obj no-implicit-rule before-depend \ clean "acpi_wakecode.bin" acpi_wakecode.h optional acpi \ dependency "acpi_wakecode.bin" \ compile-with "file2c -sx 'static char wakecode[] = {' '};' < acpi_wakecode.bin > ${.TARGET}" \ no-obj no-implicit-rule before-depend \ clean "acpi_wakecode.h" acpi_wakedata.h optional acpi \ dependency "acpi_wakecode.o" \ compile-with '${NM} -n --defined-only acpi_wakecode.o | while read offset dummy what; do echo "#define $${what} 0x$${offset}"; done > ${.TARGET}' \ no-obj no-implicit-rule before-depend \ clean "acpi_wakedata.h" # -i386/bios/apm.c optional apm i386/bios/smapi.c optional smapi i386/bios/smapi_bios.S optional smapi i386/cloudabi32/cloudabi32_sysvec.c optional compat_cloudabi32 #i386/i386/apic_vector.s optional apic i386/i386/bios.c standard i386/i386/bioscall.s standard i386/i386/bpf_jit_machdep.c optional bpf_jitter i386/i386/copyout.c standard i386/i386/db_disasm.c optional ddb i386/i386/db_interface.c optional ddb i386/i386/db_trace.c optional ddb i386/i386/elan-mmcr.c optional cpu_elan | cpu_soekris i386/i386/elf_machdep.c standard i386/i386/exception.s standard i386/i386/gdb_machdep.c optional gdb i386/i386/geode.c optional cpu_geode i386/i386/in_cksum.c optional inet | inet6 i386/i386/initcpu.c standard i386/i386/io.c optional io i386/i386/k6_mem.c optional mem i386/i386/locore.s standard no-obj i386/i386/longrun.c optional cpu_enable_longrun i386/i386/machdep.c standard i386/i386/mem.c optional mem i386/i386/minidump_machdep.c standard i386/i386/minidump_machdep_pae.c standard i386/i386/minidump_machdep_nopae.c standard i386/i386/mp_clock.c optional smp i386/i386/mp_machdep.c optional smp i386/i386/mpboot.s optional smp i386/i386/npx.c standard i386/i386/perfmon.c optional perfmon i386/i386/pmap_base.c standard i386/i386/pmap_nopae.c standard i386/i386/pmap_pae.c standard i386/i386/prof_machdep.c optional profiling-routine i386/i386/ptrace_machdep.c standard i386/i386/sigtramp.s standard i386/i386/support.s standard i386/i386/swtch.s standard i386/i386/sys_machdep.c standard i386/i386/trap.c standard i386/i386/uio_machdep.c standard i386/i386/vm86.c standard i386/i386/vm_machdep.c standard i386/linux/imgact_linux.c optional compat_linux i386/linux/linux_copyout.c optional compat_linux i386/linux/linux_dummy.c optional compat_linux i386/linux/linux_machdep.c optional compat_linux i386/linux/linux_ptrace.c optional compat_linux i386/linux/linux_sysent.c optional compat_linux i386/linux/linux_sysvec.c optional compat_linux i386/pci/pci_cfgreg.c optional pci i386/pci/pci_pir.c optional pci isa/syscons_isa.c optional sc isa/vga_isa.c optional vga kern/kern_clocksource.c standard kern/imgact_aout.c optional compat_aout kern/subr_sfbuf.c standard libkern/divdi3.c standard libkern/ffsll.c standard libkern/flsll.c standard libkern/memcmp.c standard libkern/memset.c standard libkern/moddi3.c standard libkern/qdivrem.c standard libkern/ucmpdi2.c standard libkern/udivdi3.c standard libkern/umoddi3.c standard # # x86 real mode BIOS support, required by dpms/pci/vesa # compat/x86bios/x86bios.c optional x86bios | dpms | pci | vesa # # bvm console # dev/bvm/bvm_console.c optional bvmconsole dev/bvm/bvm_dbg.c optional bvmdebug # Common files where we currently configure the system differently, but perhaps shouldn't # config(8) doesn't have a way to force standard options, so we've been inconsistent # about marking non-optional things 'standard'. x86/acpica/madt.c optional acpi apic x86/cpufreq/smist.c optional cpufreq x86/isa/atpic.c optional atpic x86/isa/elcr.c optional atpic | apic x86/isa/isa.c optional isa x86/isa/isa_dma.c optional isa x86/x86/io_apic.c optional apic x86/x86/local_apic.c optional apic x86/x86/mptable.c optional apic x86/x86/mptable_pci.c optional apic pci x86/x86/msi.c optional apic pci Index: head/sys/dev/syscons/apm/apm_saver.c =================================================================== --- head/sys/dev/syscons/apm/apm_saver.c (revision 366545) +++ head/sys/dev/syscons/apm/apm_saver.c (nonexistent) @@ -1,95 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-3-Clause - * - * Copyright (c) 1999 Nick Sayer (who stole shamelessly from blank_saver) - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer, - * without modification, immediately at the beginning of the file. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include - -extern int apm_display(int newstate); - -extern struct apm_softc apm_softc; - -static int blanked=0; - -static int -apm_saver(video_adapter_t *adp, int blank) -{ - if (!apm_softc.initialized || !apm_softc.active) - return 0; - - if (blank==blanked) - return 0; - - blanked=blank; - - apm_display(!blanked); - - return 0; -} - -static int -apm_init(video_adapter_t *adp) -{ - if (!apm_softc.initialized || !apm_softc.active) - printf("WARNING: apm_saver module requires apm enabled\n"); - return 0; -} - -static int -apm_term(video_adapter_t *adp) -{ - return 0; -} - -static scrn_saver_t apm_module = { - "apm_saver", apm_init, apm_term, apm_saver, NULL, -}; - -SAVER_MODULE(apm_saver, apm_module); -MODULE_DEPEND(apm_saver, apm, 1, 1, 1); Property changes on: head/sys/dev/syscons/apm/apm_saver.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/i386/bios/apm.c =================================================================== --- head/sys/i386/bios/apm.c (revision 366545) +++ head/sys/i386/bios/apm.c (nonexistent) @@ -1,1526 +0,0 @@ -/*- - * APM (Advanced Power Management) BIOS Device Driver - * - * Copyright (c) 1994 UKAI, Fumitoshi. - * Copyright (c) 1994-1995 by HOSOKAWA, Tatsumi - * Copyright (c) 1996 Nate Williams - * Copyright (c) 1997 Poul-Henning Kamp - * - * This software may be used, modified, copied, and distributed, in - * both source and binary form provided that the above copyright and - * these terms are retained. Under no circumstances is the author - * responsible for the proper functioning of this software, nor does - * the author assume any responsibility for damages incurred with its - * use. - * - * Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) - */ - -/*- - * Copyright (c) 2000 Mitsuru IWASAKI - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include - -#include -#include - -/* Used by the apm_saver screen saver module */ -int apm_display(int newstate); -struct apm_softc apm_softc; - -static void apm_resume(void); -static int apm_bioscall(void); -static int apm_check_function_supported(u_int version, u_int func); - -static int apm_pm_func(u_long, void*, ...); - -static u_long apm_version; - -int apm_evindex; - -#define SCFLAG_ONORMAL 0x0000001 -#define SCFLAG_OCTL 0x0000002 -#define SCFLAG_OPEN (SCFLAG_ONORMAL|SCFLAG_OCTL) - -#define APMDEV_NORMAL 0 -#define APMDEV_CTL 1 - -static struct apmhook *hook[NAPM_HOOK]; /* XXX */ - -#define is_enabled(foo) ((foo) ? "enabled" : "disabled") - -/* Map version number to integer (keeps ordering of version numbers) */ -#define INTVERSION(major, minor) ((major)*100 + (minor)) - -static d_open_t apmopen; -static d_close_t apmclose; -static d_write_t apmwrite; -static d_ioctl_t apmioctl; -static d_poll_t apmpoll; - -static struct cdevsw apm_cdevsw = { - .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, - .d_open = apmopen, - .d_close = apmclose, - .d_write = apmwrite, - .d_ioctl = apmioctl, - .d_poll = apmpoll, - .d_name = "apm", -}; - -static int apm_suspend_delay = 1; -static int apm_standby_delay = 1; -static int apm_swab_batt_minutes = 0; -static int apm_debug = 0; - -#define APM_DPRINT(args...) do { \ - if (apm_debug) { \ - printf(args); \ - } \ -} while (0) - -SYSCTL_INT(_machdep, OID_AUTO, apm_suspend_delay, CTLFLAG_RW, &apm_suspend_delay, 1, ""); -SYSCTL_INT(_machdep, OID_AUTO, apm_standby_delay, CTLFLAG_RW, &apm_standby_delay, 1, ""); -SYSCTL_INT(_debug, OID_AUTO, apm_debug, CTLFLAG_RW, &apm_debug, 0, ""); - -SYSCTL_INT(_machdep, OID_AUTO, apm_swab_batt_minutes, CTLFLAG_RWTUN, - &apm_swab_batt_minutes, 0, "Byte swap battery time value."); - -/* - * return 0 if the function successfull, - * return 1 if the function unsuccessfull, - * return -1 if the function unsupported. - */ -static int -apm_bioscall(void) -{ - struct apm_softc *sc = &apm_softc; - int errno = 0; - u_int apm_func = sc->bios.r.eax & 0xff; - - if (!apm_check_function_supported(sc->intversion, apm_func)) { - APM_DPRINT("apm_bioscall: function 0x%x is not supported in v%d.%d\n", - apm_func, sc->majorversion, sc->minorversion); - return (-1); - } - - sc->bios_busy = 1; - if (sc->connectmode == APM_PROT32CONNECT) { - set_bios_selectors(&sc->bios.seg, - BIOSCODE_FLAG | BIOSDATA_FLAG); - errno = bios32(&sc->bios.r, - sc->bios.entry, GSEL(GBIOSCODE32_SEL, SEL_KPL)); - } else { - errno = bios16(&sc->bios, NULL); - } - sc->bios_busy = 0; - return (errno); -} - -/* check whether APM function is supported (1) or not (0). */ -static int -apm_check_function_supported(u_int version, u_int func) -{ - /* except driver version */ - if (func == APM_DRVVERSION) { - return (1); - } - - switch (version) { - case INTVERSION(1, 0): - if (func > APM_GETPMEVENT) { - return (0); /* not supported */ - } - break; - case INTVERSION(1, 1): - if (func > APM_ENGAGEDISENGAGEPM && - func < APM_OEMFUNC) { - return (0); /* not supported */ - } - break; - case INTVERSION(1, 2): - break; - } - - return (1); /* supported */ -} - -/* enable/disable power management */ -static int -apm_enable_disable_pm(int enable) -{ - struct apm_softc *sc = &apm_softc; - - sc->bios.r.eax = (APM_BIOS << 8) | APM_ENABLEDISABLEPM; - - if (sc->intversion >= INTVERSION(1, 1)) - sc->bios.r.ebx = PMDV_ALLDEV; - else - sc->bios.r.ebx = 0xffff; /* APM version 1.0 only */ - sc->bios.r.ecx = enable; - sc->bios.r.edx = 0; - return (apm_bioscall()); -} - -/* register driver version (APM 1.1 or later) */ -static int -apm_driver_version(int version) -{ - struct apm_softc *sc = &apm_softc; - - sc->bios.r.eax = (APM_BIOS << 8) | APM_DRVVERSION; - sc->bios.r.ebx = 0x0; - sc->bios.r.ecx = version; - sc->bios.r.edx = 0; - - if (apm_bioscall() == 0 && sc->bios.r.eax == version) - return (0); - - /* Some old BIOSes don't return the connection version in %ax. */ - if (sc->bios.r.eax == ((APM_BIOS << 8) | APM_DRVVERSION)) - return (0); - - return (1); -} - -/* engage/disengage power management (APM 1.1 or later) */ -static int -apm_engage_disengage_pm(int engage) -{ - struct apm_softc *sc = &apm_softc; - - sc->bios.r.eax = (APM_BIOS << 8) | APM_ENGAGEDISENGAGEPM; - sc->bios.r.ebx = PMDV_ALLDEV; - sc->bios.r.ecx = engage; - sc->bios.r.edx = 0; - return (apm_bioscall()); -} - -/* get PM event */ -static u_int -apm_getevent(void) -{ - struct apm_softc *sc = &apm_softc; - - sc->bios.r.eax = (APM_BIOS << 8) | APM_GETPMEVENT; - - sc->bios.r.ebx = 0; - sc->bios.r.ecx = 0; - sc->bios.r.edx = 0; - if (apm_bioscall()) - return (PMEV_NOEVENT); - return (sc->bios.r.ebx & 0xffff); -} - -/* suspend entire system */ -static int -apm_suspend_system(int state) -{ - struct apm_softc *sc = &apm_softc; - - sc->bios.r.eax = (APM_BIOS << 8) | APM_SETPWSTATE; - sc->bios.r.ebx = PMDV_ALLDEV; - sc->bios.r.ecx = state; - sc->bios.r.edx = 0; - - if (apm_bioscall()) { - printf("Entire system suspend failure: errcode = %d\n", - 0xff & (sc->bios.r.eax >> 8)); - return 1; - } - - return 0; -} - -/* Display control */ -/* - * Experimental implementation: My laptop machine can't handle this function - * If your laptop can control the display via APM, please inform me. - * HOSOKAWA, Tatsumi - */ -int -apm_display(int newstate) -{ - struct apm_softc *sc = &apm_softc; - - sc->bios.r.eax = (APM_BIOS << 8) | APM_SETPWSTATE; - sc->bios.r.ebx = PMDV_DISP0; - sc->bios.r.ecx = newstate ? PMST_APMENABLED:PMST_SUSPEND; - sc->bios.r.edx = 0; - if (apm_bioscall() == 0) { - return 0; - } - - /* If failed, then try to blank all display devices instead. */ - sc->bios.r.eax = (APM_BIOS << 8) | APM_SETPWSTATE; - sc->bios.r.ebx = PMDV_DISPALL; /* all display devices */ - sc->bios.r.ecx = newstate ? PMST_APMENABLED:PMST_SUSPEND; - sc->bios.r.edx = 0; - if (apm_bioscall() == 0) { - return 0; - } - printf("Display off failure: errcode = %d\n", - 0xff & (sc->bios.r.eax >> 8)); - return 1; -} - -/* - * Turn off the entire system. - */ -static void -apm_power_off(void *junk, int howto) -{ - struct apm_softc *sc = &apm_softc; - - /* Not halting powering off, or not active */ - if (!(howto & RB_POWEROFF) || !apm_softc.active) - return; - sc->bios.r.eax = (APM_BIOS << 8) | APM_SETPWSTATE; - sc->bios.r.ebx = PMDV_ALLDEV; - sc->bios.r.ecx = PMST_OFF; - sc->bios.r.edx = 0; - (void) apm_bioscall(); -} - -/* APM Battery low handler */ -static void -apm_battery_low(void) -{ - printf("\007\007 * * * BATTERY IS LOW * * * \007\007"); -} - -/* APM hook manager */ -static struct apmhook * -apm_add_hook(struct apmhook **list, struct apmhook *ah) -{ - struct apmhook *p, *prev; - - APM_DPRINT("Add hook \"%s\"\n", ah->ah_name); - - if (ah == NULL) - panic("illegal apm_hook!"); - prev = NULL; - for (p = *list; p != NULL; prev = p, p = p->ah_next) - if (p->ah_order > ah->ah_order) - break; - - if (prev == NULL) { - ah->ah_next = *list; - *list = ah; - } else { - ah->ah_next = prev->ah_next; - prev->ah_next = ah; - } - return ah; -} - -static void -apm_del_hook(struct apmhook **list, struct apmhook *ah) -{ - struct apmhook *p, *prev; - - prev = NULL; - for (p = *list; p != NULL; prev = p, p = p->ah_next) - if (p == ah) - goto deleteit; - panic("Tried to delete unregistered apm_hook."); - return; -deleteit: - if (prev != NULL) - prev->ah_next = p->ah_next; - else - *list = p->ah_next; -} - -/* APM driver calls some functions automatically */ -static void -apm_execute_hook(struct apmhook *list) -{ - struct apmhook *p; - - for (p = list; p != NULL; p = p->ah_next) { - APM_DPRINT("Execute APM hook \"%s.\"\n", p->ah_name); - if ((*(p->ah_fun))(p->ah_arg)) - printf("Warning: APM hook \"%s\" failed", p->ah_name); - } -} - -/* establish an apm hook */ -struct apmhook * -apm_hook_establish(int apmh, struct apmhook *ah) -{ - if (apmh < 0 || apmh >= NAPM_HOOK) - return NULL; - - return apm_add_hook(&hook[apmh], ah); -} - -/* disestablish an apm hook */ -void -apm_hook_disestablish(int apmh, struct apmhook *ah) -{ - if (apmh < 0 || apmh >= NAPM_HOOK) - return; - - apm_del_hook(&hook[apmh], ah); -} - -static int apm_record_event(struct apm_softc *, u_int); -static void apm_processevent(void); - -static u_int apm_op_inprog = 0; - -static void -apm_do_suspend(void) -{ - struct apm_softc *sc = &apm_softc; - int error; - - if (sc == NULL || sc->initialized == 0) - return; - - apm_op_inprog = 0; - sc->suspends = sc->suspend_countdown = 0; - - EVENTHANDLER_INVOKE(power_suspend); - - /* - * Be sure to hold Giant across DEVICE_SUSPEND/RESUME since - * non-MPSAFE drivers need this. - */ - mtx_lock(&Giant); - error = DEVICE_SUSPEND(root_bus); - if (error) - goto backout; - - apm_execute_hook(hook[APM_HOOK_SUSPEND]); - if (apm_suspend_system(PMST_SUSPEND) == 0) { - sc->suspending = 1; - apm_processevent(); - mtx_unlock(&Giant); - return; - } - - /* Failure, 'resume' the system again */ - apm_execute_hook(hook[APM_HOOK_RESUME]); - DEVICE_RESUME(root_bus); -backout: - mtx_unlock(&Giant); - EVENTHANDLER_INVOKE(power_resume); -} - -static void -apm_do_standby(void) -{ - struct apm_softc *sc = &apm_softc; - - if (sc == NULL || sc->initialized == 0) - return; - - apm_op_inprog = 0; - sc->standbys = sc->standby_countdown = 0; - - /* - * As far as standby, we don't need to execute - * all of suspend hooks. - */ - if (apm_suspend_system(PMST_STANDBY) == 0) - apm_processevent(); - return; -} - -static void -apm_lastreq_notify(void) -{ - struct apm_softc *sc = &apm_softc; - - sc->bios.r.eax = (APM_BIOS << 8) | APM_SETPWSTATE; - sc->bios.r.ebx = PMDV_ALLDEV; - sc->bios.r.ecx = PMST_LASTREQNOTIFY; - sc->bios.r.edx = 0; - apm_bioscall(); -} - -static int -apm_lastreq_rejected(void) -{ - struct apm_softc *sc = &apm_softc; - - if (apm_op_inprog == 0) { - return 1; /* no operation in progress */ - } - - sc->bios.r.eax = (APM_BIOS << 8) | APM_SETPWSTATE; - sc->bios.r.ebx = PMDV_ALLDEV; - sc->bios.r.ecx = PMST_LASTREQREJECT; - sc->bios.r.edx = 0; - - if (apm_bioscall()) { - APM_DPRINT("apm_lastreq_rejected: failed\n"); - return 1; - } - apm_op_inprog = 0; - return 0; -} - -/* - * Public interface to the suspend/resume: - * - * Execute suspend and resume hook before and after sleep, respectively. - * - */ - -void -apm_suspend(int state) -{ - struct apm_softc *sc = &apm_softc; - - if (sc == NULL || sc->initialized == 0) - return; - - switch (state) { - case PMST_SUSPEND: - if (sc->suspends) - return; - sc->suspends++; - sc->suspend_countdown = apm_suspend_delay; - break; - case PMST_STANDBY: - if (sc->standbys) - return; - sc->standbys++; - sc->standby_countdown = apm_standby_delay; - break; - default: - printf("apm_suspend: Unknown Suspend state 0x%x\n", state); - return; - } - - apm_op_inprog++; - apm_lastreq_notify(); -} - -static void -apm_resume(void) -{ - struct apm_softc *sc = &apm_softc; - - if (sc == NULL || sc->initialized == 0 || sc->suspending == 0) - return; - - sc->suspending = 0; - apm_execute_hook(hook[APM_HOOK_RESUME]); - mtx_lock(&Giant); - DEVICE_RESUME(root_bus); - mtx_unlock(&Giant); - EVENTHANDLER_INVOKE(power_resume); -} - -/* get power status per battery */ -static int -apm_get_pwstatus(apm_pwstatus_t app) -{ - struct apm_softc *sc = &apm_softc; - - if (app->ap_device != PMDV_ALLDEV && - (app->ap_device < PMDV_BATT0 || app->ap_device > PMDV_BATT_ALL)) - return 1; - - sc->bios.r.eax = (APM_BIOS << 8) | APM_GETPWSTATUS; - sc->bios.r.ebx = app->ap_device; - sc->bios.r.ecx = 0; - sc->bios.r.edx = 0xffff; /* default to unknown battery time */ - - if (apm_bioscall()) - return 1; - - app->ap_acline = (sc->bios.r.ebx >> 8) & 0xff; - app->ap_batt_stat = sc->bios.r.ebx & 0xff; - app->ap_batt_flag = (sc->bios.r.ecx >> 8) & 0xff; - app->ap_batt_life = sc->bios.r.ecx & 0xff; - sc->bios.r.edx &= 0xffff; - if (apm_swab_batt_minutes) - sc->bios.r.edx = __bswap16(sc->bios.r.edx) | 0x8000; - if (sc->bios.r.edx == 0xffff) /* Time is unknown */ - app->ap_batt_time = -1; - else if (sc->bios.r.edx & 0x8000) /* Time is in minutes */ - app->ap_batt_time = (sc->bios.r.edx & 0x7fff) * 60; - else /* Time is in seconds */ - app->ap_batt_time = sc->bios.r.edx; - - return 0; -} - -/* get APM information */ -static int -apm_get_info(apm_info_t aip) -{ - struct apm_softc *sc = &apm_softc; - struct apm_pwstatus aps; - - bzero(&aps, sizeof(aps)); - aps.ap_device = PMDV_ALLDEV; - if (apm_get_pwstatus(&aps)) - return 1; - - aip->ai_infoversion = 1; - aip->ai_acline = aps.ap_acline; - aip->ai_batt_stat = aps.ap_batt_stat; - aip->ai_batt_life = aps.ap_batt_life; - aip->ai_batt_time = aps.ap_batt_time; - aip->ai_major = (u_int)sc->majorversion; - aip->ai_minor = (u_int)sc->minorversion; - aip->ai_status = (u_int)sc->active; - - sc->bios.r.eax = (APM_BIOS << 8) | APM_GETCAPABILITIES; - sc->bios.r.ebx = 0; - sc->bios.r.ecx = 0; - sc->bios.r.edx = 0; - if (apm_bioscall()) { - aip->ai_batteries = 0xffffffff; /* Unknown */ - aip->ai_capabilities = 0xff00; /* Unknown, with no bits set */ - } else { - aip->ai_batteries = sc->bios.r.ebx & 0xff; - aip->ai_capabilities = sc->bios.r.ecx & 0xff; - } - - bzero(aip->ai_spare, sizeof aip->ai_spare); - - return 0; -} - -/* inform APM BIOS that CPU is idle */ -void -apm_cpu_idle(void) -{ - struct apm_softc *sc = &apm_softc; - - if (sc->active) { - sc->bios.r.eax = (APM_BIOS <<8) | APM_CPUIDLE; - sc->bios.r.edx = sc->bios.r.ecx = sc->bios.r.ebx = 0; - (void) apm_bioscall(); - } - /* - * Some APM implementation halts CPU in BIOS, whenever - * "CPU-idle" function are invoked, but swtch() of - * FreeBSD halts CPU, therefore, CPU is halted twice - * in the sched loop. It makes the interrupt latency - * terribly long and be able to cause a serious problem - * in interrupt processing. We prevent it by removing - * "hlt" operation from swtch() and managed it under - * APM driver. - */ - if (!sc->active || sc->always_halt_cpu) - halt(); /* wait for interrupt */ -} - -/* inform APM BIOS that CPU is busy */ -void -apm_cpu_busy(void) -{ - struct apm_softc *sc = &apm_softc; - - /* - * The APM specification says this is only necessary if your BIOS - * slows down the processor in the idle task, otherwise it's not - * necessary. - */ - if (sc->slow_idle_cpu && sc->active) { - sc->bios.r.eax = (APM_BIOS <<8) | APM_CPUBUSY; - sc->bios.r.edx = sc->bios.r.ecx = sc->bios.r.ebx = 0; - apm_bioscall(); - } -} - -/* - * APM thread loop. - * - * This routine wakes up from time to time to deal with delaying the - * suspend of the system, or other events. - */ -static void -apm_event_thread(void *arg) -{ - struct apm_softc *sc = &apm_softc; - - sc->running = 1; - while (sc->active) { - if (apm_op_inprog) - apm_lastreq_notify(); - if (sc->standbys && sc->standby_countdown-- <= 0) - apm_do_standby(); - if (sc->suspends && sc->suspend_countdown-- <= 0) - apm_do_suspend(); - if (!sc->bios_busy) - apm_processevent(); - mtx_lock(&sc->mtx); - cv_timedwait(&sc->cv, &sc->mtx, 10 * hz / 9); - mtx_unlock(&sc->mtx); - } - sc->running = 0; - kproc_exit(0); -} - -/* enable APM BIOS */ -static void -apm_event_enable(void) -{ - struct apm_softc *sc = &apm_softc; - - APM_DPRINT("called apm_event_enable()\n"); - - if (sc == NULL || sc->initialized == 0) - return; - - /* Start the thread */ - sc->active = 1; - if (kproc_create(apm_event_thread, sc, &sc->event_thread, 0, 0, - "apm worker")) - panic("Cannot create apm worker thread"); - - return; -} - -/* disable APM BIOS */ -static void -apm_event_disable(void) -{ - struct apm_softc *sc = &apm_softc; - - APM_DPRINT("called apm_event_disable()\n"); - - if (sc == NULL || sc->initialized == 0) - return; - - mtx_lock(&sc->mtx); - sc->active = 0; - while (sc->running) { - cv_broadcast(&sc->cv); - msleep(sc->event_thread, &sc->mtx, PWAIT, "apmdie", 0); - } - mtx_unlock(&sc->mtx); - sc->event_thread = NULL; - return; -} - -/* halt CPU in scheduling loop */ -static void -apm_halt_cpu(void) -{ - struct apm_softc *sc = &apm_softc; - - if (sc == NULL || sc->initialized == 0) - return; - - sc->always_halt_cpu = 1; - - return; -} - -/* don't halt CPU in scheduling loop */ -static void -apm_not_halt_cpu(void) -{ - struct apm_softc *sc = &apm_softc; - - if (sc == NULL || sc->initialized == 0) - return; - - sc->always_halt_cpu = 0; - - return; -} - -/* device driver definitions */ - -/* - * Module event - */ - -static int -apm_modevent(struct module *mod, int event, void *junk) -{ - - switch (event) { - case MOD_LOAD: - if (!cold) - return (EPERM); - break; - case MOD_UNLOAD: - if (!cold && power_pm_get_type() == POWER_PM_TYPE_APM) - return (EBUSY); - break; - default: - break; - } - - return (0); -} - -/* - * Create "connection point" - */ -static void -apm_identify(driver_t *driver, device_t parent) -{ - device_t child; - - if (!cold) { - printf("Don't load this driver from userland!!\n"); - return; - } - - if (resource_disabled("apm", 0)) - return; - - child = BUS_ADD_CHILD(parent, 0, "apm", 0); - if (child == NULL) - panic("apm_identify"); -} - -/* - * probe for APM BIOS - */ -static int -apm_probe(device_t dev) -{ -#define APM_KERNBASE KERNBASE - struct vm86frame vmf; - struct apm_softc *sc = &apm_softc; - - device_set_desc(dev, "APM BIOS"); - if (device_get_unit(dev) > 0) { - printf("apm: Only one APM driver supported.\n"); - return ENXIO; - } - - if (power_pm_get_type() != POWER_PM_TYPE_NONE && - power_pm_get_type() != POWER_PM_TYPE_APM) { - printf("apm: Other PM system enabled.\n"); - return ENXIO; - } - - bzero(&vmf, sizeof(struct vm86frame)); /* safety */ - bzero(&apm_softc, sizeof(apm_softc)); - vmf.vmf_ah = APM_BIOS; - vmf.vmf_al = APM_INSTCHECK; - vmf.vmf_bx = 0; - if (vm86_intcall(APM_INT, &vmf)) - return ENXIO; /* APM not found */ - if (vmf.vmf_bx != 0x504d) { - printf("apm: incorrect signature (0x%x)\n", vmf.vmf_bx); - return ENXIO; - } - if ((vmf.vmf_cx & (APM_32BIT_SUPPORT | APM_16BIT_SUPPORT)) == 0) { - printf("apm: protected mode connections are not supported\n"); - return ENXIO; - } - - apm_version = vmf.vmf_ax; - sc->slow_idle_cpu = ((vmf.vmf_cx & APM_CPUIDLE_SLOW) != 0); - sc->disabled = ((vmf.vmf_cx & APM_DISABLED) != 0); - sc->disengaged = ((vmf.vmf_cx & APM_DISENGAGED) != 0); - - vmf.vmf_ah = APM_BIOS; - vmf.vmf_al = APM_DISCONNECT; - vmf.vmf_bx = 0; - vm86_intcall(APM_INT, &vmf); /* disconnect, just in case */ - - if ((vmf.vmf_cx & APM_32BIT_SUPPORT) != 0) { - vmf.vmf_ah = APM_BIOS; - vmf.vmf_al = APM_PROT32CONNECT; - vmf.vmf_bx = 0; - if (vm86_intcall(APM_INT, &vmf)) { - printf("apm: 32-bit connection error.\n"); - return (ENXIO); - } - sc->bios.seg.code32.base = (vmf.vmf_ax << 4) + APM_KERNBASE; - sc->bios.seg.code32.limit = 0xffff; - sc->bios.seg.code16.base = (vmf.vmf_cx << 4) + APM_KERNBASE; - sc->bios.seg.code16.limit = 0xffff; - sc->bios.seg.data.base = (vmf.vmf_dx << 4) + APM_KERNBASE; - sc->bios.seg.data.limit = 0xffff; - sc->bios.entry = vmf.vmf_ebx; - sc->connectmode = APM_PROT32CONNECT; - } else { - /* use 16-bit connection */ - vmf.vmf_ah = APM_BIOS; - vmf.vmf_al = APM_PROT16CONNECT; - vmf.vmf_bx = 0; - if (vm86_intcall(APM_INT, &vmf)) { - printf("apm: 16-bit connection error.\n"); - return (ENXIO); - } - sc->bios.seg.code16.base = (vmf.vmf_ax << 4) + APM_KERNBASE; - sc->bios.seg.code16.limit = 0xffff; - sc->bios.seg.data.base = (vmf.vmf_cx << 4) + APM_KERNBASE; - sc->bios.seg.data.limit = 0xffff; - sc->bios.entry = vmf.vmf_bx; - sc->connectmode = APM_PROT16CONNECT; - } - - return(0); -} - -/* - * return 0 if the user will notice and handle the event, - * return 1 if the kernel driver should do so. - */ -static int -apm_record_event(struct apm_softc *sc, u_int event_type) -{ - struct apm_event_info *evp; - - if ((sc->sc_flags & SCFLAG_OPEN) == 0) - return 1; /* no user waiting */ - if (sc->event_count == APM_NEVENTS) - return 1; /* overflow */ - if (sc->event_filter[event_type] == 0) - return 1; /* not registered */ - evp = &sc->event_list[sc->event_ptr]; - sc->event_count++; - sc->event_ptr++; - sc->event_ptr %= APM_NEVENTS; - evp->type = event_type; - evp->index = ++apm_evindex; - selwakeuppri(&sc->sc_rsel, PZERO); - return (sc->sc_flags & SCFLAG_OCTL) ? 0 : 1; /* user may handle */ -} - -/* Power profile */ -static void -apm_power_profile(struct apm_softc *sc) -{ - int state; - struct apm_info info; - static int apm_acline = 0; - - if (apm_get_info(&info)) - return; - - if (apm_acline != info.ai_acline) { - apm_acline = info.ai_acline; - state = apm_acline ? POWER_PROFILE_PERFORMANCE : POWER_PROFILE_ECONOMY; - power_profile_set_state(state); - } -} - -/* Process APM event */ -static void -apm_processevent(void) -{ - int apm_event; - struct apm_softc *sc = &apm_softc; - -#define OPMEV_DEBUGMESSAGE(symbol) case symbol: \ - APM_DPRINT("Received APM Event: " #symbol "\n"); - - do { - apm_event = apm_getevent(); - switch (apm_event) { - OPMEV_DEBUGMESSAGE(PMEV_STANDBYREQ); - if (apm_op_inprog == 0) { - apm_op_inprog++; - if (apm_record_event(sc, apm_event)) { - apm_suspend(PMST_STANDBY); - } - } - break; - OPMEV_DEBUGMESSAGE(PMEV_USERSTANDBYREQ); - if (apm_op_inprog == 0) { - apm_op_inprog++; - if (apm_record_event(sc, apm_event)) { - apm_suspend(PMST_STANDBY); - } - } - break; - OPMEV_DEBUGMESSAGE(PMEV_SUSPENDREQ); - apm_lastreq_notify(); - if (apm_op_inprog == 0) { - apm_op_inprog++; - if (apm_record_event(sc, apm_event)) { - apm_do_suspend(); - } - } - return; /* XXX skip the rest */ - OPMEV_DEBUGMESSAGE(PMEV_USERSUSPENDREQ); - apm_lastreq_notify(); - if (apm_op_inprog == 0) { - apm_op_inprog++; - if (apm_record_event(sc, apm_event)) { - apm_do_suspend(); - } - } - return; /* XXX skip the rest */ - OPMEV_DEBUGMESSAGE(PMEV_CRITSUSPEND); - apm_do_suspend(); - break; - OPMEV_DEBUGMESSAGE(PMEV_NORMRESUME); - apm_record_event(sc, apm_event); - apm_resume(); - break; - OPMEV_DEBUGMESSAGE(PMEV_CRITRESUME); - apm_record_event(sc, apm_event); - apm_resume(); - break; - OPMEV_DEBUGMESSAGE(PMEV_STANDBYRESUME); - apm_record_event(sc, apm_event); - break; - OPMEV_DEBUGMESSAGE(PMEV_BATTERYLOW); - if (apm_record_event(sc, apm_event)) { - apm_battery_low(); - apm_suspend(PMST_SUSPEND); - } - break; - OPMEV_DEBUGMESSAGE(PMEV_POWERSTATECHANGE); - apm_record_event(sc, apm_event); - apm_power_profile(sc); - break; - OPMEV_DEBUGMESSAGE(PMEV_UPDATETIME); - apm_record_event(sc, apm_event); - inittodr(0); /* adjust time to RTC */ - break; - OPMEV_DEBUGMESSAGE(PMEV_CAPABILITIESCHANGE); - apm_record_event(sc, apm_event); - apm_power_profile(sc); - break; - case PMEV_NOEVENT: - break; - default: - printf("Unknown Original APM Event 0x%x\n", apm_event); - break; - } - } while (apm_event != PMEV_NOEVENT); -} - -static struct timeval suspend_time; -static struct timeval diff_time; - -static int -apm_rtc_suspend(void *arg __unused) -{ - - microtime(&diff_time); - inittodr(0); - microtime(&suspend_time); - timevalsub(&diff_time, &suspend_time); - return (0); -} - -static int -apm_rtc_resume(void *arg __unused) -{ - u_int second, minute, hour; - struct timeval resume_time, tmp_time; - - /* modified for adjkerntz */ - timer_restore(); /* restore the all timers */ - inittodr(0); /* adjust time to RTC */ - microtime(&resume_time); - getmicrotime(&tmp_time); - timevaladd(&tmp_time, &diff_time); - /* Calculate the delta time suspended */ - timevalsub(&resume_time, &suspend_time); - -#ifdef PMTIMER_FIXUP_CALLTODO - /* Fixup the calltodo list with the delta time. */ - adjust_timeout_calltodo(&resume_time); -#endif /* PMTIMER_FIXUP_CALLTODO */ - second = resume_time.tv_sec; - hour = second / 3600; - second %= 3600; - minute = second / 60; - second %= 60; - log(LOG_NOTICE, "wakeup from sleeping state (slept %02d:%02d:%02d)\n", - hour, minute, second); - return (0); -} - -/* - * Attach APM: - * - * Initialize APM driver - */ - -static int -apm_attach(device_t dev) -{ - struct apm_softc *sc = &apm_softc; - int drv_version; - - mtx_init(&sc->mtx, device_get_nameunit(dev), "apm", MTX_DEF); - cv_init(&sc->cv, "cbb cv"); - - if (device_get_flags(dev) & 0x20) - atrtcclock_disable = 1; - - sc->initialized = 0; - - /* Must be externally enabled */ - sc->active = 0; - - /* Always call HLT in idle loop */ - sc->always_halt_cpu = 1; - - getenv_int("debug.apm_debug", &apm_debug); - - /* print bootstrap messages */ - APM_DPRINT("apm: APM BIOS version %04lx\n", apm_version); - APM_DPRINT("apm: Code16 0x%08x, Data 0x%08x\n", - sc->bios.seg.code16.base, sc->bios.seg.data.base); - APM_DPRINT("apm: Code entry 0x%08x, Idling CPU %s, Management %s\n", - sc->bios.entry, is_enabled(sc->slow_idle_cpu), - is_enabled(!sc->disabled)); - APM_DPRINT("apm: CS_limit=0x%x, DS_limit=0x%x\n", - sc->bios.seg.code16.limit, sc->bios.seg.data.limit); - - /* - * In one test, apm bios version was 1.02; an attempt to register - * a 1.04 driver resulted in a 1.00 connection! Registering a - * 1.02 driver resulted in a 1.02 connection. - */ - drv_version = apm_version > 0x102 ? 0x102 : apm_version; - for (; drv_version > 0x100; drv_version--) - if (apm_driver_version(drv_version) == 0) - break; - sc->minorversion = ((drv_version & 0x00f0) >> 4) * 10 + - ((drv_version & 0x000f) >> 0); - sc->majorversion = ((drv_version & 0xf000) >> 12) * 10 + - ((apm_version & 0x0f00) >> 8); - - sc->intversion = INTVERSION(sc->majorversion, sc->minorversion); - - if (sc->intversion >= INTVERSION(1, 1)) - APM_DPRINT("apm: Engaged control %s\n", is_enabled(!sc->disengaged)); - device_printf(dev, "found APM BIOS v%ld.%ld, connected at v%d.%d\n", - ((apm_version & 0xf000) >> 12) * 10 + ((apm_version & 0x0f00) >> 8), - ((apm_version & 0x00f0) >> 4) * 10 + ((apm_version & 0x000f) >> 0), - sc->majorversion, sc->minorversion); - - APM_DPRINT("apm: Slow Idling CPU %s\n", is_enabled(sc->slow_idle_cpu)); - /* enable power management */ - if (sc->disabled) { - if (apm_enable_disable_pm(1)) { - APM_DPRINT("apm: *Warning* enable function failed! [%x]\n", - (sc->bios.r.eax >> 8) & 0xff); - } - } - - /* engage power managment (APM 1.1 or later) */ - if (sc->intversion >= INTVERSION(1, 1) && sc->disengaged) { - if (apm_engage_disengage_pm(1)) { - APM_DPRINT("apm: *Warning* engage function failed err=[%x]", - (sc->bios.r.eax >> 8) & 0xff); - APM_DPRINT(" (Docked or using external power?).\n"); - } - } - - /* Power the system off using APM */ - EVENTHANDLER_REGISTER(shutdown_final, apm_power_off, NULL, - SHUTDOWN_PRI_LAST); - - /* Register APM again to pass the correct argument of pm_func. */ - power_pm_register(POWER_PM_TYPE_APM, apm_pm_func, sc); - - sc->initialized = 1; - sc->suspending = 0; - sc->running = 0; - - make_dev(&apm_cdevsw, APMDEV_NORMAL, - UID_ROOT, GID_OPERATOR, 0664, "apm"); - make_dev(&apm_cdevsw, APMDEV_CTL, - UID_ROOT, GID_OPERATOR, 0660, "apmctl"); - - sc->sc_suspend.ah_fun = apm_rtc_suspend; - sc->sc_suspend.ah_arg = sc; - apm_hook_establish(APM_HOOK_SUSPEND, &sc->sc_suspend); - - sc->sc_resume.ah_fun = apm_rtc_resume; - sc->sc_resume.ah_arg = sc; - apm_hook_establish(APM_HOOK_RESUME, &sc->sc_resume); - - gone_in_dev(dev, 13, "APM support has been removed."); - - return 0; -} - -static int -apmopen(struct cdev *dev, int flag, int fmt, struct thread *td) -{ - struct apm_softc *sc = &apm_softc; - - if (sc == NULL || sc->initialized == 0) - return (ENXIO); - - switch (dev2unit(dev)) { - case APMDEV_CTL: - if (!(flag & FWRITE)) - return EINVAL; - if (sc->sc_flags & SCFLAG_OCTL) - return EBUSY; - sc->sc_flags |= SCFLAG_OCTL; - bzero(sc->event_filter, sizeof sc->event_filter); - break; - case APMDEV_NORMAL: - sc->sc_flags |= SCFLAG_ONORMAL; - break; - } - return 0; -} - -static int -apmclose(struct cdev *dev, int flag, int fmt, struct thread *td) -{ - struct apm_softc *sc = &apm_softc; - - switch (dev2unit(dev)) { - case APMDEV_CTL: - apm_lastreq_rejected(); - sc->sc_flags &= ~SCFLAG_OCTL; - bzero(sc->event_filter, sizeof sc->event_filter); - break; - case APMDEV_NORMAL: - sc->sc_flags &= ~SCFLAG_ONORMAL; - break; - } - if ((sc->sc_flags & SCFLAG_OPEN) == 0) { - sc->event_count = 0; - sc->event_ptr = 0; - } - return 0; -} - -static int -apmioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td) -{ - struct apm_softc *sc = &apm_softc; - struct apm_bios_arg *args; - int error = 0; - int ret; - int newstate; - - if (sc == NULL || sc->initialized == 0) - return (ENXIO); - - APM_DPRINT("APM ioctl: cmd = 0x%lx\n", cmd); - switch (cmd) { - case APMIO_SUSPEND: - if (!(flag & FWRITE)) - return (EPERM); - if (sc->active) - apm_suspend(PMST_SUSPEND); - else - error = EINVAL; - break; - - case APMIO_STANDBY: - if (!(flag & FWRITE)) - return (EPERM); - if (sc->active) - apm_suspend(PMST_STANDBY); - else - error = EINVAL; - break; - - case APMIO_GETINFO_OLD: - { - struct apm_info info; - apm_info_old_t aiop; - - if (apm_get_info(&info)) - error = ENXIO; - aiop = (apm_info_old_t)addr; - aiop->ai_major = info.ai_major; - aiop->ai_minor = info.ai_minor; - aiop->ai_acline = info.ai_acline; - aiop->ai_batt_stat = info.ai_batt_stat; - aiop->ai_batt_life = info.ai_batt_life; - aiop->ai_status = info.ai_status; - } - break; - case APMIO_GETINFO: - if (apm_get_info((apm_info_t)addr)) - error = ENXIO; - break; - case APMIO_GETPWSTATUS: - if (apm_get_pwstatus((apm_pwstatus_t)addr)) - error = ENXIO; - break; - case APMIO_ENABLE: - if (!(flag & FWRITE)) - return (EPERM); - apm_event_enable(); - break; - case APMIO_DISABLE: - if (!(flag & FWRITE)) - return (EPERM); - apm_event_disable(); - break; - case APMIO_HALTCPU: - if (!(flag & FWRITE)) - return (EPERM); - apm_halt_cpu(); - break; - case APMIO_NOTHALTCPU: - if (!(flag & FWRITE)) - return (EPERM); - apm_not_halt_cpu(); - break; - case APMIO_DISPLAY: - if (!(flag & FWRITE)) - return (EPERM); - newstate = *(int *)addr; - if (apm_display(newstate)) - error = ENXIO; - break; - case APMIO_BIOS: - if (!(flag & FWRITE)) - return (EPERM); - /* XXX compatibility with the old interface */ - args = (struct apm_bios_arg *)addr; - sc->bios.r.eax = args->eax; - sc->bios.r.ebx = args->ebx; - sc->bios.r.ecx = args->ecx; - sc->bios.r.edx = args->edx; - sc->bios.r.esi = args->esi; - sc->bios.r.edi = args->edi; - if ((ret = apm_bioscall())) { - /* - * Return code 1 means bios call was unsuccessful. - * Error code is stored in %ah. - * Return code -1 means bios call was unsupported - * in the APM BIOS version. - */ - if (ret == -1) { - error = EINVAL; - } - } else { - /* - * Return code 0 means bios call was successful. - * We need only %al and can discard %ah. - */ - sc->bios.r.eax &= 0xff; - } - args->eax = sc->bios.r.eax; - args->ebx = sc->bios.r.ebx; - args->ecx = sc->bios.r.ecx; - args->edx = sc->bios.r.edx; - args->esi = sc->bios.r.esi; - args->edi = sc->bios.r.edi; - break; - default: - error = EINVAL; - break; - } - - /* for /dev/apmctl */ - if (dev2unit(dev) == APMDEV_CTL) { - struct apm_event_info *evp; - int i; - - error = 0; - switch (cmd) { - case APMIO_NEXTEVENT: - if (!sc->event_count) { - error = EAGAIN; - } else { - evp = (struct apm_event_info *)addr; - i = sc->event_ptr + APM_NEVENTS - sc->event_count; - i %= APM_NEVENTS; - *evp = sc->event_list[i]; - sc->event_count--; - } - break; - case APMIO_REJECTLASTREQ: - if (apm_lastreq_rejected()) { - error = EINVAL; - } - break; - default: - error = EINVAL; - break; - } - } - - return error; -} - -static int -apmwrite(struct cdev *dev, struct uio *uio, int ioflag) -{ - struct apm_softc *sc = &apm_softc; - u_int event_type; - int error; - u_char enabled; - - if (dev2unit(dev) != APMDEV_CTL) - return(ENODEV); - if (uio->uio_resid != sizeof(u_int)) - return(E2BIG); - - if ((error = uiomove((caddr_t)&event_type, sizeof(u_int), uio))) - return(error); - - if (event_type >= APM_NPMEV) - return(EINVAL); - - if (sc->event_filter[event_type] == 0) { - enabled = 1; - } else { - enabled = 0; - } - sc->event_filter[event_type] = enabled; - APM_DPRINT("apmwrite: event 0x%x %s\n", event_type, is_enabled(enabled)); - - return uio->uio_resid; -} - -static int -apmpoll(struct cdev *dev, int events, struct thread *td) -{ - struct apm_softc *sc = &apm_softc; - int revents = 0; - - if (events & (POLLIN | POLLRDNORM)) { - if (sc->event_count) { - revents |= events & (POLLIN | POLLRDNORM); - } else { - selrecord(td, &sc->sc_rsel); - } - } - - return (revents); -} - -static device_method_t apm_methods[] = { - /* Device interface */ - DEVMETHOD(device_identify, apm_identify), - DEVMETHOD(device_probe, apm_probe), - DEVMETHOD(device_attach, apm_attach), - { 0, 0 } -}; - -static driver_t apm_driver = { - "apm", - apm_methods, - 1, /* no softc (XXX) */ -}; - -static devclass_t apm_devclass; - -DRIVER_MODULE(apm, legacy, apm_driver, apm_devclass, apm_modevent, 0); -MODULE_VERSION(apm, 1); - -static int -apm_pm_func(u_long cmd, void *arg, ...) -{ - int state, apm_state; - int error; - va_list ap; - - error = 0; - switch (cmd) { - case POWER_CMD_SUSPEND: - va_start(ap, arg); - state = va_arg(ap, int); - va_end(ap); - - switch (state) { - case POWER_SLEEP_STATE_STANDBY: - apm_state = PMST_STANDBY; - break; - case POWER_SLEEP_STATE_SUSPEND: - case POWER_SLEEP_STATE_HIBERNATE: - apm_state = PMST_SUSPEND; - break; - default: - error = EINVAL; - goto out; - } - - apm_suspend(apm_state); - break; - - default: - error = EINVAL; - goto out; - } - -out: - return (error); -} - -static void -apm_pm_register(void *arg) -{ - - if (!resource_disabled("apm", 0)) - power_pm_register(POWER_PM_TYPE_APM, apm_pm_func, NULL); -} - -SYSINIT(power, SI_SUB_KLD, SI_ORDER_ANY, apm_pm_register, NULL); Property changes on: head/sys/i386/bios/apm.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/i386/bios/apm.h =================================================================== --- head/sys/i386/bios/apm.h (revision 366545) +++ head/sys/i386/bios/apm.h (nonexistent) @@ -1,52 +0,0 @@ -/*- - * APM (Advanced Power Management) BIOS Device Driver - * - * Copyright (c) 1994 UKAI, Fumitoshi. - * Copyright (c) 1994-1995 by HOSOKAWA, Tatsumi - * Copyright (c) 1996 Nate Williams - * Copyright (c) 1997 Poul-Henning Kamp - * - * This software may be used, modified, copied, and distributed, in - * both source and binary form provided that the above copyright and - * these terms are retained. Under no circumstances is the author - * responsible for the proper functioning of this software, nor does - * the author assume any responsibility for damages incurred with its - * use. - * - * Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) - * - * $FreeBSD$ - */ - -#ifndef __APM_H__ -#define __APM_H__ - -#define APM_NEVENTS 16 -#define APM_NPMEV 13 -#define APM_UNKNOWN 0xff - -/* static data */ -struct apm_softc { - struct mtx mtx; - struct cv cv; - struct proc *event_thread; - int initialized, active, running, bios_busy; - int always_halt_cpu, slow_idle_cpu; - int disabled, disengaged; - int suspending; - int standby_countdown, suspend_countdown; - u_int minorversion, majorversion; - u_int intversion, connectmode; - u_int standbys, suspends; - struct bios_args bios; - struct apmhook sc_suspend; - struct apmhook sc_resume; - struct selinfo sc_rsel; - int sc_flags; - int event_count; - int event_ptr; - struct apm_event_info event_list[APM_NEVENTS]; - u_char event_filter[APM_NPMEV]; -}; - -#endif /* !__APM_H__ */ Property changes on: head/sys/i386/bios/apm.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/i386/conf/GENERIC =================================================================== --- head/sys/i386/conf/GENERIC (revision 366545) +++ head/sys/i386/conf/GENERIC (revision 366546) @@ -1,352 +1,349 @@ # # GENERIC -- Generic kernel configuration file for FreeBSD/i386 # # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # # https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the # FreeBSD World Wide Web server (https://www.FreeBSD.org/) for the # latest information. # # An exhaustive list of options and more detailed explanations of the # device lines is also present in the ../../conf/NOTES and NOTES files. # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # # $FreeBSD$ cpu I486_CPU cpu I586_CPU cpu I686_CPU ident GENERIC makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 options TCP_HHOOK # hhook(9) framework for TCP options TCP_OFFLOAD # TCP offload options SCTP_SUPPORT # Allow kldload of SCTP options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists options UFS_DIRHASH # Improve performance on big directories options UFS_GJOURNAL # Enable gjournal-based UFS journaling options QUOTA # Enable disk quotas for UFS options MD_ROOT # MD is a potential root device options NFSCL # Network Filesystem Client options NFSD # Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework options TMPFS # Efficient memory filesystem options GEOM_RAID # Soft RAID functionality. options GEOM_LABEL # Provides labelization options COMPAT_FREEBSD4 # Compatible with FreeBSD4 options COMPAT_FREEBSD5 # Compatible with FreeBSD5 options COMPAT_FREEBSD6 # Compatible with FreeBSD6 options COMPAT_FREEBSD7 # Compatible with FreeBSD7 options COMPAT_FREEBSD9 # Compatible with FreeBSD9 options COMPAT_FREEBSD10 # Compatible with FreeBSD10 options COMPAT_FREEBSD11 # Compatible with FreeBSD11 options COMPAT_FREEBSD12 # Compatible with FreeBSD12 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. options KBD_INSTALL_CDEV # install a CDEV entry in /dev options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing options CAPABILITY_MODE # Capsicum capability mode options CAPABILITIES # Capsicum capabilities options MAC # TrustedBSD MAC Framework options KDTRACE_HOOKS # Kernel DTrace hooks options DDB_CTF # Kernel ELF linker loads CTF data options INCLUDE_CONFIG_FILE # Include this file in kernel options RACCT # Resource accounting framework options RACCT_DEFAULT_TO_DISABLED # Set kern.racct.enable=0 by default options RCTL # Resource limits # Debugging support. Always need this: options KDB # Enable kernel debugger support. options KDB_TRACE # Print a stack trace for a panic. # For full debugger support use (turn off in stable branch): options DDB # Support DDB. options GDB # Support remote GDB. options DEADLKRES # Enable the deadlock resolver options INVARIANTS # Enable calls of extra sanity checking options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS options WITNESS # Enable checks to detect deadlocks and cycles options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default # Kernel dump features. options EKCD # Support for encrypted kernel dumps options GZIO # gzip-compressed kernel and user dumps options ZSTDIO # zstd-compressed kernel and user dumps options DEBUGNET # debugnet networking options NETDUMP # netdump(4) client support options NETGDB # netgdb(4) client support # To make an SMP kernel, the next two lines are needed options SMP # Symmetric MultiProcessor Kernel device apic # I/O APIC options EARLY_AP_STARTUP # CPU frequency control device cpufreq # Bus support. device acpi device pci options PCI_HP # PCI-Express native HotPlug options PCI_IOV # PCI SR-IOV support # Floppy drives device fdc # ATA controllers device ahci # AHCI-compatible SATA controllers device ata # Legacy ATA/SATA controllers device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA # SCSI Controllers device ahc # AHA2940 and onboard AIC7xxx devices device esp # AMD Am53C974 (Tekram DC-390(T)) device hptiop # Highpoint RocketRaid 3xxx series device isp # Qlogic family #device ispfw # Firmware for QLogic HBAs- normally a module device mpt # LSI-Logic MPT-Fusion device mps # LSI-Logic MPT-Fusion 2 device mpr # LSI-Logic MPT-Fusion 3 device sym # NCR/Symbios Logic device isci # Intel C600 SAS controller device pvscsi # VMware PVSCSI # ATA/SCSI peripherals device scbus # SCSI bus (required for ATA/SCSI) device ch # SCSI media changers device da # Direct Access (disks) device sa # Sequential Access (tape etc) device cd # CD device pass # Passthrough device (direct ATA/SCSI access) device ses # Enclosure Services (SES and SAF-TE) #device ctl # CAM Target Layer # RAID controllers interfaced to the SCSI subsystem device amr # AMI MegaRAID device arcmsr # Areca SATA II RAID device ciss # Compaq Smart RAID 5* device iir # Intel Integrated RAID device ips # IBM (Adaptec) ServeRAID device mly # Mylex AcceleRAID/eXtremeRAID device twa # 3ware 9000 series PATA/SATA RAID device tws # LSI 3ware 9750 SATA+SAS 6Gb/s RAID controller # RAID controllers device aac # Adaptec FSA RAID device aacp # SCSI passthrough for aac (requires CAM) device aacraid # Adaptec by PMC RAID device ida # Compaq Smart RAID device mfi # LSI MegaRAID SAS device mlx # Mylex DAC960 family device mrsas # LSI/Avago MegaRAID SAS/SATA, 6Gb/s and 12Gb/s device pmspcv # PMC-Sierra SAS/SATA Controller driver device pst # Promise Supertrak SX6000 device twe # 3ware ATA RAID # NVM Express (NVMe) support device nvme # base NVMe driver device nvd # expose NVMe namespace as disks, depends on nvme # atkbdc0 controls both the keyboard and the PS/2 mouse device atkbdc # AT keyboard controller device atkbd # AT keyboard device psm # PS/2 mouse device kbdmux # keyboard multiplexer device vga # VGA video card driver options VESA # Add support for VESA BIOS Extensions (VBE) device splash # Splash screen and screen saver support # syscons is the default console driver, resembling an SCO console device sc options SC_PIXEL_MODE # add support for the raster text mode # vt is the new video console driver device vt device vt_vga device agp # support several AGP chipsets -# Power management support (see NOTES for more options) -#device apm - # PCCARD (PCMCIA) support # PCMCIA and cardbus bridge support device cbb # cardbus (yenta) bridge device pccard # PC Card (16-bit) bus device cardbus # CardBus (32-bit) bus # Serial (COM) ports device uart # Generic UART driver # Parallel port device ppc device ppbus # Parallel port bus (required) device lpt # Printer device ppi # Parallel port interface device #device vpo # Requires scbus and da device puc # Multi I/O cards and multi-channel UARTs # PCI/PCI-X/PCIe Ethernet NICs that use iflib infrastructure device iflib device em # Intel PRO/1000 Gigabit Ethernet Family device vmx # VMware VMXNET3 Ethernet # PCI Ethernet NICs. device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE device le # AMD Am7900 LANCE and Am79C9xx PCnet device ti # Alteon Networks Tigon I/II gigabit Ethernet # PCI Ethernet NICs that use the common MII bus controller code. # NOTE: Be sure to keep the 'device miibus' line in order to use these NICs! device miibus # MII bus support device ae # Attansic/Atheros L2 FastEthernet device age # Attansic/Atheros L1 Gigabit Ethernet device alc # Atheros AR8131/AR8132 Ethernet device ale # Atheros AR8121/AR8113/AR8114 Ethernet device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet device bfe # Broadcom BCM440x 10/100 Ethernet device bge # Broadcom BCM570xx Gigabit Ethernet device cas # Sun Cassini/Cassini+ and NS DP83065 Saturn device dc # DEC/Intel 21143 and various workalikes device et # Agere ET1310 10/100/Gigabit Ethernet device fxp # Intel EtherExpress PRO/100B (82557, 82558) device gem # Sun GEM/Sun ERI/Apple GMAC device hme # Sun HME (Happy Meal Ethernet) device jme # JMicron JMC250 Gigabit/JMC260 Fast Ethernet device lge # Level 1 LXT1001 gigabit Ethernet device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet device nfe # nVidia nForce MCP on-board Ethernet device nge # NatSemi DP83820 gigabit Ethernet device re # RealTek 8139C+/8169/8169S/8110S device rl # RealTek 8129/8139 device sge # Silicon Integrated Systems SiS190/191 device sis # Silicon Integrated Systems SiS 900/SiS 7016 device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet device ste # Sundance ST201 (D-Link DFE-550TX) device stge # Sundance/Tamarack TC9021 gigabit Ethernet device vge # VIA VT612x gigabit Ethernet device vr # VIA Rhine, Rhine II device vte # DM&P Vortex86 RDC R6040 Fast Ethernet device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # Wireless NIC cards device wlan # 802.11 support options IEEE80211_DEBUG # enable debug msgs options IEEE80211_SUPPORT_MESH # enable 802.11s draft support device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support device wlan_amrr # AMRR transmit rate control algorithm device an # Aironet 4500/4800 802.11 wireless NICs. device ath # Atheros NICs device ath_pci # Atheros pci/cardbus glue device ath_hal # pci/cardbus chip support options AH_AR5416_INTERRUPT_MITIGATION # AR5416 interrupt mitigation options ATH_ENABLE_11N # Enable 802.11n support for AR5416 and later device ath_rate_sample # SampleRate tx rate control for ath #device bwi # Broadcom BCM430x/BCM431x wireless NICs. #device bwn # Broadcom BCM43xx wireless NICs. device ipw # Intel 2100 wireless NICs. device iwi # Intel 2200BG/2225BG/2915ABG wireless NICs. device iwn # Intel 4965/1000/5000/6000 wireless NICs. device malo # Marvell Libertas wireless NICs. device mwl # Marvell 88W8363 802.11n wireless NICs. device ral # Ralink Technology RT2500 wireless NICs. device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs. device wpi # Intel 3945ABG wireless NICs. # Pseudo devices. device crypto # core crypto support device loop # Network loopback device padlock_rng # VIA Padlock RNG device rdrand_rng # Intel Bull Mountain RNG device ether # Ethernet support device vlan # 802.1Q VLAN support device tuntap # Packet tunnel. device md # Memory "disks" device gif # IPv6 and IPv4 tunneling device firmware # firmware assist module # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! # Note that 'bpf' is required for DHCP. device bpf # Berkeley packet filter # USB support options USB_DEBUG # enable debug msgs device uhci # UHCI PCI->USB interface device ohci # OHCI PCI->USB interface device ehci # EHCI PCI->USB interface (USB 2.0) device xhci # XHCI PCI->USB interface (USB 3.0) device usb # USB Bus (required) device ukbd # Keyboard device umass # Disks/Mass storage - Requires scbus and da # Sound support device sound # Generic sound driver (required) device snd_cmi # CMedia CMI8338/CMI8738 device snd_csa # Crystal Semiconductor CS461x/428x device snd_emu10kx # Creative SoundBlaster Live! and Audigy device snd_es137x # Ensoniq AudioPCI ES137x device snd_hda # Intel High Definition Audio device snd_ich # Intel, NVidia and other ICH AC'97 Audio device snd_via8233 # VIA VT8233x Audio # MMC/SD device mmc # MMC/SD bus device mmcsd # MMC/SD memory card device sdhci # Generic PCI SD Host Controller # VirtIO support device virtio # Generic VirtIO bus (required) device virtio_pci # VirtIO PCI device device vtnet # VirtIO Ethernet device device virtio_blk # VirtIO Block device device virtio_scsi # VirtIO SCSI device device virtio_balloon # VirtIO Memory Balloon device # HyperV drivers and enchancement support device hyperv # HyperV drivers # Xen HVM Guest Optimizations # NOTE: XENHVM depends on xenpci. They must be added or removed together. options XENHVM # Xen HVM kernel infrastructure device xenpci # Xen HVM Hypervisor services driver # evdev interface options EVDEV_SUPPORT # evdev support in legacy drivers device evdev # input event device support device uinput # install /dev/uinput cdev Index: head/sys/i386/conf/NOTES =================================================================== --- head/sys/i386/conf/NOTES (revision 366545) +++ head/sys/i386/conf/NOTES (revision 366546) @@ -1,927 +1,920 @@ # # NOTES -- Lines that can be cut/pasted into kernel and hints configs. # # This file contains machine dependent kernel configuration notes. For # machine independent notes, look in /sys/conf/NOTES. # # $FreeBSD$ # # # We want LINT to cover profiling as well. profile 2 # # Enable the kernel DTrace hooks which are required to load the DTrace # kernel modules. # options KDTRACE_HOOKS # DTrace core # NOTE: introduces CDDL-licensed components into the kernel #device dtrace # DTrace modules #device dtrace_profile #device dtrace_sdt #device dtrace_fbt #device dtrace_systrace #device dtrace_prototype #device dtnfscl #device dtmalloc # Alternatively include all the DTrace modules #device dtraceall ##################################################################### # SMP OPTIONS: # # The apic device enables the use of the I/O APIC for interrupt delivery. # The apic device can be used in both UP and SMP kernels, but is required # for SMP kernels. Thus, the apic device is not strictly an SMP option, # but it is a prerequisite for SMP. # # Notes: # # HTT CPUs should only be used if they are enabled in the BIOS. For # the ACPI case, ACPI only correctly tells us about any HTT CPUs if # they are enabled. However, most HTT systems do not list HTT CPUs # in the MP Table if they are enabled, thus we guess at the HTT CPUs # for the MP Table case. However, we shouldn't try to guess and use # these CPUs if HTT is disabled. Thus, HTT guessing is only enabled # for the MP Table if the user explicitly asks for it via the # MPTABLE_FORCE_HTT option. Do NOT use this option if you have HTT # disabled in your BIOS. # # IPI_PREEMPTION instructs the kernel to preempt threads running on other # CPUS if needed. Relies on the PREEMPTION option # Mandatory: device apic # I/O apic # Optional: options MPTABLE_FORCE_HTT # Enable HTT CPUs with the MP Table options IPI_PREEMPTION # # Watchdog routines. # options MP_WATCHDOG # Debugging options. # options COUNT_XINVLTLB_HITS # Counters for TLB events options COUNT_IPIS # Per-CPU IPI interrupt counters ##################################################################### # CPU OPTIONS # # You must specify at least one CPU (the one you intend to run on); # deleting the specification for CPUs you don't need to use may make # parts of the system run faster. # cpu I486_CPU cpu I586_CPU # aka Pentium(tm) cpu I686_CPU # aka Pentium Pro(tm) # # Options for CPU features. # # CPU_ATHLON_SSE_HACK tries to enable SSE instructions when the BIOS has # forgotten to enable them. # # CPU_BLUELIGHTNING_3X enables triple-clock mode on IBM Blue Lightning # CPU if CPU supports it. The default is double-clock mode on # BlueLightning CPU box. # # CPU_BLUELIGHTNING_FPU_OP_CACHE enables FPU operand cache on IBM # BlueLightning CPU. It works only with Cyrix FPU, and this option # should not be used with Intel FPU. # # CPU_BTB_EN enables branch target buffer on Cyrix 5x86 (NOTE 1). # # CPU_CYRIX_NO_LOCK enables weak locking for the entire address space # of Cyrix 6x86 and 6x86MX CPUs by setting the NO_LOCK bit of CCR1. # Otherwise, the NO_LOCK bit of CCR1 is cleared. (NOTE 3) # # CPU_DIRECT_MAPPED_CACHE sets L1 cache of Cyrix 486DLC CPU in direct # mapped mode. Default is 2-way set associative mode. # # CPU_DISABLE_5X86_LSSER disables load store serialize (i.e., enables # reorder). This option should not be used if you use memory mapped # I/O device(s). # # CPU_ELAN enables support for AMDs ElanSC520 CPU. # CPU_ELAN_PPS enables precision timestamp code. # CPU_ELAN_XTAL sets the clock crystal frequency in Hz. # # CPU_ENABLE_LONGRUN enables support for Transmeta Crusoe LongRun # technology which allows to restrict power consumption of the CPU by # using group of hw.crusoe.* sysctls. # # CPU_FASTER_5X86_FPU enables faster FPU exception handler. # # CPU_GEODE is for the SC1100 Geode embedded processor. This option # is necessary because the i8254 timecounter is toast. # # CPU_I486_ON_386 enables CPU cache on i486 based CPU upgrade products # for i386 machines. # # CPU_IORT defines I/O clock delay time (NOTE 1). Default values of # I/O clock delay time on Cyrix 5x86 and 6x86 are 0 and 7,respectively # (no clock delay). # # CPU_L2_LATENCY specifies the L2 cache latency value. This option is used # only when CPU_PPRO2CELERON is defined and Mendocino Celeron is detected. # The default value is 5. # # CPU_LOOP_EN prevents flushing the prefetch buffer if the destination # of a jump is already present in the prefetch buffer on Cyrix 5x86(NOTE # 1). # # CPU_PPRO2CELERON enables L2 cache of Mendocino Celeron CPUs. This option # is useful when you use Socket 8 to Socket 370 converter, because most Pentium # Pro BIOSs do not enable L2 cache of Mendocino Celeron CPUs. # # CPU_RSTK_EN enables return stack on Cyrix 5x86 (NOTE 1). # # CPU_SOEKRIS enables support www.soekris.com hardware. # # CPU_SUSP_HLT enables suspend on HALT. If this option is set, CPU # enters suspend mode following execution of HALT instruction. # # CPU_UPGRADE_HW_CACHE eliminates unneeded cache flush instruction(s). # # CPU_WT_ALLOC enables write allocation on Cyrix 6x86/6x86MX and AMD # K5/K6/K6-2 CPUs. # # CYRIX_CACHE_WORKS enables CPU cache on Cyrix 486 CPUs with cache # flush at hold state. # # CYRIX_CACHE_REALLY_WORKS enables (1) CPU cache on Cyrix 486 CPUs # without cache flush at hold state, and (2) write-back CPU cache on # Cyrix 6x86 whose revision < 2.7 (NOTE 2). # # NO_F00F_HACK disables the hack that prevents Pentiums (and ONLY # Pentiums) from locking up when a LOCK CMPXCHG8B instruction is # executed. This option is only needed if I586_CPU is also defined, # and should be included for any non-Pentium CPU that defines it. # # NO_MEMORY_HOLE is an optimisation for systems with AMD K6 processors # which indicates that the 15-16MB range is *definitely* not being # occupied by an ISA memory hole. # # NOTE 1: The options, CPU_BTB_EN, CPU_LOOP_EN, CPU_IORT, # CPU_LOOP_EN and CPU_RSTK_EN should not be used because of CPU bugs. # These options may crash your system. # # NOTE 2: If CYRIX_CACHE_REALLY_WORKS is not set, CPU cache is enabled # in write-through mode when revision < 2.7. If revision of Cyrix # 6x86 >= 2.7, CPU cache is always enabled in write-back mode. # # NOTE 3: This option may cause failures for software that requires # locked cycles in order to operate correctly. # options CPU_ATHLON_SSE_HACK options CPU_BLUELIGHTNING_3X options CPU_BLUELIGHTNING_FPU_OP_CACHE options CPU_BTB_EN options CPU_DIRECT_MAPPED_CACHE options CPU_DISABLE_5X86_LSSER options CPU_ELAN options CPU_ELAN_PPS options CPU_ELAN_XTAL=32768000 options CPU_ENABLE_LONGRUN options CPU_FASTER_5X86_FPU options CPU_GEODE options CPU_I486_ON_386 options CPU_IORT options CPU_L2_LATENCY=5 options CPU_LOOP_EN options CPU_PPRO2CELERON options CPU_RSTK_EN options CPU_SOEKRIS options CPU_SUSP_HLT options CPU_UPGRADE_HW_CACHE options CPU_WT_ALLOC options CYRIX_CACHE_WORKS options CYRIX_CACHE_REALLY_WORKS #options NO_F00F_HACK # Debug options options NPX_DEBUG # enable npx debugging # # PERFMON causes the driver for Pentium/Pentium Pro performance counters # to be compiled. See perfmon(4) for more information. # options PERFMON ##################################################################### # NETWORKING OPTIONS # # DEVICE_POLLING adds support for mixed interrupt-polling handling # of network device drivers, which has significant benefits in terms # of robustness to overloads and responsivity, as well as permitting # accurate scheduling of the CPU time between kernel network processing # and other activities. The drawback is a moderate (up to 1/HZ seconds) # potential increase in response times. # It is strongly recommended to use HZ=1000 or 2000 with DEVICE_POLLING # to achieve smoother behaviour. # Additionally, you can enable/disable polling at runtime with help of # the ifconfig(8) utility, and select the CPU fraction reserved to # userland with the sysctl variable kern.polling.user_frac # (default 50, range 0..100). # # Not all device drivers support this mode of operation at the time of # this writing. See polling(4) for more details. options DEVICE_POLLING # BPF_JITTER adds support for BPF just-in-time compiler. options BPF_JITTER # OpenFabrics Enterprise Distribution (Infiniband). options OFED options OFED_DEBUG_INIT # Sockets Direct Protocol options SDP options SDP_DEBUG # IP over Infiniband options IPOIB options IPOIB_DEBUG options IPOIB_CM ##################################################################### # CLOCK OPTIONS # Provide read/write access to the memory in the clock chip. device nvram # Access to rtc cmos via /dev/nvram ##################################################################### # MISCELLANEOUS DEVICES AND OPTIONS device speaker #Play IBM BASIC-style noises out your speaker envvar hint.speaker.0.at="isa" envvar hint.speaker.0.port="0x61" ##################################################################### # HARDWARE BUS CONFIGURATION # # ISA bus # device isa # # Options for `isa': # # AUTO_EOI_1 enables the `automatic EOI' feature for the master 8259A # interrupt controller. This saves about 0.7-1.25 usec for each interrupt. # This option breaks suspend/resume on some portables. # # AUTO_EOI_2 enables the `automatic EOI' feature for the slave 8259A # interrupt controller. This saves about 0.7-1.25 usec for each interrupt. # Automatic EOI is documented not to work for for the slave with the # original i8259A, but it works for some clones and some integrated # versions. # # MAXMEM specifies the amount of RAM on the machine; if this is not # specified, FreeBSD will first read the amount of memory from the CMOS # RAM, so the amount of memory will initially be limited to 64MB or 16MB # depending on the BIOS. If the BIOS reports 64MB, a memory probe will # then attempt to detect the installed amount of RAM. If this probe # fails to detect >64MB RAM you will have to use the MAXMEM option. # The amount is in kilobytes, so for a machine with 128MB of RAM, it would # be 131072 (128 * 1024). # # BROKEN_KEYBOARD_RESET disables the use of the keyboard controller to # reset the CPU for reboot. This is needed on some systems with broken # keyboard controllers. options AUTO_EOI_1 #options AUTO_EOI_2 options MAXMEM=(128*1024) #options BROKEN_KEYBOARD_RESET # # AGP GART support device agp # AGP debugging. options AGP_DEBUG ##################################################################### # HARDWARE DEVICE CONFIGURATION # To include support for VGA VESA video modes options VESA # Turn on extra debugging checks and output for VESA support. options VESA_DEBUG device dpms # DPMS suspend & resume via VESA BIOS # x86 real mode BIOS emulator, required by atkbdc/dpms/vesa options X86BIOS # # Hints for the non-optional Numeric Processing eXtension driver. envvar hint.npx.0.flags="0x0" envvar hint.npx.0.irq="13" # # `flags' for npx0: # 0x01 don't use the npx registers to optimize bcopy. # 0x02 don't use the npx registers to optimize bzero. # 0x04 don't use the npx registers to optimize copyin or copyout. # The npx registers are normally used to optimize copying and zeroing when # all of the following conditions are satisfied: # I586_CPU is an option # the cpu is an i586 (perhaps not a Pentium) # the probe for npx0 succeeds # INT 16 exception handling works. # Then copying and zeroing using the npx registers is normally 30-100% faster. # The flags can be used to control cases where it doesn't work or is slower. # Setting them at boot time using hints works right (the optimizations # are not used until later in the bootstrap when npx0 is attached). # Flag 0x08 automatically disables the i586 optimized routines. # # # Optional devices: # # PS/2 mouse device psm envvar hint.psm.0.at="atkbdc" envvar hint.psm.0.irq="12" # Options for psm: options PSM_HOOKRESUME #hook the system resume event, useful #for some laptops options PSM_RESETAFTERSUSPEND #reset the device at the resume event # The keyboard controller; it controls the keyboard and the PS/2 mouse. device atkbdc envvar hint.atkbdc.0.at="isa" envvar hint.atkbdc.0.port="0x060" # The AT keyboard device atkbd envvar hint.atkbd.0.at="atkbdc" envvar hint.atkbd.0.irq="1" # Options for atkbd: options ATKBD_DFLT_KEYMAP # specify the built-in keymap makeoptions ATKBD_DFLT_KEYMAP=fr.dvorak # `flags' for atkbd: # 0x01 Force detection of keyboard, else we always assume a keyboard # 0x02 Don't reset keyboard, useful for some newer ThinkPads # 0x03 Force detection and avoid reset, might help with certain # dockingstations # 0x04 Old-style (XT) keyboard support, useful for older ThinkPads # Video card driver for VGA adapters. device vga envvar hint.vga.0.at="isa" # Options for vga: # Try the following option if the mouse pointer is not drawn correctly # or font does not seem to be loaded properly. May cause flicker on # some systems. options VGA_ALT_SEQACCESS # If you can dispense with some vga driver features, you may want to # use the following options to save some memory. #options VGA_NO_FONT_LOADING # don't save/load font #options VGA_NO_MODE_CHANGE # don't change video modes # Older video cards may require this option for proper operation. options VGA_SLOW_IOACCESS # do byte-wide i/o's to TS and GDC regs # The following option probably won't work with the LCD displays. options VGA_WIDTH90 # support 90 column modes # Debugging. options VGA_DEBUG # vt(4) drivers. device vt_vga # Linear framebuffer driver for S3 VESA 1.2 cards. Works on top of VESA. device s3pci # 3Dfx Voodoo Graphics, Voodoo II /dev/3dfx CDEV support. This will create # the /dev/3dfx0 device to work with glide implementations. This should get # linked to /dev/3dfx and /dev/voodoo. Note that this is not the same as # the tdfx DRI module from XFree86 and is completely unrelated. # # To enable Linuxulator support, one must also include COMPAT_LINUX in the # config as well. The other option is to load both as modules. device tdfx # Enable 3Dfx Voodoo support device tdfx_linux # Enable Linuxulator support options IOMMU # Enable IOMMU support # # ACPI support using the Intel ACPI Component Architecture reference # implementation. # # ACPI_DEBUG enables the use of the debug.acpi.level and debug.acpi.layer # kernel environment variables to select initial debugging levels for the # Intel ACPICA code. (Note that the Intel code must also have USE_DEBUGGER # defined when it is built). device acpi options ACPI_DEBUG # ACPI WMI Mapping driver device acpi_wmi # ACPI Asus Extras (LCD backlight/brightness, video output, etc.) device acpi_asus # ACPI Fujitsu Extras (Buttons) device acpi_fujitsu # ACPI extras driver for HP laptops device acpi_hp # ACPI extras driver for IBM laptops device acpi_ibm # ACPI Panasonic Extras (LCD backlight/brightness, video output, etc.) device acpi_panasonic # ACPI Sony extra (LCD brightness) device acpi_sony # ACPI Toshiba Extras (LCD backlight/brightness, video output, etc.) device acpi_toshiba # ACPI Video Extensions (LCD backlight/brightness, video output, etc.) device acpi_video # ACPI Docking Station device acpi_dock # ACPI ASOC ATK0110 ASUSTeK AI Booster (voltage, temperature and fan sensors) device aibs # The cpufreq(4) driver provides support for non-ACPI CPU frequency control device cpufreq # # Network interfaces: # # bxe: Broadcom NetXtreme II (BCM5771X/BCM578XX) PCIe 10Gb Ethernet # adapters. # ce: Cronyx Tau-PCI/32 sync single/dual port G.703/E1 serial adaptor # with 32 HDLC subchannels (requires sppp (default), or NETGRAPH if # NETGRAPH_CRONYX is configured) # cp: Cronyx Tau-PCI sync single/dual/four port # V.35/RS-232/RS-530/RS-449/X.21/G.703/E1/E3/T3/STS-1 # serial adaptor (requires sppp (default), or NETGRAPH if # NETGRAPH_CRONYX is configured) # ipw: Intel PRO/Wireless 2100 IEEE 802.11 adapter # iwi: Intel PRO/Wireless 2200BG/2225BG/2915ABG IEEE 802.11 adapters # Requires the iwi firmware module # iwn: Intel Wireless WiFi Link 1000/105/135/2000/4965/5000/6000/6050 abgn # 802.11 network adapters # Requires the iwn firmware module # mthca: Mellanox HCA InfiniBand # mlx4ib: Mellanox ConnectX HCA InfiniBand # mlx4en: Mellanox ConnectX HCA Ethernet # nfe: nVidia nForce MCP on-board Ethernet Networking (BSD open source) # sbni: Granch SBNI12-xx ISA and PCI adapters # vmx: VMware VMXNET3 Ethernet (BSD open source) # wpi: Intel 3945ABG Wireless LAN controller # Requires the wpi firmware module # Order for ISA/EISA devices is important here device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE device ce device cp envvar hint.cs.0.at="isa" envvar hint.cs.0.port="0x300" #options NETGRAPH_CRONYX # Enable NETGRAPH support for Cronyx adapter(s) options ED_3C503 options ED_HPP options ED_SIC envvar hint.ed.0.at="isa" envvar hint.ed.0.port="0x280" envvar hint.ed.0.irq="5" envvar hint.ed.0.maddr="0xd8000" device ipw # Intel 2100 wireless NICs. device iwi # Intel 2200BG/2225BG/2915ABG wireless NICs. device iwn # Intel 4965/1000/5000/6000 wireless NICs. # Hint for the i386-only ISA front-end of le(4). envvar hint.le.0.at="isa" envvar hint.le.0.port="0x280" envvar hint.le.0.irq="10" envvar hint.le.0.drq="0" device mthca # Mellanox HCA InfiniBand device mlx4 # Shared code module between IB and Ethernet device mlx4ib # Mellanox ConnectX HCA InfiniBand device mlx4en # Mellanox ConnectX HCA Ethernet device nfe # nVidia nForce MCP on-board Ethernet device sbni envvar hint.sbni.0.at="isa" envvar hint.sbni.0.port="0x210" envvar hint.sbni.0.irq="0xefdead" envvar hint.sbni.0.flags="0" device vmx # VMware VMXNET3 Ethernet device wpi # Intel 3945ABG wireless NICs. # IEEE 802.11 adapter firmware modules # Intel PRO/Wireless 2100 firmware: # ipwfw: BSS/IBSS/monitor mode firmware # ipwbssfw: BSS mode firmware # ipwibssfw: IBSS mode firmware # ipwmonitorfw: Monitor mode firmware # Intel PRO/Wireless 2200BG/2225BG/2915ABG firmware: # iwifw: BSS/IBSS/monitor mode firmware # iwibssfw: BSS mode firmware # iwiibssfw: IBSS mode firmware # iwimonitorfw: Monitor mode firmware # Intel Wireless WiFi Link 4965/1000/5000/6000 series firmware: # iwnfw: Single module to support all devices # iwn1000fw: Specific module for the 1000 only # iwn105fw: Specific module for the 105 only # iwn135fw: Specific module for the 135 only # iwn2000fw: Specific module for the 2000 only # iwn2030fw: Specific module for the 2030 only # iwn4965fw: Specific module for the 4965 only # iwn5000fw: Specific module for the 5000 only # iwn5150fw: Specific module for the 5150 only # iwn6000fw: Specific module for the 6000 only # iwn6000g2afw: Specific module for the 6000g2a only # iwn6000g2bfw: Specific module for the 6000g2b only # iwn6050fw: Specific module for the 6050 only # wpifw: Intel 3945ABG Wireless LAN Controller firmware device iwifw device iwibssfw device iwiibssfw device iwimonitorfw device ipwfw device ipwbssfw device ipwibssfw device ipwmonitorfw device iwnfw device iwn1000fw device iwn105fw device iwn135fw device iwn2000fw device iwn2030fw device iwn4965fw device iwn5000fw device iwn5150fw device iwn6000fw device iwn6000g2afw device iwn6000g2bfw device iwn6050fw device wpifw # # Non-Transparent Bridge (NTB) drivers # device if_ntb # Virtual NTB network interface device ntb_transport # NTB packet transport driver device ntb # NTB hardware interface device ntb_hw_amd # AMD NTB hardware driver device ntb_hw_intel # Intel NTB hardware driver device ntb_hw_plx # PLX NTB hardware driver # # ATA raid adapters # device pst # # Areca 11xx and 12xx series of SATA II RAID controllers. # CAM is required. # device arcmsr # Areca SATA II RAID # # 3ware 9000 series PATA/SATA RAID controller driver and options. # The driver is implemented as a SIM, and so, needs the CAM infrastructure. # options TWA_DEBUG # 0-10; 10 prints the most messages. device twa # 3ware 9000 series PATA/SATA RAID # # Adaptec FSA RAID controllers, including integrated DELL controllers, # the Dell PERC 2/QC and the HP NetRAID-4M device aac device aacp # SCSI Passthrough interface (optional, CAM required) # # Adaptec by PMC RAID controllers, Series 6/7/8 and upcoming families device aacraid # Container interface, CAM required # # Highpoint RocketRAID 27xx. device hpt27xx # # Highpoint RocketRAID 182x. device hptmv # # Highpoint DC7280 and R750. device hptnr # # Highpoint RocketRAID. Supports RR172x, RR222x, RR2240, RR232x, RR2340, # RR2210, RR174x, RR2522, RR231x, RR230x. device hptrr # # Highpoint RocketRaid 3xxx series SATA RAID device hptiop # # Intel integrated Memory Controller (iMC) SMBus controller # Sandybridge-Xeon, Ivybridge-Xeon, Haswell-Xeon, Broadwell-Xeon device imcsmb # # IBM (now Adaptec) ServeRAID controllers device ips # # Intel C600 (Patsburg) integrated SAS controller device isci options ISCI_LOGGING # enable debugging in isci HAL # # NVM Express (NVMe) support device nvme # base NVMe driver device nvd # expose NVMe namespaces as disks, depends on nvme # # PMC-Sierra SAS/SATA controller device pmspcv # # SafeNet crypto driver: can be moved to the MI NOTES as soon as # it's tested on a big-endian machine # device safe # SafeNet 1141 options SAFE_DEBUG # enable debugging support: hw.safe.debug options SAFE_RNDTEST # enable rndtest support # # glxiic is an I2C driver for the AMD Geode LX CS5536 System Management Bus # controller. Requires 'device iicbus'. # device glxiic # AMD Geode LX CS5536 System Management Bus # # glxsb is a driver for the Security Block in AMD Geode LX processors. # Requires 'device crypto'. # device glxsb # AMD Geode LX Security Block # # VirtIO support # # The virtio entry provides a generic bus for use by the device drivers. # It must be combined with an interface that communicates with the host. # Multiple such interfaces defined by the VirtIO specification. FreeBSD # only has support for PCI. Therefore, virtio_pci must be statically # compiled in or loaded as a module for the device drivers to function. # device virtio # Generic VirtIO bus (required) device virtio_pci # VirtIO PCI Interface device vtnet # VirtIO Ethernet device device virtio_blk # VirtIO Block device device virtio_scsi # VirtIO SCSI device device virtio_balloon # VirtIO Memory Balloon device device virtio_random # VirtIO Entropy device device virtio_console # VirtIO Console device device hyperv # HyperV drivers ##################################################################### # # Miscellaneous hardware: # -# apm: Laptop Advanced Power Management (experimental) # ipmi: Intelligent Platform Management Interface # smapi: System Management Application Program Interface driver # smbios: DMI/SMBIOS entry point # vpd: Vital Product Data kernel interface # pbio: Parallel (8255 PPI) basic I/O (mode 0) port (e.g. Advantech PCL-724) # asmc: Apple System Management Controller # si: Specialix International SI/XIO or SX intelligent serial card driver # tpm: Trusted Platform Module -# Notes on APM -# The flags takes the following meaning for apm0: -# 0x0020 Statclock is broken. - # Notes on the Specialix SI/XIO driver: # The host card is memory, not IO mapped. # The Rev 1 host cards use a 64K chunk, on a 32K boundary. # The Rev 2 host cards use a 32K chunk, on a 32K boundary. # The cards can use an IRQ of 11, 12 or 15. # Notes on the Sony Programmable I/O controller # This is a temporary driver that should someday be replaced by something # that hooks into the ACPI layer. The device is hooked to the PIIX4's # General Device 10 decoder, which means you have to fiddle with PCI # registers to map it in, even though it is otherwise treated here as # an ISA device. At the moment, the driver polls, although the device # is capable of generating interrupts. It largely undocumented. # The port location in the hint is where you WANT the device to be # mapped. 0x10a0 seems to be traditional. At the moment the jogdial # is the only thing truly supported, but apparently a fair percentage # of the Vaio extra features are controlled by this device. -device apm -envvar hint.apm.0.flags="0x20" device ipmi device smapi device smbios device vpd device pbio envvar hint.pbio.0.at="isa" envvar hint.pbio.0.port="0x360" device asmc device tpm device padlock_rng # VIA Padlock RNG device rdrand_rng # Intel Bull Mountain RNG device aesni # AES-NI OpenCrypto module # # Laptop/Notebook options: # # See also: # apm under `Miscellaneous hardware' # above. device backlight # For older notebooks that signal a powerfail condition (external # power supply dropped, or battery state low) by issuing an NMI: options POWERFAIL_NMI # make it beep instead of panicing # # I2C Bus # # Philips i2c bus support is provided by the `iicbus' device. # # Supported interfaces: # pcf Philips PCF8584 ISA-bus controller # device pcf envvar hint.pcf.0.at="isa" envvar hint.pcf.0.port="0x320" envvar hint.pcf.0.irq="5" # # Hardware watchdog timers: # # ichwd: Intel ICH watchdog timer # amdsbwd: AMD SB7xx watchdog timer # viawd: VIA south bridge watchdog timer # wbwd: Winbond watchdog timer # itwd: ITE Super I/O watchdog timer # device ichwd device amdsbwd device viawd device wbwd device itwd # # Temperature sensors: # # coretemp: on-die sensor on Intel Core and newer CPUs # amdtemp: on-die sensor on AMD K8/K10/K11 CPUs # device coretemp device amdtemp # # CPU control pseudo-device. Provides access to MSRs, CPUID info and # microcode update feature. # device cpuctl # # SuperIO driver. # device superio # # System Management Bus (SMB) # options ENABLE_ALART # Control alarm on Intel intpm driver # # Set the number of PV entries per process. Increasing this can # stop panics related to heavy use of shared memory. However, that can # (combined with large amounts of physical memory) cause panics at # boot time due the kernel running out of VM space. # # If you're tweaking this, you might also want to increase the sysctls # "vm.v_free_min", "vm.v_free_reserved", and "vm.v_free_target". # # The value below is the one more than the default. # options PMAP_SHPGPERPROC=201 # # Number of initial kernel page table pages used for early bootstrap. # This number should include enough pages to map the kernel, any # modules or other data loaded with the kernel by the loader, and data # structures allocated before the VM system is initialized such as the # vm_page_t array. Each page table page maps 4MB (2MB with PAE). # options NKPT=31 ##################################################################### # ABI Emulation # Enable (32-bit) a.out binary support options COMPAT_AOUT # Enable 32-bit runtime support for CloudABI binaries. options COMPAT_CLOUDABI32 # Enable Linux ABI emulation options COMPAT_LINUX # Enable the linux-like proc filesystem support (requires COMPAT_LINUX # and PSEUDOFS) options LINPROCFS #Enable the linux-like sys filesystem support (requires COMPAT_LINUX # and PSEUDOFS) options LINSYSFS # Enable NDIS binary driver support options NDISAPI device ndis ##################################################################### # VM OPTIONS # KSTACK_PAGES is the number of memory pages to assign to the kernel # stack of each thread. options KSTACK_PAGES=5 # Enable detailed accounting by the PV entry allocator. options PV_STATS ##################################################################### # More undocumented options for linting. # Note that documenting these are not considered an affront. options FB_INSTALL_CDEV # install a CDEV entry in /dev options I586_PMC_GUPROF=0x70000 options KBDIO_DEBUG=2 options KBD_MAXRETRY=4 options KBD_MAXWAIT=6 options KBD_RESETDELAY=201 options PSM_DEBUG=1 options TIMER_FREQ=((14318182+6)/12) options VM_KMEM_SIZE options VM_KMEM_SIZE_MAX options VM_KMEM_SIZE_SCALE