diff options
Diffstat (limited to 'sys')
197 files changed, 544 insertions, 1110 deletions
diff --git a/sys/amd64/acpica/OsdEnvironment.c b/sys/amd64/acpica/OsdEnvironment.c index fb01a3f..6928f21 100644 --- a/sys/amd64/acpica/OsdEnvironment.c +++ b/sys/amd64/acpica/OsdEnvironment.c @@ -36,8 +36,8 @@ __FBSDID("$FreeBSD$"); #include <sys/linker_set.h> #include <sys/sysctl.h> -#include <contrib/dev/acpica/include/acpi.h> -#include <contrib/dev/acpica/include/actables.h> +#include <contrib/dev/acpica/acpi.h> +#include <contrib/dev/acpica/actables.h> static u_long amd64_acpi_root; @@ -63,7 +63,7 @@ AcpiOsGetRootPointer(void) if (amd64_acpi_root == 0 && (resource_long_value("acpi", 0, "rsdp", (long *)&ptr) == 0 || - AcpiFindRootPointer((ACPI_SIZE *)&ptr) == AE_OK) && + AcpiFindRootPointer((ACPI_NATIVE_UINT *)&ptr) == AE_OK) && ptr != 0) amd64_acpi_root = ptr; diff --git a/sys/amd64/acpica/acpi_machdep.c b/sys/amd64/acpica/acpi_machdep.c index b902c12..c69f14a 100644 --- a/sys/amd64/acpica/acpi_machdep.c +++ b/sys/amd64/acpica/acpi_machdep.c @@ -33,8 +33,7 @@ __FBSDID("$FreeBSD$"); #include <sys/module.h> #include <sys/sysctl.h> -#include <contrib/dev/acpica/include/acpi.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #include <machine/nexusvar.h> diff --git a/sys/amd64/acpica/acpi_wakeup.c b/sys/amd64/acpica/acpi_wakeup.c index bcc405f..2f9d8a0 100644 --- a/sys/amd64/acpica/acpi_wakeup.c +++ b/sys/amd64/acpica/acpi_wakeup.c @@ -53,8 +53,7 @@ __FBSDID("$FreeBSD$"); #include <machine/smp.h> #endif -#include <contrib/dev/acpica/include/acpi.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #include "acpi_wakecode.h" diff --git a/sys/amd64/acpica/madt.c b/sys/amd64/acpica/madt.c index b27f8e4..a8df55d 100644 --- a/sys/amd64/acpica/madt.c +++ b/sys/amd64/acpica/madt.c @@ -48,10 +48,8 @@ __FBSDID("$FreeBSD$"); #include <machine/md_var.h> #include <machine/specialreg.h> -#include <contrib/dev/acpica/include/acpi.h> -#include <contrib/dev/acpica/include/accommon.h> -#include <contrib/dev/acpica/include/actables.h> - +#include <contrib/dev/acpica/acpi.h> +#include <contrib/dev/acpica/actables.h> #include <dev/acpica/acpivar.h> #include <dev/pci/pcivar.h> diff --git a/sys/boot/i386/libi386/Makefile b/sys/boot/i386/libi386/Makefile index c1bbb52..9a2a3fa 100644 --- a/sys/boot/i386/libi386/Makefile +++ b/sys/boot/i386/libi386/Makefile @@ -48,7 +48,7 @@ CFLAGS+= -DTERM_EMU CFLAGS+= -Dalloca=__builtin_alloca CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../btx/lib \ - -I${.CURDIR}/../../../contrib/dev/acpica/include \ + -I${.CURDIR}/../../../contrib/dev/acpica \ -I${.CURDIR}/../../.. -I. # the location of libstand CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ diff --git a/sys/boot/i386/libi386/biosacpi.c b/sys/boot/i386/libi386/biosacpi.c index 0815983..971e7c7 100644 --- a/sys/boot/i386/libi386/biosacpi.c +++ b/sys/boot/i386/libi386/biosacpi.c @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); #include <btxv86.h> #include "libi386.h" -#include "platform/acfreebsd.h" +#include "acfreebsd.h" #include "acconfig.h" #define ACPI_SYSTEM_XFACE #include "actypes.h" diff --git a/sys/boot/ia64/ski/acpi_stub.c b/sys/boot/ia64/ski/acpi_stub.c index b16bb0a..8e08e52 100644 --- a/sys/boot/ia64/ski/acpi_stub.c +++ b/sys/boot/ia64/ski/acpi_stub.c @@ -27,7 +27,7 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include <contrib/dev/acpica/include/acpi.h> +#include <contrib/dev/acpica/acpi.h> #define APIC_IO_SAPIC 6 #define APIC_LOCAL_SAPIC 7 diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index 54ab6a2..bb49e3f 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/compat/linux/linux_getcwd.c b/sys/compat/linux/linux_getcwd.c index 6474d1e..afd30c8 100644 --- a/sys/compat/linux/linux_getcwd.c +++ b/sys/compat/linux/linux_getcwd.c @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index dc8edf5..d1e1b32 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/blist.h> diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c index 479ccf3..4d21a32 100644 --- a/sys/compat/linux/linux_stats.c +++ b/sys/compat/linux/linux_stats.c @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/dirent.h> diff --git a/sys/compat/svr4/svr4_fcntl.c b/sys/compat/svr4/svr4_fcntl.c index a4cdfcf..88e4fc2 100644 --- a/sys/compat/svr4/svr4_fcntl.c +++ b/sys/compat/svr4/svr4_fcntl.c @@ -32,8 +32,6 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include <sys/param.h> #include <sys/systm.h> #include <sys/file.h> diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c index f994314..62bd010 100644 --- a/sys/compat/svr4/svr4_misc.c +++ b/sys/compat/svr4/svr4_misc.c @@ -35,8 +35,6 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include <sys/param.h> #include <sys/systm.h> #include <sys/dirent.h> diff --git a/sys/conf/files b/sys/conf/files index 88e6ed1..2cdc23d 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -122,134 +122,131 @@ contrib/altq/altq/altq_rio.c optional altq \ contrib/altq/altq/altq_rmclass.c optional altq contrib/altq/altq/altq_subr.c optional altq \ compile-with "${NORMAL_C} -I$S/contrib/pf" -contrib/dev/acpica/debugger/dbcmds.c optional acpi acpi_debug -contrib/dev/acpica/debugger/dbdisply.c optional acpi acpi_debug -contrib/dev/acpica/debugger/dbexec.c optional acpi acpi_debug -contrib/dev/acpica/debugger/dbfileio.c optional acpi acpi_debug -contrib/dev/acpica/debugger/dbhistry.c optional acpi acpi_debug -contrib/dev/acpica/debugger/dbinput.c optional acpi acpi_debug -contrib/dev/acpica/debugger/dbstats.c optional acpi acpi_debug -contrib/dev/acpica/debugger/dbutils.c optional acpi acpi_debug -contrib/dev/acpica/debugger/dbxface.c optional acpi acpi_debug -contrib/dev/acpica/disassembler/dmbuffer.c optional acpi acpi_debug -contrib/dev/acpica/disassembler/dmnames.c optional acpi acpi_debug -contrib/dev/acpica/disassembler/dmopcode.c optional acpi acpi_debug -contrib/dev/acpica/disassembler/dmobject.c optional acpi acpi_debug -contrib/dev/acpica/disassembler/dmresrc.c optional acpi acpi_debug -contrib/dev/acpica/disassembler/dmresrcl.c optional acpi acpi_debug -contrib/dev/acpica/disassembler/dmresrcs.c optional acpi acpi_debug -contrib/dev/acpica/disassembler/dmutils.c optional acpi acpi_debug -contrib/dev/acpica/disassembler/dmwalk.c optional acpi acpi_debug -contrib/dev/acpica/dispatcher/dsfield.c optional acpi -contrib/dev/acpica/dispatcher/dsinit.c optional acpi -contrib/dev/acpica/dispatcher/dsmethod.c optional acpi -contrib/dev/acpica/dispatcher/dsmthdat.c optional acpi -contrib/dev/acpica/dispatcher/dsobject.c optional acpi -contrib/dev/acpica/dispatcher/dsopcode.c optional acpi -contrib/dev/acpica/dispatcher/dsutils.c optional acpi -contrib/dev/acpica/dispatcher/dswexec.c optional acpi -contrib/dev/acpica/dispatcher/dswload.c optional acpi -contrib/dev/acpica/dispatcher/dswscope.c optional acpi -contrib/dev/acpica/dispatcher/dswstate.c optional acpi -contrib/dev/acpica/events/evevent.c optional acpi -contrib/dev/acpica/events/evgpe.c optional acpi -contrib/dev/acpica/events/evgpeblk.c optional acpi -contrib/dev/acpica/events/evmisc.c optional acpi -contrib/dev/acpica/events/evregion.c optional acpi -contrib/dev/acpica/events/evrgnini.c optional acpi -contrib/dev/acpica/events/evsci.c optional acpi -contrib/dev/acpica/events/evxface.c optional acpi -contrib/dev/acpica/events/evxfevnt.c optional acpi -contrib/dev/acpica/events/evxfregn.c optional acpi -contrib/dev/acpica/executer/exconfig.c optional acpi -contrib/dev/acpica/executer/exconvrt.c optional acpi -contrib/dev/acpica/executer/excreate.c optional acpi -contrib/dev/acpica/executer/exdump.c optional acpi -contrib/dev/acpica/executer/exfield.c optional acpi -contrib/dev/acpica/executer/exfldio.c optional acpi -contrib/dev/acpica/executer/exmisc.c optional acpi -contrib/dev/acpica/executer/exmutex.c optional acpi -contrib/dev/acpica/executer/exnames.c optional acpi -contrib/dev/acpica/executer/exoparg1.c optional acpi -contrib/dev/acpica/executer/exoparg2.c optional acpi -contrib/dev/acpica/executer/exoparg3.c optional acpi -contrib/dev/acpica/executer/exoparg6.c optional acpi -contrib/dev/acpica/executer/exprep.c optional acpi -contrib/dev/acpica/executer/exregion.c optional acpi -contrib/dev/acpica/executer/exresnte.c optional acpi -contrib/dev/acpica/executer/exresolv.c optional acpi -contrib/dev/acpica/executer/exresop.c optional acpi -contrib/dev/acpica/executer/exstore.c optional acpi -contrib/dev/acpica/executer/exstoren.c optional acpi -contrib/dev/acpica/executer/exstorob.c optional acpi -contrib/dev/acpica/executer/exsystem.c optional acpi -contrib/dev/acpica/executer/exutils.c optional acpi -contrib/dev/acpica/hardware/hwacpi.c optional acpi -contrib/dev/acpica/hardware/hwgpe.c optional acpi -contrib/dev/acpica/hardware/hwregs.c optional acpi -contrib/dev/acpica/hardware/hwsleep.c optional acpi -contrib/dev/acpica/hardware/hwtimer.c optional acpi -contrib/dev/acpica/hardware/hwvalid.c optional acpi -contrib/dev/acpica/hardware/hwxface.c optional acpi -contrib/dev/acpica/namespace/nsaccess.c optional acpi -contrib/dev/acpica/namespace/nsalloc.c optional acpi -contrib/dev/acpica/namespace/nsdump.c optional acpi -contrib/dev/acpica/namespace/nseval.c optional acpi -contrib/dev/acpica/namespace/nsinit.c optional acpi -contrib/dev/acpica/namespace/nsload.c optional acpi -contrib/dev/acpica/namespace/nsnames.c optional acpi -contrib/dev/acpica/namespace/nsobject.c optional acpi -contrib/dev/acpica/namespace/nsparse.c optional acpi -contrib/dev/acpica/namespace/nspredef.c optional acpi -contrib/dev/acpica/namespace/nssearch.c optional acpi -contrib/dev/acpica/namespace/nsutils.c optional acpi -contrib/dev/acpica/namespace/nswalk.c optional acpi -contrib/dev/acpica/namespace/nsxfeval.c optional acpi -contrib/dev/acpica/namespace/nsxfname.c optional acpi -contrib/dev/acpica/namespace/nsxfobj.c optional acpi -contrib/dev/acpica/parser/psargs.c optional acpi -contrib/dev/acpica/parser/psloop.c optional acpi -contrib/dev/acpica/parser/psopcode.c optional acpi -contrib/dev/acpica/parser/psparse.c optional acpi -contrib/dev/acpica/parser/psscope.c optional acpi -contrib/dev/acpica/parser/pstree.c optional acpi -contrib/dev/acpica/parser/psutils.c optional acpi -contrib/dev/acpica/parser/pswalk.c optional acpi -contrib/dev/acpica/parser/psxface.c optional acpi -contrib/dev/acpica/resources/rsaddr.c optional acpi -contrib/dev/acpica/resources/rscalc.c optional acpi -contrib/dev/acpica/resources/rscreate.c optional acpi -contrib/dev/acpica/resources/rsdump.c optional acpi -contrib/dev/acpica/resources/rsinfo.c optional acpi -contrib/dev/acpica/resources/rsio.c optional acpi -contrib/dev/acpica/resources/rsirq.c optional acpi -contrib/dev/acpica/resources/rslist.c optional acpi -contrib/dev/acpica/resources/rsmemory.c optional acpi -contrib/dev/acpica/resources/rsmisc.c optional acpi -contrib/dev/acpica/resources/rsutils.c optional acpi -contrib/dev/acpica/resources/rsxface.c optional acpi -contrib/dev/acpica/tables/tbfadt.c optional acpi -contrib/dev/acpica/tables/tbfind.c optional acpi -contrib/dev/acpica/tables/tbinstal.c optional acpi -contrib/dev/acpica/tables/tbutils.c optional acpi -contrib/dev/acpica/tables/tbxface.c optional acpi -contrib/dev/acpica/tables/tbxfroot.c optional acpi -contrib/dev/acpica/utilities/utalloc.c optional acpi -contrib/dev/acpica/utilities/utcache.c optional acpi -contrib/dev/acpica/utilities/utcopy.c optional acpi -contrib/dev/acpica/utilities/utdebug.c optional acpi -contrib/dev/acpica/utilities/utdelete.c optional acpi -contrib/dev/acpica/utilities/uteval.c optional acpi -contrib/dev/acpica/utilities/utglobal.c optional acpi -contrib/dev/acpica/utilities/utinit.c optional acpi -contrib/dev/acpica/utilities/utlock.c optional acpi -contrib/dev/acpica/utilities/utmath.c optional acpi -contrib/dev/acpica/utilities/utmisc.c optional acpi -contrib/dev/acpica/utilities/utmutex.c optional acpi -contrib/dev/acpica/utilities/utobject.c optional acpi -contrib/dev/acpica/utilities/utresrc.c optional acpi -contrib/dev/acpica/utilities/utstate.c optional acpi -contrib/dev/acpica/utilities/utxface.c optional acpi +contrib/dev/acpica/dbcmds.c optional acpi acpi_debug +contrib/dev/acpica/dbdisply.c optional acpi acpi_debug +contrib/dev/acpica/dbexec.c optional acpi acpi_debug +contrib/dev/acpica/dbfileio.c optional acpi acpi_debug +contrib/dev/acpica/dbhistry.c optional acpi acpi_debug +contrib/dev/acpica/dbinput.c optional acpi acpi_debug +contrib/dev/acpica/dbstats.c optional acpi acpi_debug +contrib/dev/acpica/dbutils.c optional acpi acpi_debug +contrib/dev/acpica/dbxface.c optional acpi acpi_debug +contrib/dev/acpica/dmbuffer.c optional acpi acpi_debug +contrib/dev/acpica/dmnames.c optional acpi acpi_debug +contrib/dev/acpica/dmopcode.c optional acpi acpi_debug +contrib/dev/acpica/dmobject.c optional acpi acpi_debug +contrib/dev/acpica/dmresrc.c optional acpi acpi_debug +contrib/dev/acpica/dmresrcl.c optional acpi acpi_debug +contrib/dev/acpica/dmresrcs.c optional acpi acpi_debug +contrib/dev/acpica/dmutils.c optional acpi acpi_debug +contrib/dev/acpica/dmwalk.c optional acpi acpi_debug +contrib/dev/acpica/dsfield.c optional acpi +contrib/dev/acpica/dsinit.c optional acpi +contrib/dev/acpica/dsmethod.c optional acpi +contrib/dev/acpica/dsmthdat.c optional acpi +contrib/dev/acpica/dsobject.c optional acpi +contrib/dev/acpica/dsopcode.c optional acpi +contrib/dev/acpica/dsutils.c optional acpi +contrib/dev/acpica/dswexec.c optional acpi +contrib/dev/acpica/dswload.c optional acpi +contrib/dev/acpica/dswscope.c optional acpi +contrib/dev/acpica/dswstate.c optional acpi +contrib/dev/acpica/evevent.c optional acpi +contrib/dev/acpica/evgpe.c optional acpi +contrib/dev/acpica/evgpeblk.c optional acpi +contrib/dev/acpica/evmisc.c optional acpi +contrib/dev/acpica/evregion.c optional acpi +contrib/dev/acpica/evrgnini.c optional acpi +contrib/dev/acpica/evsci.c optional acpi +contrib/dev/acpica/evxface.c optional acpi +contrib/dev/acpica/evxfevnt.c optional acpi +contrib/dev/acpica/evxfregn.c optional acpi +contrib/dev/acpica/exconfig.c optional acpi +contrib/dev/acpica/exconvrt.c optional acpi +contrib/dev/acpica/excreate.c optional acpi +contrib/dev/acpica/exdump.c optional acpi +contrib/dev/acpica/exfield.c optional acpi +contrib/dev/acpica/exfldio.c optional acpi +contrib/dev/acpica/exmisc.c optional acpi +contrib/dev/acpica/exmutex.c optional acpi +contrib/dev/acpica/exnames.c optional acpi +contrib/dev/acpica/exoparg1.c optional acpi +contrib/dev/acpica/exoparg2.c optional acpi +contrib/dev/acpica/exoparg3.c optional acpi +contrib/dev/acpica/exoparg6.c optional acpi +contrib/dev/acpica/exprep.c optional acpi +contrib/dev/acpica/exregion.c optional acpi +contrib/dev/acpica/exresnte.c optional acpi +contrib/dev/acpica/exresolv.c optional acpi +contrib/dev/acpica/exresop.c optional acpi +contrib/dev/acpica/exstore.c optional acpi +contrib/dev/acpica/exstoren.c optional acpi +contrib/dev/acpica/exstorob.c optional acpi +contrib/dev/acpica/exsystem.c optional acpi +contrib/dev/acpica/exutils.c optional acpi +contrib/dev/acpica/hwacpi.c optional acpi +contrib/dev/acpica/hwgpe.c optional acpi +contrib/dev/acpica/hwregs.c optional acpi +contrib/dev/acpica/hwsleep.c optional acpi +contrib/dev/acpica/hwtimer.c optional acpi +contrib/dev/acpica/nsaccess.c optional acpi +contrib/dev/acpica/nsalloc.c optional acpi +contrib/dev/acpica/nsdump.c optional acpi +contrib/dev/acpica/nseval.c optional acpi +contrib/dev/acpica/nsinit.c optional acpi +contrib/dev/acpica/nsload.c optional acpi +contrib/dev/acpica/nsnames.c optional acpi +contrib/dev/acpica/nsobject.c optional acpi +contrib/dev/acpica/nsparse.c optional acpi +contrib/dev/acpica/nssearch.c optional acpi +contrib/dev/acpica/nsutils.c optional acpi +contrib/dev/acpica/nswalk.c optional acpi +contrib/dev/acpica/nsxfeval.c optional acpi +contrib/dev/acpica/nsxfname.c optional acpi +contrib/dev/acpica/nsxfobj.c optional acpi +contrib/dev/acpica/psargs.c optional acpi +contrib/dev/acpica/psloop.c optional acpi +contrib/dev/acpica/psopcode.c optional acpi +contrib/dev/acpica/psparse.c optional acpi +contrib/dev/acpica/psscope.c optional acpi +contrib/dev/acpica/pstree.c optional acpi +contrib/dev/acpica/psutils.c optional acpi +contrib/dev/acpica/pswalk.c optional acpi +contrib/dev/acpica/psxface.c optional acpi +contrib/dev/acpica/rsaddr.c optional acpi +contrib/dev/acpica/rscalc.c optional acpi +contrib/dev/acpica/rscreate.c optional acpi +contrib/dev/acpica/rsdump.c optional acpi +contrib/dev/acpica/rsinfo.c optional acpi +contrib/dev/acpica/rsio.c optional acpi +contrib/dev/acpica/rsirq.c optional acpi +contrib/dev/acpica/rslist.c optional acpi +contrib/dev/acpica/rsmemory.c optional acpi +contrib/dev/acpica/rsmisc.c optional acpi +contrib/dev/acpica/rsutils.c optional acpi +contrib/dev/acpica/rsxface.c optional acpi +contrib/dev/acpica/tbfadt.c optional acpi +contrib/dev/acpica/tbfind.c optional acpi +contrib/dev/acpica/tbinstal.c optional acpi +contrib/dev/acpica/tbutils.c optional acpi +contrib/dev/acpica/tbxface.c optional acpi +contrib/dev/acpica/tbxfroot.c optional acpi +contrib/dev/acpica/utalloc.c optional acpi +contrib/dev/acpica/utcache.c optional acpi +contrib/dev/acpica/utclib.c optional acpi +contrib/dev/acpica/utcopy.c optional acpi +contrib/dev/acpica/utdebug.c optional acpi +contrib/dev/acpica/utdelete.c optional acpi +contrib/dev/acpica/uteval.c optional acpi +contrib/dev/acpica/utglobal.c optional acpi +contrib/dev/acpica/utinit.c optional acpi +contrib/dev/acpica/utmath.c optional acpi +contrib/dev/acpica/utmisc.c optional acpi +contrib/dev/acpica/utmutex.c optional acpi +contrib/dev/acpica/utobject.c optional acpi +contrib/dev/acpica/utresrc.c optional acpi +contrib/dev/acpica/utstate.c optional acpi +contrib/dev/acpica/utxface.c optional acpi contrib/ipfilter/netinet/fil.c optional ipfilter inet \ compile-with "${NORMAL_C} -I$S/contrib/ipfilter" contrib/ipfilter/netinet/ip_auth.c optional ipfilter inet \ @@ -1972,7 +1969,6 @@ kern/subr_autoconf.c standard kern/subr_blist.c standard kern/subr_bus.c standard kern/subr_bufring.c standard -kern/subr_clist.c standard kern/subr_clock.c standard kern/subr_devstat.c standard kern/subr_disk.c standard diff --git a/sys/conf/options b/sys/conf/options index 1d9a67b..c72b3d1 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -112,7 +112,7 @@ KSTACK_PAGES KTRACE KTRACE_REQUEST_POOL opt_ktrace.h LIBICONV -MAC +MAC opt_global.h MAC_BIBA opt_dontuse.h MAC_BSDEXTENDED opt_dontuse.h MAC_IFOFF opt_dontuse.h diff --git a/sys/contrib/pf/net/pf.c b/sys/contrib/pf/net/pf.c index ca4f79a..d0947b9 100644 --- a/sys/contrib/pf/net/pf.c +++ b/sys/contrib/pf/net/pf.c @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #endif #ifdef __FreeBSD__ -#include "opt_mac.h" #include "opt_bpf.h" #include "opt_pf.h" diff --git a/sys/dev/acpi_support/acpi_aiboost.c b/sys/dev/acpi_support/acpi_aiboost.c index 8fff872..00bf9cb 100644 --- a/sys/dev/acpi_support/acpi_aiboost.c +++ b/sys/dev/acpi_support/acpi_aiboost.c @@ -31,9 +31,7 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/kernel.h> #include <sys/bus.h> - -#include <contrib/dev/acpica/include/acpi.h> - +#include <contrib/dev/acpica/acpi.h> #include "acpi_if.h" #include <sys/module.h> #include <dev/acpica/acpivar.h> diff --git a/sys/dev/acpi_support/acpi_asus.c b/sys/dev/acpi_support/acpi_asus.c index 51ca6fa..28f9e7c 100644 --- a/sys/dev/acpi_support/acpi_asus.c +++ b/sys/dev/acpi_support/acpi_asus.c @@ -47,9 +47,7 @@ __FBSDID("$FreeBSD$"); #include <sys/bus.h> #include <sys/sbuf.h> -#include <contrib/dev/acpica/include/acpi.h> -#include <contrib/dev/acpica/include/accommon.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #include <dev/led/led.h> diff --git a/sys/dev/acpi_support/acpi_fujitsu.c b/sys/dev/acpi_support/acpi_fujitsu.c index 6628135..5de365a 100644 --- a/sys/dev/acpi_support/acpi_fujitsu.c +++ b/sys/dev/acpi_support/acpi_fujitsu.c @@ -37,9 +37,7 @@ __FBSDID("$FreeBSD$"); #include <sys/module.h> #include <sys/sysctl.h> -#include <contrib/dev/acpica/include/acpi.h> -#include <contrib/dev/acpica/include/accommon.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> /* Hooks for the ACPI CA debugging infrastructure */ diff --git a/sys/dev/acpi_support/acpi_ibm.c b/sys/dev/acpi_support/acpi_ibm.c index 0bf340d..ca67716 100644 --- a/sys/dev/acpi_support/acpi_ibm.c +++ b/sys/dev/acpi_support/acpi_ibm.c @@ -42,10 +42,7 @@ __FBSDID("$FreeBSD$"); #include <sys/kernel.h> #include <sys/bus.h> #include <machine/cpufunc.h> - -#include <contrib/dev/acpica/include/acpi.h> -#include <contrib/dev/acpica/include/accommon.h> - +#include <contrib/dev/acpica/acpi.h> #include "acpi_if.h" #include <sys/module.h> #include <dev/acpica/acpivar.h> diff --git a/sys/dev/acpi_support/acpi_panasonic.c b/sys/dev/acpi_support/acpi_panasonic.c index 595ca08..f922233 100644 --- a/sys/dev/acpi_support/acpi_panasonic.c +++ b/sys/dev/acpi_support/acpi_panasonic.c @@ -37,8 +37,7 @@ __FBSDID("$FreeBSD$"); #include <sys/bus.h> #include <sys/power.h> -#include <contrib/dev/acpica/include/acpi.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #define _COMPONENT ACPI_OEM diff --git a/sys/dev/acpi_support/acpi_sony.c b/sys/dev/acpi_support/acpi_sony.c index 905461d..88195c2 100644 --- a/sys/dev/acpi_support/acpi_sony.c +++ b/sys/dev/acpi_support/acpi_sony.c @@ -31,9 +31,7 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/kernel.h> #include <sys/bus.h> - -#include <contrib/dev/acpica/include/acpi.h> - +#include <contrib/dev/acpica/acpi.h> #include "acpi_if.h" #include <sys/module.h> #include <dev/acpica/acpivar.h> diff --git a/sys/dev/acpi_support/acpi_toshiba.c b/sys/dev/acpi_support/acpi_toshiba.c index 343d3ae..d15fe7e 100644 --- a/sys/dev/acpi_support/acpi_toshiba.c +++ b/sys/dev/acpi_support/acpi_toshiba.c @@ -34,8 +34,7 @@ __FBSDID("$FreeBSD$"); #include <sys/module.h> #include <sys/bus.h> -#include <contrib/dev/acpica/include/acpi.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #define _COMPONENT ACPI_OEM diff --git a/sys/dev/acpica/Osd/OsdDebug.c b/sys/dev/acpica/Osd/OsdDebug.c index 8425357..27b94a0 100644 --- a/sys/dev/acpica/Osd/OsdDebug.c +++ b/sys/dev/acpica/Osd/OsdDebug.c @@ -41,10 +41,8 @@ __FBSDID("$FreeBSD$"); #include <ddb/ddb.h> #include <ddb/db_output.h> -#include <contrib/dev/acpica/include/acpi.h> -#include <contrib/dev/acpica/include/accommon.h> -#include <contrib/dev/acpica/include/acdebug.h> - +#include <contrib/dev/acpica/acpi.h> +#include <contrib/dev/acpica/acdebug.h> #include <dev/acpica/acpivar.h> UINT32 diff --git a/sys/dev/acpica/Osd/OsdHardware.c b/sys/dev/acpica/Osd/OsdHardware.c index cf3cdd7..6e3beea 100644 --- a/sys/dev/acpica/Osd/OsdHardware.c +++ b/sys/dev/acpica/Osd/OsdHardware.c @@ -32,7 +32,7 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include <contrib/dev/acpica/include/acpi.h> +#include <contrib/dev/acpica/acpi.h> #include <sys/bus.h> #include <sys/kernel.h> @@ -65,9 +65,75 @@ __FBSDID("$FreeBSD$"); #define ACPI_BUS_HANDLE 0 #endif +/* + * Some BIOS vendors use AML to read/write directly to IO space. This + * can cause a problem if such accesses interfere with the OS's access to + * the same ports. Windows XP and newer systems block accesses to certain + * IO ports. We print a message or block accesses based on a tunable. + */ +static int illegal_bios_ports[] = { + 0x000, 0x00f, /* DMA controller 1 */ + 0x020, 0x021, /* PIC */ + 0x040, 0x043, /* Timer 1 */ + 0x048, 0x04b, /* Timer 2 failsafe */ + 0x070, 0x071, /* CMOS and RTC */ + 0x074, 0x076, /* Extended CMOS */ + 0x081, 0x083, /* DMA1 page registers */ + 0x087, 0x087, /* DMA1 ch0 low page */ + 0x089, 0x08b, /* DMA2 ch2 (0x89), ch3 low page (0x8a, 0x8b) */ + 0x08f, 0x091, /* DMA2 low page refresh (0x8f) */ + /* Arb ctrl port, card select feedback (0x90, 0x91) */ + 0x093, 0x094, /* System board setup */ + 0x096, 0x097, /* POS channel select */ + 0x0a0, 0x0a1, /* PIC (cascaded) */ + 0x0c0, 0x0df, /* ISA DMA */ + 0x4d0, 0x4d1, /* PIC ELCR (edge/level control) */ + 0xcf8, 0xcff, /* PCI config space. Microsoft adds 0xd00 also but + that seems incorrect. */ + -1, -1 +}; + +/* Block accesses to bad IO port addresses or just print a warning. */ +static int block_bad_io; +TUNABLE_INT("debug.acpi.block_bad_io", &block_bad_io); + +/* + * Look up bad ports in our table. Returns 0 if ok, 1 if marked bad but + * access is still allowed, or -1 to deny access. + */ +static int +acpi_os_check_port(UINT32 addr, UINT32 width) +{ + int error, *port; + + error = 0; + for (port = illegal_bios_ports; *port != -1; port += 2) { + if ((addr >= port[0] && addr <= port[1]) || + (addr < port[0] && addr + (width / 8) > port[0])) { + if (block_bad_io) + error = -1; + else + error = 1; + break; + } + } + + return (error); +} + ACPI_STATUS AcpiOsReadPort(ACPI_IO_ADDRESS InPort, UINT32 *Value, UINT32 Width) { + int error; + + error = acpi_os_check_port(InPort, Width); + if (error != 0) { + if (bootverbose) + printf("acpi: bad read from port 0x%03x (%d)\n", + (int)InPort, Width); + if (error == -1) + return (AE_BAD_PARAMETER); + } switch (Width) { case 8: @@ -93,6 +159,16 @@ AcpiOsReadPort(ACPI_IO_ADDRESS InPort, UINT32 *Value, UINT32 Width) ACPI_STATUS AcpiOsWritePort(ACPI_IO_ADDRESS OutPort, UINT32 Value, UINT32 Width) { + int error; + + error = acpi_os_check_port(OutPort, Width); + if (error != 0) { + if (bootverbose) + printf("acpi: bad write to port 0x%03x (%d), val %#x\n", + (int)OutPort, Width, Value); + if (error == -1) + return (AE_BAD_PARAMETER); + } switch (Width) { case 8: diff --git a/sys/dev/acpica/Osd/OsdInterrupt.c b/sys/dev/acpica/Osd/OsdInterrupt.c index 158a2b9..c973124 100644 --- a/sys/dev/acpica/Osd/OsdInterrupt.c +++ b/sys/dev/acpica/Osd/OsdInterrupt.c @@ -39,9 +39,7 @@ __FBSDID("$FreeBSD$"); #include <machine/resource.h> #include <sys/rman.h> -#include <contrib/dev/acpica/include/acpi.h> -#include <contrib/dev/acpica/include/accommon.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #define _COMPONENT ACPI_OS_SERVICES diff --git a/sys/dev/acpica/Osd/OsdMemory.c b/sys/dev/acpica/Osd/OsdMemory.c index 8ed7a90..3804bb6 100644 --- a/sys/dev/acpica/Osd/OsdMemory.c +++ b/sys/dev/acpica/Osd/OsdMemory.c @@ -33,7 +33,7 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include <contrib/dev/acpica/include/acpi.h> +#include <contrib/dev/acpica/acpi.h> #include <sys/kernel.h> #include <sys/malloc.h> @@ -55,7 +55,7 @@ AcpiOsFree(void *Memory) } void * -AcpiOsMapMemory(ACPI_PHYSICAL_ADDRESS PhysicalAddress, ACPI_SIZE Length) +AcpiOsMapMemory(ACPI_PHYSICAL_ADDRESS PhysicalAddress, ACPI_NATIVE_UINT Length) { return (pmap_mapbios((vm_offset_t)PhysicalAddress, Length)); } @@ -80,6 +80,17 @@ AcpiOsValidateInterface (char *Interface) return (AE_SUPPORT); } +/* + * There is no clean way to do this. We make the charitable assumption + * that callers will not pass garbage to us. + */ +ACPI_STATUS +AcpiOsValidateAddress (UINT8 SpaceId, ACPI_PHYSICAL_ADDRESS Address, + ACPI_SIZE Length) +{ + return (AE_OK); +} + BOOLEAN AcpiOsReadable (void *Pointer, ACPI_SIZE Length) { diff --git a/sys/dev/acpica/Osd/OsdSchedule.c b/sys/dev/acpica/Osd/OsdSchedule.c index fa91ed8..795de93 100644 --- a/sys/dev/acpica/Osd/OsdSchedule.c +++ b/sys/dev/acpica/Osd/OsdSchedule.c @@ -43,9 +43,7 @@ __FBSDID("$FreeBSD$"); #include <sys/proc.h> #include <sys/taskqueue.h> -#include <contrib/dev/acpica/include/acpi.h> -#include <contrib/dev/acpica/include/accommon.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #define _COMPONENT ACPI_OS_SERVICES diff --git a/sys/dev/acpica/Osd/OsdStream.c b/sys/dev/acpica/Osd/OsdStream.c index 81181db..8d1291a 100644 --- a/sys/dev/acpica/Osd/OsdStream.c +++ b/sys/dev/acpica/Osd/OsdStream.c @@ -32,7 +32,7 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include <contrib/dev/acpica/include/acpi.h> +#include <contrib/dev/acpica/acpi.h> void AcpiOsPrintf(const char *Format, ...) diff --git a/sys/dev/acpica/Osd/OsdSynch.c b/sys/dev/acpica/Osd/OsdSynch.c index 68fdcaa..b15b1ea 100644 --- a/sys/dev/acpica/Osd/OsdSynch.c +++ b/sys/dev/acpica/Osd/OsdSynch.c @@ -32,8 +32,7 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include <contrib/dev/acpica/include/acpi.h> -#include <contrib/dev/acpica/include/accommon.h> +#include <contrib/dev/acpica/acpi.h> #include "opt_acpi.h" #include <sys/kernel.h> @@ -368,7 +367,7 @@ AcpiOsDeleteLock (ACPI_SPINLOCK Handle) * (and thus can't block) but since we have ithreads, we don't worry * about potentially blocking. */ -ACPI_CPU_FLAGS +ACPI_NATIVE_UINT AcpiOsAcquireLock (ACPI_SPINLOCK Handle) { struct acpi_spinlock *h = (struct acpi_spinlock *)Handle; diff --git a/sys/dev/acpica/Osd/OsdTable.c b/sys/dev/acpica/Osd/OsdTable.c index 55f674d..d9b29eb 100644 --- a/sys/dev/acpica/Osd/OsdTable.c +++ b/sys/dev/acpica/Osd/OsdTable.c @@ -36,8 +36,8 @@ __FBSDID("$FreeBSD$"); #include <sys/kernel.h> #include <sys/linker.h> -#include <contrib/dev/acpica/include/acpi.h> -#include <contrib/dev/acpica/include/actables.h> +#include <contrib/dev/acpica/acpi.h> +#include <contrib/dev/acpica/actables.h> #undef _COMPONENT #define _COMPONENT ACPI_TABLES @@ -67,30 +67,17 @@ ACPI_STATUS AcpiOsTableOverride(ACPI_TABLE_HEADER *ExistingTable, ACPI_TABLE_HEADER **NewTable) { - char modname[] = "acpi_dsdt"; - caddr_t acpi_table, p, s; + caddr_t acpi_dsdt, p; if (ExistingTable == NULL || NewTable == NULL) return (AE_BAD_PARAMETER); -#ifdef notyet - for (int i = 0; i < ACPI_NAME_SIZE; i++) - modname[i + 5] = tolower(ExistingTable->Signature[i]); -#else /* If we're not overriding the DSDT, just return. */ - if (strncmp(ExistingTable->Signature, ACPI_SIG_DSDT, ACPI_NAME_SIZE) != 0) { + if ((acpi_dsdt = preload_search_by_type("acpi_dsdt")) == NULL || + (p = preload_search_info(acpi_dsdt, MODINFO_ADDR)) == NULL) { *NewTable = NULL; - return (AE_OK); - } -#endif - - if ((acpi_table = preload_search_by_type(modname)) != NULL && - (p = preload_search_info(acpi_table, MODINFO_ADDR)) != NULL && - (s = preload_search_info(acpi_table, MODINFO_SIZE)) != NULL && - *(size_t *)s != 0) + } else *NewTable = *(ACPI_TABLE_HEADER **)p; - else - *NewTable = NULL; return (AE_OK); } diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 63f95d3..4bc059b 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -61,12 +61,11 @@ __FBSDID("$FreeBSD$"); #include <isa/isavar.h> #include <isa/pnpvar.h> -#include <contrib/dev/acpica/include/acpi.h> -#include <contrib/dev/acpica/include/accommon.h> -#include <contrib/dev/acpica/include/acnamesp.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #include <dev/acpica/acpiio.h> +#include <contrib/dev/acpica/achware.h> +#include <contrib/dev/acpica/acnamesp.h> #include "pci_if.h" #include <dev/pci/pcivar.h> @@ -417,6 +416,7 @@ static int acpi_attach(device_t dev) { struct acpi_softc *sc; + ACPI_TABLE_FACS *facs; ACPI_STATUS status; int error, state; UINT32 flags; @@ -593,7 +593,14 @@ acpi_attach(device_t dev) } /* Only enable S4BIOS by default if the FACS says it is available. */ - if (AcpiGbl_FACS->Flags & ACPI_FACS_S4_BIOS_PRESENT) + status = AcpiGetTable(ACPI_SIG_FACS, 0, (ACPI_TABLE_HEADER **)&facs); + if (ACPI_FAILURE(status)) { + device_printf(dev, "couldn't get FACS: %s\n", + AcpiFormatException(status)); + error = ENXIO; + goto out; + } + if (facs->Flags & ACPI_FACS_S4_BIOS_PRESENT) sc->acpi_s4bios = 1; /* Probe all supported sleep states. */ @@ -1841,7 +1848,8 @@ acpi_shutdown_final(void *arg, int howto) (AcpiGbl_FADT.Flags & ACPI_FADT_RESET_REGISTER) && sc->acpi_handle_reboot) { /* Reboot using the reset register. */ - status = AcpiWrite( + status = AcpiHwLowLevelWrite( + AcpiGbl_FADT.ResetRegister.BitWidth, AcpiGbl_FADT.ResetValue, &AcpiGbl_FADT.ResetRegister); if (ACPI_FAILURE(status)) device_printf(sc->acpi_dev, "reset failed - %s\n", @@ -3383,6 +3391,8 @@ static struct debugtag dbg_layer[] = { }; static struct debugtag dbg_level[] = { + {"ACPI_LV_ERROR", ACPI_LV_ERROR}, + {"ACPI_LV_WARN", ACPI_LV_WARN}, {"ACPI_LV_INIT", ACPI_LV_INIT}, {"ACPI_LV_DEBUG_OBJECT", ACPI_LV_DEBUG_OBJECT}, {"ACPI_LV_INFO", ACPI_LV_INFO}, diff --git a/sys/dev/acpica/acpi_acad.c b/sys/dev/acpica/acpi_acad.c index 638c09b..0ea69e8 100644 --- a/sys/dev/acpica/acpi_acad.c +++ b/sys/dev/acpica/acpi_acad.c @@ -40,8 +40,7 @@ __FBSDID("$FreeBSD$"); #include <sys/conf.h> #include <sys/power.h> -#include <contrib/dev/acpica/include/acpi.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #include <dev/acpica/acpiio.h> #include <isa/isavar.h> diff --git a/sys/dev/acpica/acpi_battery.c b/sys/dev/acpica/acpi_battery.c index dd2b3fa..2e8c7a4 100644 --- a/sys/dev/acpica/acpi_battery.c +++ b/sys/dev/acpica/acpi_battery.c @@ -36,8 +36,7 @@ __FBSDID("$FreeBSD$"); #include <sys/ioccom.h> #include <sys/sysctl.h> -#include <contrib/dev/acpica/include/acpi.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #include <dev/acpica/acpiio.h> diff --git a/sys/dev/acpica/acpi_button.c b/sys/dev/acpica/acpi_button.c index 7814c0e..197af4f 100644 --- a/sys/dev/acpica/acpi_button.c +++ b/sys/dev/acpica/acpi_button.c @@ -35,9 +35,7 @@ __FBSDID("$FreeBSD$"); #include <sys/module.h> #include <sys/bus.h> -#include <contrib/dev/acpica/include/acpi.h> -#include <contrib/dev/acpica/include/accommon.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> /* Hooks for the ACPI CA debugging infrastructure */ diff --git a/sys/dev/acpica/acpi_cmbat.c b/sys/dev/acpica/acpi_cmbat.c index dde3ad5..24ab5f8 100644 --- a/sys/dev/acpica/acpi_cmbat.c +++ b/sys/dev/acpica/acpi_cmbat.c @@ -41,8 +41,7 @@ __FBSDID("$FreeBSD$"); #include <sys/rman.h> #include <sys/malloc.h> -#include <contrib/dev/acpica/include/acpi.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #include <dev/acpica/acpiio.h> diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c index 5d8ad53..a65faee 100644 --- a/sys/dev/acpica/acpi_cpu.c +++ b/sys/dev/acpica/acpi_cpu.c @@ -46,9 +46,7 @@ __FBSDID("$FreeBSD$"); #include <machine/bus.h> #include <sys/rman.h> -#include <contrib/dev/acpica/include/acpi.h> -#include <contrib/dev/acpica/include/accommon.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> /* @@ -899,9 +897,9 @@ acpi_cpu_idle() * time if USB is loaded. */ if ((cpu_quirks & CPU_QUIRK_NO_BM_CTRL) == 0) { - AcpiReadBitRegister(ACPI_BITREG_BUS_MASTER_STATUS, &bm_active); + AcpiGetRegister(ACPI_BITREG_BUS_MASTER_STATUS, &bm_active); if (bm_active != 0) { - AcpiWriteBitRegister(ACPI_BITREG_BUS_MASTER_STATUS, 1); + AcpiSetRegister(ACPI_BITREG_BUS_MASTER_STATUS, 1); cx_next_idx = min(cx_next_idx, sc->cpu_non_c3); } } @@ -928,8 +926,8 @@ acpi_cpu_idle() */ if (cx_next->type == ACPI_STATE_C3) { if ((cpu_quirks & CPU_QUIRK_NO_BM_CTRL) == 0) { - AcpiWriteBitRegister(ACPI_BITREG_ARB_DISABLE, 1); - AcpiWriteBitRegister(ACPI_BITREG_BUS_MASTER_RLD, 1); + AcpiSetRegister(ACPI_BITREG_ARB_DISABLE, 1); + AcpiSetRegister(ACPI_BITREG_BUS_MASTER_RLD, 1); } else ACPI_FLUSH_CPU_CACHE(); } @@ -940,7 +938,7 @@ acpi_cpu_idle() * get the time very close to the CPU start/stop clock logic, this * is the only reliable time source. */ - AcpiRead(&start_time, &AcpiGbl_FADT.XPmTimerBlock); + AcpiHwLowLevelRead(32, &start_time, &AcpiGbl_FADT.XPmTimerBlock); CPU_GET_REG(cx_next->p_lvlx, 1); /* @@ -949,14 +947,14 @@ acpi_cpu_idle() * the processor has stopped. Doing it again provides enough * margin that we are certain to have a correct value. */ - AcpiRead(&end_time, &AcpiGbl_FADT.XPmTimerBlock); - AcpiRead(&end_time, &AcpiGbl_FADT.XPmTimerBlock); + AcpiHwLowLevelRead(32, &end_time, &AcpiGbl_FADT.XPmTimerBlock); + AcpiHwLowLevelRead(32, &end_time, &AcpiGbl_FADT.XPmTimerBlock); /* Enable bus master arbitration and disable bus master wakeup. */ if (cx_next->type == ACPI_STATE_C3 && (cpu_quirks & CPU_QUIRK_NO_BM_CTRL) == 0) { - AcpiWriteBitRegister(ACPI_BITREG_ARB_DISABLE, 0); - AcpiWriteBitRegister(ACPI_BITREG_BUS_MASTER_RLD, 0); + AcpiSetRegister(ACPI_BITREG_ARB_DISABLE, 0); + AcpiSetRegister(ACPI_BITREG_BUS_MASTER_RLD, 0); } ACPI_ENABLE_IRQS(); @@ -1071,11 +1069,11 @@ acpi_cpu_quirks(void) val |= PIIX4_STOP_BREAK_MASK; pci_write_config(acpi_dev, PIIX4_DEVACTB_REG, val, 4); } - AcpiReadBitRegister(ACPI_BITREG_BUS_MASTER_RLD, &val); + AcpiGetRegister(ACPI_BITREG_BUS_MASTER_RLD, &val); if (val) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "acpi_cpu: PIIX4: reset BRLD_EN_BM\n")); - AcpiWriteBitRegister(ACPI_BITREG_BUS_MASTER_RLD, 0); + AcpiSetRegister(ACPI_BITREG_BUS_MASTER_RLD, 0); } break; default: diff --git a/sys/dev/acpica/acpi_dock.c b/sys/dev/acpica/acpi_dock.c index b7d2e3e..fc59b53 100644 --- a/sys/dev/acpica/acpi_dock.c +++ b/sys/dev/acpica/acpi_dock.c @@ -32,9 +32,8 @@ #include <sys/kernel.h> #include <sys/module.h> -#include <contrib/dev/acpica/include/acpi.h> -#include <contrib/dev/acpica/include/accommon.h> - +#include <contrib/dev/acpica/acpi.h> +#include <contrib/dev/acpica/acnamesp.h> #include <dev/acpica/acpivar.h> #include <dev/acpica/acpiio.h> diff --git a/sys/dev/acpica/acpi_ec.c b/sys/dev/acpica/acpi_ec.c index a5a81dc..696542c 100644 --- a/sys/dev/acpica/acpi_ec.c +++ b/sys/dev/acpica/acpi_ec.c @@ -42,9 +42,7 @@ __FBSDID("$FreeBSD$"); #include <machine/resource.h> #include <sys/rman.h> -#include <contrib/dev/acpica/include/acpi.h> -#include <contrib/dev/acpica/include/accommon.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> /* Hooks for the ACPI CA debugging infrastructure */ diff --git a/sys/dev/acpica/acpi_hpet.c b/sys/dev/acpica/acpi_hpet.c index a418695..17022bb 100644 --- a/sys/dev/acpica/acpi_hpet.c +++ b/sys/dev/acpica/acpi_hpet.c @@ -36,9 +36,7 @@ __FBSDID("$FreeBSD$"); #include <sys/time.h> #include <sys/timetc.h> -#include <contrib/dev/acpica/include/acpi.h> -#include <contrib/dev/acpica/include/accommon.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #include <dev/acpica/acpi_hpet.h> diff --git a/sys/dev/acpica/acpi_if.m b/sys/dev/acpica/acpi_if.m index 4d90109..2ae19f4 100644 --- a/sys/dev/acpica/acpi_if.m +++ b/sys/dev/acpica/acpi_if.m @@ -28,8 +28,7 @@ #include <sys/bus.h> #include <sys/types.h> - -#include <contrib/dev/acpica/include/acpi.h> +#include <contrib/dev/acpica/acpi.h> INTERFACE acpi; diff --git a/sys/dev/acpica/acpi_isab.c b/sys/dev/acpica/acpi_isab.c index 0da0182..382d1c6 100644 --- a/sys/dev/acpica/acpi_isab.c +++ b/sys/dev/acpica/acpi_isab.c @@ -39,9 +39,7 @@ __FBSDID("$FreeBSD$"); #include <sys/malloc.h> #include <sys/module.h> -#include <contrib/dev/acpica/include/acpi.h> -#include <contrib/dev/acpica/include/accommon.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #include <isa/isavar.h> diff --git a/sys/dev/acpica/acpi_lid.c b/sys/dev/acpica/acpi_lid.c index 47d5b45..0bb4a9f 100644 --- a/sys/dev/acpica/acpi_lid.c +++ b/sys/dev/acpica/acpi_lid.c @@ -37,9 +37,7 @@ __FBSDID("$FreeBSD$"); #include <sys/bus.h> #include <sys/proc.h> -#include <contrib/dev/acpica/include/acpi.h> -#include <contrib/dev/acpica/include/accommon.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> /* Hooks for the ACPI CA debugging infrastructure */ diff --git a/sys/dev/acpica/acpi_package.c b/sys/dev/acpica/acpi_package.c index 55eaf93..d7be257 100644 --- a/sys/dev/acpica/acpi_package.c +++ b/sys/dev/acpica/acpi_package.c @@ -36,8 +36,7 @@ __FBSDID("$FreeBSD$"); #include <machine/resource.h> #include <sys/rman.h> -#include <contrib/dev/acpica/include/acpi.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> /* diff --git a/sys/dev/acpica/acpi_pci.c b/sys/dev/acpica/acpi_pci.c index 7c1bd86..607691c 100644 --- a/sys/dev/acpica/acpi_pci.c +++ b/sys/dev/acpica/acpi_pci.c @@ -36,9 +36,7 @@ __FBSDID("$FreeBSD$"); #include <sys/malloc.h> #include <sys/module.h> -#include <contrib/dev/acpica/include/acpi.h> -#include <contrib/dev/acpica/include/accommon.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #include <sys/pciio.h> diff --git a/sys/dev/acpica/acpi_pci_link.c b/sys/dev/acpica/acpi_pci_link.c index dcf101d..b39e8e2 100644 --- a/sys/dev/acpica/acpi_pci_link.c +++ b/sys/dev/acpica/acpi_pci_link.c @@ -35,8 +35,7 @@ __FBSDID("$FreeBSD$"); #include <sys/malloc.h> #include <sys/module.h> -#include <contrib/dev/acpica/include/acpi.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #include <dev/acpica/acpi_pcibvar.h> diff --git a/sys/dev/acpica/acpi_pcib.c b/sys/dev/acpica/acpi_pcib.c index cc9bcbe..96c9253 100644 --- a/sys/dev/acpica/acpi_pcib.c +++ b/sys/dev/acpica/acpi_pcib.c @@ -34,9 +34,7 @@ __FBSDID("$FreeBSD$"); #include <sys/malloc.h> #include <sys/kernel.h> -#include <contrib/dev/acpica/include/acpi.h> -#include <contrib/dev/acpica/include/accommon.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #include <dev/acpica/acpi_pcibvar.h> diff --git a/sys/dev/acpica/acpi_pcib_acpi.c b/sys/dev/acpica/acpi_pcib_acpi.c index d9827ab..495ae20 100644 --- a/sys/dev/acpica/acpi_pcib_acpi.c +++ b/sys/dev/acpica/acpi_pcib_acpi.c @@ -36,9 +36,7 @@ __FBSDID("$FreeBSD$"); #include <sys/module.h> #include <sys/sysctl.h> -#include <contrib/dev/acpica/include/acpi.h> -#include <contrib/dev/acpica/include/accommon.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #include <machine/pci_cfgreg.h> diff --git a/sys/dev/acpica/acpi_pcib_pci.c b/sys/dev/acpica/acpi_pcib_pci.c index 0da89c4..f0f2d76 100644 --- a/sys/dev/acpica/acpi_pcib_pci.c +++ b/sys/dev/acpica/acpi_pcib_pci.c @@ -36,9 +36,7 @@ __FBSDID("$FreeBSD$"); #include <sys/malloc.h> #include <sys/module.h> -#include <contrib/dev/acpica/include/acpi.h> -#include <contrib/dev/acpica/include/accommon.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #include <dev/acpica/acpi_pcibvar.h> diff --git a/sys/dev/acpica/acpi_perf.c b/sys/dev/acpica/acpi_perf.c index 31b1c63..e517ad3 100644 --- a/sys/dev/acpica/acpi_perf.c +++ b/sys/dev/acpica/acpi_perf.c @@ -44,8 +44,7 @@ __FBSDID("$FreeBSD$"); #include <machine/resource.h> #include <sys/rman.h> -#include <contrib/dev/acpica/include/acpi.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #include "cpufreq_if.h" diff --git a/sys/dev/acpica/acpi_powerres.c b/sys/dev/acpica/acpi_powerres.c index 0988871..3a64e3a 100644 --- a/sys/dev/acpica/acpi_powerres.c +++ b/sys/dev/acpica/acpi_powerres.c @@ -33,9 +33,7 @@ __FBSDID("$FreeBSD$"); #include <sys/malloc.h> #include <sys/bus.h> -#include <contrib/dev/acpica/include/acpi.h> -#include <contrib/dev/acpica/include/accommon.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> /* diff --git a/sys/dev/acpica/acpi_quirk.c b/sys/dev/acpica/acpi_quirk.c index fe0a06f..b75a527 100644 --- a/sys/dev/acpica/acpi_quirk.c +++ b/sys/dev/acpica/acpi_quirk.c @@ -30,8 +30,7 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/bus.h> -#include <contrib/dev/acpica/include/acpi.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> enum ops_t { diff --git a/sys/dev/acpica/acpi_resource.c b/sys/dev/acpica/acpi_resource.c index d9132b0..2a81e54 100644 --- a/sys/dev/acpica/acpi_resource.c +++ b/sys/dev/acpica/acpi_resource.c @@ -39,9 +39,7 @@ __FBSDID("$FreeBSD$"); #include <machine/resource.h> #include <sys/rman.h> -#include <contrib/dev/acpica/include/acpi.h> -#include <contrib/dev/acpica/include/accommon.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> /* Hooks for the ACPI CA debugging infrastructure */ diff --git a/sys/dev/acpica/acpi_smbat.c b/sys/dev/acpica/acpi_smbat.c index 145e240..3935a9f 100644 --- a/sys/dev/acpica/acpi_smbat.c +++ b/sys/dev/acpica/acpi_smbat.c @@ -33,8 +33,7 @@ __FBSDID("$FreeBSD$"); #include <sys/module.h> #include <sys/bus.h> -#include <contrib/dev/acpica/include/acpi.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #include <dev/acpica/acpiio.h> #include <dev/acpica/acpi_smbus.h> diff --git a/sys/dev/acpica/acpi_thermal.c b/sys/dev/acpica/acpi_thermal.c index 962fdb7..08cd15b 100644 --- a/sys/dev/acpica/acpi_thermal.c +++ b/sys/dev/acpica/acpi_thermal.c @@ -45,9 +45,7 @@ __FBSDID("$FreeBSD$"); #include "cpufreq_if.h" -#include <contrib/dev/acpica/include/acpi.h> -#include <contrib/dev/acpica/include/accommon.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> /* Hooks for the ACPI CA debugging infrastructure */ diff --git a/sys/dev/acpica/acpi_throttle.c b/sys/dev/acpica/acpi_throttle.c index 40476e0..d79d7ae 100644 --- a/sys/dev/acpica/acpi_throttle.c +++ b/sys/dev/acpica/acpi_throttle.c @@ -39,8 +39,7 @@ __FBSDID("$FreeBSD$"); #include <machine/bus.h> -#include <contrib/dev/acpica/include/acpi.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #include <dev/pci/pcivar.h> diff --git a/sys/dev/acpica/acpi_timer.c b/sys/dev/acpica/acpi_timer.c index cfbeea4..73bd5ed 100644 --- a/sys/dev/acpica/acpi_timer.c +++ b/sys/dev/acpica/acpi_timer.c @@ -40,9 +40,7 @@ __FBSDID("$FreeBSD$"); #include <machine/resource.h> #include <sys/rman.h> -#include <contrib/dev/acpica/include/acpi.h> -#include <contrib/dev/acpica/include/accommon.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #include <dev/pci/pcivar.h> diff --git a/sys/dev/acpica/acpi_video.c b/sys/dev/acpica/acpi_video.c index c095a40..b9fccfc 100644 --- a/sys/dev/acpica/acpi_video.c +++ b/sys/dev/acpica/acpi_video.c @@ -38,8 +38,7 @@ __FBSDID("$FreeBSD$"); #include <sys/queue.h> #include <sys/sysctl.h> -#include <contrib/dev/acpica/include/acpi.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> /* ACPI video extension driver. */ diff --git a/sys/dev/asmc/asmc.c b/sys/dev/asmc/asmc.c index d4e835d..a2722c0 100644 --- a/sys/dev/asmc/asmc.c +++ b/sys/dev/asmc/asmc.c @@ -49,9 +49,7 @@ __FBSDID("$FreeBSD$"); #include <sys/rman.h> #include <machine/resource.h> - -#include <contrib/dev/acpica/include/acpi.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #include <dev/asmc/asmcvar.h> diff --git a/sys/dev/fdc/fdc_acpi.c b/sys/dev/fdc/fdc_acpi.c index 79fa66b..c3cb9b9 100644 --- a/sys/dev/fdc/fdc_acpi.c +++ b/sys/dev/fdc/fdc_acpi.c @@ -35,8 +35,7 @@ __FBSDID("$FreeBSD$"); #include <sys/module.h> #include <sys/proc.h> -#include <contrib/dev/acpica/include/acpi.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #include <dev/fdc/fdcvar.h> diff --git a/sys/dev/ipmi/ipmi_acpi.c b/sys/dev/ipmi/ipmi_acpi.c index 4281002..1bd3a64 100644 --- a/sys/dev/ipmi/ipmi_acpi.c +++ b/sys/dev/ipmi/ipmi_acpi.c @@ -36,8 +36,7 @@ __FBSDID("$FreeBSD$"); #include <sys/rman.h> #include <sys/selinfo.h> -#include <contrib/dev/acpica/include/acpi.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> /* Hooks for the ACPI CA debugging infrastructure */ diff --git a/sys/dev/kbd/kbd.c b/sys/dev/kbd/kbd.c index 753269a..851f677 100644 --- a/sys/dev/kbd/kbd.c +++ b/sys/dev/kbd/kbd.c @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); #include <sys/systm.h> #include <sys/kernel.h> #include <sys/malloc.h> -#include <sys/clist.h> #include <sys/conf.h> #include <sys/fcntl.h> #include <sys/poll.h> @@ -50,11 +49,16 @@ __FBSDID("$FreeBSD$"); #define KBD_INDEX(dev) dev2unit(dev) +#define KB_QSIZE 512 +#define KB_BUFSIZE 64 + typedef struct genkbd_softc { int gkb_flags; /* flag/status bits */ #define KB_ASLEEP (1 << 0) - struct clist gkb_q; /* input queue */ struct selinfo gkb_rsel; + char gkb_q[KB_QSIZE]; /* input queue */ + unsigned int gkb_q_start; + unsigned int gkb_q_length; } genkbd_softc_t; static SLIST_HEAD(, keyboard_driver) keyboard_drivers = @@ -521,8 +525,38 @@ kbd_detach(keyboard_t *kbd) * driver functions. */ -#define KB_QSIZE 512 -#define KB_BUFSIZE 64 +static void +genkbd_putc(genkbd_softc_t *sc, char c) +{ + unsigned int p; + + if (sc->gkb_q_length == KB_QSIZE) + return; + + p = (sc->gkb_q_start + sc->gkb_q_length) % KB_QSIZE; + sc->gkb_q[p] = c; + sc->gkb_q_length++; +} + +static size_t +genkbd_getc(genkbd_softc_t *sc, char *buf, size_t len) +{ + + /* Determine copy size. */ + if (sc->gkb_q_length == 0) + return (0); + if (len >= sc->gkb_q_length) + len = sc->gkb_q_length; + if (len >= KB_QSIZE - sc->gkb_q_start) + len = KB_QSIZE - sc->gkb_q_start; + + /* Copy out data and progress offset. */ + memcpy(buf, sc->gkb_q + sc->gkb_q_start, len); + sc->gkb_q_start = (sc->gkb_q_start + len) % KB_QSIZE; + sc->gkb_q_length -= len; + + return (len); +} static kbd_callback_func_t genkbd_event; @@ -555,10 +589,7 @@ genkbdopen(struct cdev *dev, int mode, int flag, struct thread *td) * the device may still be missing (!KBD_HAS_DEVICE(kbd)). */ -#if 0 - bzero(&sc->gkb_q, sizeof(sc->gkb_q)); -#endif - clist_alloc_cblocks(&sc->gkb_q, KB_QSIZE, KB_QSIZE/2); /* XXX */ + sc->gkb_q_length = 0; splx(s); return (0); @@ -582,9 +613,6 @@ genkbdclose(struct cdev *dev, int mode, int flag, struct thread *td) /* XXX: we shall be forgiving and don't report error... */ } else { kbd_release(kbd, (void *)sc); -#if 0 - clist_free_cblocks(&sc->gkb_q); -#endif } splx(s); return (0); @@ -608,7 +636,7 @@ genkbdread(struct cdev *dev, struct uio *uio, int flag) splx(s); return (ENXIO); } - while (sc->gkb_q.c_cc == 0) { + while (sc->gkb_q_length == 0) { if (flag & O_NONBLOCK) { splx(s); return (EWOULDBLOCK); @@ -632,7 +660,7 @@ genkbdread(struct cdev *dev, struct uio *uio, int flag) error = 0; while (uio->uio_resid > 0) { len = imin(uio->uio_resid, sizeof(buffer)); - len = q_to_b(&sc->gkb_q, buffer, len); + len = genkbd_getc(sc, buffer, len); if (len <= 0) break; error = uiomove(buffer, len, uio); @@ -684,7 +712,7 @@ genkbdpoll(struct cdev *dev, int events, struct thread *td) if ((sc == NULL) || (kbd == NULL) || !KBD_IS_VALID(kbd)) { revents = POLLHUP; /* the keyboard has gone */ } else if (events & (POLLIN | POLLRDNORM)) { - if (sc->gkb_q.c_cc > 0) + if (sc->gkb_q_length > 0) revents = events & (POLLIN | POLLRDNORM); else selrecord(td, &sc->gkb_rsel); @@ -738,7 +766,7 @@ genkbd_event(keyboard_t *kbd, int event, void *arg) /* store the byte as is for K_RAW and K_CODE modes */ if (mode != K_XLATE) { - putc(KEYCHAR(c), &sc->gkb_q); + genkbd_putc(sc, KEYCHAR(c)); continue; } @@ -753,9 +781,9 @@ genkbd_event(keyboard_t *kbd, int event, void *arg) /* ignore them... */ continue; case BTAB: /* a backtab: ESC [ Z */ - putc(0x1b, &sc->gkb_q); - putc('[', &sc->gkb_q); - putc('Z', &sc->gkb_q); + genkbd_putc(sc, 0x1b); + genkbd_putc(sc, '['); + genkbd_putc(sc, 'Z'); continue; } } @@ -763,24 +791,24 @@ genkbd_event(keyboard_t *kbd, int event, void *arg) /* normal chars, normal chars with the META, function keys */ switch (KEYFLAGS(c)) { case 0: /* a normal char */ - putc(KEYCHAR(c), &sc->gkb_q); + genkbd_putc(sc, KEYCHAR(c)); break; case MKEY: /* the META flag: prepend ESC */ - putc(0x1b, &sc->gkb_q); - putc(KEYCHAR(c), &sc->gkb_q); + genkbd_putc(sc, 0x1b); + genkbd_putc(sc, KEYCHAR(c)); break; case FKEY | SPCLKEY: /* a function key, return string */ cp = kbdd_get_fkeystr(kbd, KEYCHAR(c), &len); if (cp != NULL) { while (len-- > 0) - putc(*cp++, &sc->gkb_q); + genkbd_putc(sc, *cp++); } break; } } /* wake up sleeping/polling processes */ - if (sc->gkb_q.c_cc > 0) { + if (sc->gkb_q_length > 0) { if (sc->gkb_flags & KB_ASLEEP) { sc->gkb_flags &= ~KB_ASLEEP; wakeup(sc); diff --git a/sys/dev/kbdmux/kbdmux.c b/sys/dev/kbdmux/kbdmux.c index ac6095c..0f1fe42 100644 --- a/sys/dev/kbdmux/kbdmux.c +++ b/sys/dev/kbdmux/kbdmux.c @@ -36,7 +36,6 @@ #include <sys/param.h> #include <sys/bus.h> -#include <sys/clist.h> #include <sys/conf.h> #include <sys/consio.h> #include <sys/fcntl.h> @@ -134,7 +133,9 @@ typedef struct kbdmux_kbd kbdmux_kbd_t; */ struct kbdmux_state { - struct clist ks_inq; /* input chars queue */ + char ks_inq[KBDMUX_Q_SIZE]; /* input chars queue */ + unsigned int ks_inq_start; + unsigned int ks_inq_length; struct task ks_task; /* interrupt task */ struct callout ks_timo; /* timeout handler */ #define TICKS (hz) /* rate */ @@ -167,6 +168,34 @@ static task_fn_t kbdmux_kbd_intr; static timeout_t kbdmux_kbd_intr_timo; static kbd_callback_func_t kbdmux_kbd_event; +static void +kbdmux_kbd_putc(kbdmux_state_t *state, char c) +{ + unsigned int p; + + if (state->ks_inq_length == KBDMUX_Q_SIZE) + return; + + p = (state->ks_inq_start + state->ks_inq_length) % KBDMUX_Q_SIZE; + state->ks_inq[p] = c; + state->ks_inq_length++; +} + +static char +kbdmux_kbd_getc(kbdmux_state_t *state) +{ + char c; + + if (state->ks_inq_length == 0) + return (-1); + + c = state->ks_inq[state->ks_inq_start]; + state->ks_inq_start = (state->ks_inq_start + 1) % KBDMUX_Q_SIZE; + state->ks_inq_length--; + + return (c); +} + /* * Interrupt handler task */ @@ -205,7 +234,7 @@ kbdmux_kbd_intr_timo(void *xstate) callout_deactivate(&state->ks_timo); /* queue interrupt task if needed */ - if (state->ks_inq.c_cc > 0 && !(state->ks_flags & TASK) && + if (state->ks_inq_length > 0 && !(state->ks_flags & TASK) && KBDMUX_QUEUE_INTR(state) == 0) state->ks_flags |= TASK; @@ -246,11 +275,11 @@ kbdmux_kbd_event(keyboard_t *kbd, int event, void *arg) if (!KBD_IS_BUSY(kbd)) continue; /* not open - discard the input */ - putc(c, &state->ks_inq); + kbdmux_kbd_putc(state, c); } /* queue interrupt task if needed */ - if (state->ks_inq.c_cc > 0 && !(state->ks_flags & TASK) && + if (state->ks_inq_length > 0 && !(state->ks_flags & TASK) && KBDMUX_QUEUE_INTR(state) == 0) state->ks_flags |= TASK; @@ -384,8 +413,6 @@ kbdmux_init(int unit, keyboard_t **kbdp, void *arg, int flags) } KBDMUX_LOCK_INIT(state); - clist_alloc_cblocks(&state->ks_inq, - KBDMUX_Q_SIZE, KBDMUX_Q_SIZE / 2); TASK_INIT(&state->ks_task, 0, kbdmux_kbd_intr, (void *) kbd); KBDMUX_CALLOUT_INIT(state); SLIST_INIT(&state->ks_kbds); @@ -448,10 +475,8 @@ kbdmux_init(int unit, keyboard_t **kbdp, void *arg, int flags) return (0); bad: if (needfree) { - if (state != NULL) { - clist_free_cblocks(&state->ks_inq); + if (state != NULL) free(state, M_KBDMUX); - } if (keymap != NULL) free(keymap, M_KBDMUX); if (accmap != NULL) @@ -495,10 +520,6 @@ kbdmux_term(keyboard_t *kbd) free(k, M_KBDMUX); } - /* flush input queue */ - ndflush(&state->ks_inq, state->ks_inq.c_cc); - clist_free_cblocks(&state->ks_inq); - KBDMUX_UNLOCK(state); kbd_unregister(kbd); @@ -577,7 +598,7 @@ kbdmux_read(keyboard_t *kbd, int wait) int c; KBDMUX_LOCK(state); - c = getc(&state->ks_inq); + c = kbdmux_kbd_getc(state); KBDMUX_UNLOCK(state); if (c != -1) @@ -599,7 +620,7 @@ kbdmux_check(keyboard_t *kbd) return (FALSE); KBDMUX_LOCK(state); - ready = (state->ks_inq.c_cc > 0)? TRUE : FALSE; + ready = (state->ks_inq_length > 0) ? TRUE : FALSE; KBDMUX_UNLOCK(state); return (ready); @@ -635,7 +656,7 @@ next_code: } /* see if there is something in the keyboard queue */ - scancode = getc(&state->ks_inq); + scancode = kbdmux_kbd_getc(state); if (scancode == -1) { if (state->ks_flags & POLLING) { kbdmux_kbd_t *k; @@ -650,11 +671,11 @@ next_code: if (!KBD_IS_BUSY(k->kbd)) continue; - putc(scancode, &state->ks_inq); + kbdmux_kbd_putc(state, scancode); } } - if (state->ks_inq.c_cc > 0) + if (state->ks_inq_length > 0) goto next_code; } @@ -895,7 +916,7 @@ kbdmux_check_char(keyboard_t *kbd) if (!(state->ks_flags & COMPOSE) && (state->ks_composed_char != 0)) ready = TRUE; else - ready = (state->ks_inq.c_cc > 0)? TRUE : FALSE; + ready = (state->ks_inq_length > 0) ? TRUE : FALSE; KBDMUX_UNLOCK(state); @@ -1219,8 +1240,7 @@ kbdmux_clear_state_locked(kbdmux_state_t *state) state->ks_accents = 0; state->ks_composed_char = 0; /* state->ks_prefix = 0; XXX */ - - ndflush(&state->ks_inq, state->ks_inq.c_cc); + state->ks_inq_length = 0; } static void diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 667072f..63d9cee 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$"); #include "pci_if.h" #ifdef __HAVE_ACPI -#include <contrib/dev/acpica/include/acpi.h> +#include <contrib/dev/acpica/acpi.h> #include "acpi_if.h" #else #define ACPI_PWR_FOR_SLEEP(x, y, z) diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index c2f3b80..cff13f6 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -97,7 +97,7 @@ SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, default_channels, CTLFLAG_RW, #define MAKE_WORD(h,l) (((h) << 8) | (l)) #define BIT_TEST(bm,bno) (((bm)[(bno) / 8] >> (7 - ((bno) % 8))) & 1) -#define UAUDIO_MAX_CHAN(x) (((x) < 2) ? (x) : 2) /* XXX fixme later */ +#define UAUDIO_MAX_CHAN(x) (x) struct uaudio_mixer_node { int32_t minval; @@ -940,6 +940,8 @@ uaudio_chan_fill_info_sub(struct uaudio_softc *sc, struct usb_device *udev, bChannels = UAUDIO_MAX_CHAN(asf1d->bNrChannels); bBitResolution = asf1d->bBitResolution; + DPRINTFN(9, "bChannels=%u\n", bChannels); + if (asf1d->bSamFreqType == 0) { DPRINTFN(16, "Sample rate: %d-%dHz\n", UA_SAMP_LO(asf1d), UA_SAMP_HI(asf1d)); diff --git a/sys/dev/usb/input/ukbd.c b/sys/dev/usb/input/ukbd.c index 836cedf..2f98ebd 100644 --- a/sys/dev/usb/input/ukbd.c +++ b/sys/dev/usb/input/ukbd.c @@ -706,7 +706,6 @@ ukbd_attach(device_t dev) sc->sc_iface_index = uaa->info.bIfaceIndex; sc->sc_iface_no = uaa->info.bIfaceNum; sc->sc_mode = K_XLATE; - sc->sc_iface = uaa->iface; usb2_callout_init_mtx(&sc->sc_callout, &Giant, 0); diff --git a/sys/fs/devfs/devfs_devs.c b/sys/fs/devfs/devfs_devs.c index 4041911..c4b9713 100644 --- a/sys/fs/devfs/devfs_devs.c +++ b/sys/fs/devfs/devfs_devs.c @@ -28,8 +28,6 @@ * $FreeBSD$ */ -#include "opt_mac.h" - #include <sys/param.h> #include <sys/systm.h> #include <sys/conf.h> diff --git a/sys/fs/devfs/devfs_vfsops.c b/sys/fs/devfs/devfs_vfsops.c index d88f49c..ff86e36 100644 --- a/sys/fs/devfs/devfs_vfsops.c +++ b/sys/fs/devfs/devfs_vfsops.c @@ -34,8 +34,6 @@ * $FreeBSD$ */ -#include "opt_mac.h" /* To set MNT_MULTILABEL. */ - #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index c637ea8..46d7942 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -40,8 +40,6 @@ * mkdir: want it ? */ -#include "opt_mac.h" - #include <sys/param.h> #include <sys/systm.h> #include <sys/conf.h> diff --git a/sys/fs/nfs/nfs_commonacl.c b/sys/fs/nfs/nfs_commonacl.c index 13d9043..99d796e 100644 --- a/sys/fs/nfs/nfs_commonacl.c +++ b/sys/fs/nfs/nfs_commonacl.c @@ -703,10 +703,6 @@ nfsrv_setacl(vnode_t vp, NFSACL_T *aclp, struct ucred *cred, if (aclp->acl_cnt > (ACL_MAX_ENTRIES - 6) / 2) return (NFSERR_ATTRNOTSUPP); error = VOP_ACLCHECK(vp, ACL_TYPE_NFS4, aclp, cred, p); -#ifdef MAC - if (!error) - error = mac_check_vnode_setacl(cred, vp, ACL_TYPE_NFS4, aclp); -#endif if (!error) error = VOP_SETACL(vp, ACL_TYPE_NFS4, aclp, cred, p); return (error); diff --git a/sys/fs/nfsserver/nfs_nfsdkrpc.c b/sys/fs/nfsserver/nfs_nfsdkrpc.c index e117955..b3efc05 100644 --- a/sys/fs/nfsserver/nfs_nfsdkrpc.c +++ b/sys/fs/nfsserver/nfs_nfsdkrpc.c @@ -42,6 +42,8 @@ __FBSDID("$FreeBSD$"); #include <rpc/rpc.h> #include <rpc/rpcsec_gss.h> +#include <security/mac/mac_framework.h> + NFSDLOCKMUTEX; /* diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c index 69165e3..bfcbdcd 100644 --- a/sys/fs/unionfs/union_subr.c +++ b/sys/fs/unionfs/union_subr.c @@ -52,9 +52,7 @@ #include <sys/stat.h> #include <sys/resourcevar.h> -#ifdef MAC -#include <sys/mac.h> -#endif +#include <security/mac/mac_framework.h> #include <vm/uma.h> diff --git a/sys/i386/acpica/OsdEnvironment.c b/sys/i386/acpica/OsdEnvironment.c index ec5e19c..61f5532 100644 --- a/sys/i386/acpica/OsdEnvironment.c +++ b/sys/i386/acpica/OsdEnvironment.c @@ -36,8 +36,8 @@ __FBSDID("$FreeBSD$"); #include <sys/linker_set.h> #include <sys/sysctl.h> -#include <contrib/dev/acpica/include/acpi.h> -#include <contrib/dev/acpica/include/actables.h> +#include <contrib/dev/acpica/acpi.h> +#include <contrib/dev/acpica/actables.h> static u_long i386_acpi_root; @@ -63,7 +63,7 @@ AcpiOsGetRootPointer(void) if (i386_acpi_root == 0 && (resource_long_value("acpi", 0, "rsdp", (long *)&ptr) == 0 || - AcpiFindRootPointer((ACPI_SIZE *)&ptr) == AE_OK) && + AcpiFindRootPointer((ACPI_NATIVE_UINT *)&ptr) == AE_OK) && ptr != 0) i386_acpi_root = ptr; diff --git a/sys/i386/acpica/acpi_machdep.c b/sys/i386/acpica/acpi_machdep.c index f60bcfe..4d31b44 100644 --- a/sys/i386/acpica/acpi_machdep.c +++ b/sys/i386/acpica/acpi_machdep.c @@ -41,8 +41,7 @@ __FBSDID("$FreeBSD$"); #include <vm/vm.h> #include <vm/pmap.h> -#include <contrib/dev/acpica/include/acpi.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #include <dev/acpica/acpiio.h> diff --git a/sys/i386/acpica/acpi_wakeup.c b/sys/i386/acpica/acpi_wakeup.c index af8d4b2..e5047b5 100644 --- a/sys/i386/acpica/acpi_wakeup.c +++ b/sys/i386/acpica/acpi_wakeup.c @@ -47,8 +47,7 @@ __FBSDID("$FreeBSD$"); #include <machine/intr_machdep.h> #include <machine/segments.h> -#include <contrib/dev/acpica/include/acpi.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #include "acpi_wakecode.h" diff --git a/sys/i386/acpica/madt.c b/sys/i386/acpica/madt.c index f9756ec..e604829 100644 --- a/sys/i386/acpica/madt.c +++ b/sys/i386/acpica/madt.c @@ -48,10 +48,8 @@ __FBSDID("$FreeBSD$"); #include <machine/md_var.h> #include <machine/specialreg.h> -#include <contrib/dev/acpica/include/acpi.h> -#include <contrib/dev/acpica/include/accommon.h> -#include <contrib/dev/acpica/include/actables.h> - +#include <contrib/dev/acpica/acpi.h> +#include <contrib/dev/acpica/actables.h> #include <dev/acpica/acpivar.h> #include <dev/pci/pcivar.h> diff --git a/sys/i386/cpufreq/est.c b/sys/i386/cpufreq/est.c index 2c6fd2c..a8cebd0 100644 --- a/sys/i386/cpufreq/est.c +++ b/sys/i386/cpufreq/est.c @@ -43,8 +43,7 @@ __FBSDID("$FreeBSD$"); #include <machine/md_var.h> #include <machine/specialreg.h> -#include <contrib/dev/acpica/include/acpi.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #include "acpi_if.h" diff --git a/sys/i386/cpufreq/hwpstate.c b/sys/i386/cpufreq/hwpstate.c index f46080d..7e024a3 100644 --- a/sys/i386/cpufreq/hwpstate.c +++ b/sys/i386/cpufreq/hwpstate.c @@ -61,8 +61,7 @@ __FBSDID("$FreeBSD$"); #include <machine/cputypes.h> #include <machine/specialreg.h> -#include <contrib/dev/acpica/include/acpi.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #include "acpi_if.h" diff --git a/sys/i386/cpufreq/p4tcc.c b/sys/i386/cpufreq/p4tcc.c index 29279e3..a33be87 100644 --- a/sys/i386/cpufreq/p4tcc.c +++ b/sys/i386/cpufreq/p4tcc.c @@ -51,8 +51,7 @@ __FBSDID("$FreeBSD$"); #include "cpufreq_if.h" -#include <contrib/dev/acpica/include/acpi.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #include "acpi_if.h" diff --git a/sys/i386/i386/sys_machdep.c b/sys/i386/i386/sys_machdep.c index a6bcbd2..87b563d 100644 --- a/sys/i386/i386/sys_machdep.c +++ b/sys/i386/i386/sys_machdep.c @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include "opt_kstack_pages.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/i386/ibcs2/ibcs2_misc.c b/sys/i386/ibcs2/ibcs2_misc.c index 7faf675..1906fd7 100644 --- a/sys/i386/ibcs2/ibcs2_misc.c +++ b/sys/i386/ibcs2/ibcs2_misc.c @@ -55,8 +55,6 @@ __FBSDID("$FreeBSD$"); * IBCS2 system calls that are implemented differently in BSD are * handled here. */ -#include "opt_mac.h" - #include <sys/param.h> #include <sys/systm.h> #include <sys/dirent.h> diff --git a/sys/ia64/acpica/OsdEnvironment.c b/sys/ia64/acpica/OsdEnvironment.c index 209e343..9345eff 100644 --- a/sys/ia64/acpica/OsdEnvironment.c +++ b/sys/ia64/acpica/OsdEnvironment.c @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); #include <sys/sysctl.h> #include <machine/efi.h> -#include <contrib/dev/acpica/include/acpi.h> +#include <contrib/dev/acpica/acpi.h> static struct uuid acpi_root_uuid = EFI_TABLE_ACPI20; diff --git a/sys/ia64/acpica/acpi_machdep.c b/sys/ia64/acpica/acpi_machdep.c index e5623fb..9426dd0 100644 --- a/sys/ia64/acpica/acpi_machdep.c +++ b/sys/ia64/acpica/acpi_machdep.c @@ -29,8 +29,7 @@ #include <sys/param.h> #include <sys/bus.h> -#include <contrib/dev/acpica/include/acpi.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #include <machine/pal.h> diff --git a/sys/ia64/acpica/acpi_wakeup.c b/sys/ia64/acpica/acpi_wakeup.c index c81c3b3..3003a57f 100644 --- a/sys/ia64/acpica/acpi_wakeup.c +++ b/sys/ia64/acpica/acpi_wakeup.c @@ -29,8 +29,7 @@ #include <sys/param.h> #include <sys/bus.h> -#include <contrib/dev/acpica/include/acpi.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> int diff --git a/sys/ia64/acpica/madt.c b/sys/ia64/acpica/madt.c index 2543088..50b53b8 100644 --- a/sys/ia64/acpica/madt.c +++ b/sys/ia64/acpica/madt.c @@ -26,8 +26,8 @@ * $FreeBSD$ */ -#include <contrib/dev/acpica/include/acpi.h> -#include <contrib/dev/acpica/include/actables.h> +#include <contrib/dev/acpica/acpi.h> +#include <contrib/dev/acpica/actables.h> #include <machine/md_var.h> diff --git a/sys/ia64/ia64/nexus.c b/sys/ia64/ia64/nexus.c index 502dc72..a069399 100644 --- a/sys/ia64/ia64/nexus.c +++ b/sys/ia64/ia64/nexus.c @@ -62,8 +62,7 @@ #include <machine/sapicvar.h> #include <machine/vmparam.h> -#include <contrib/dev/acpica/include/acpi.h> - +#include <contrib/dev/acpica/acpi.h> #include <dev/acpica/acpivar.h> #include <isa/isareg.h> diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 1f412c6..98c2b83 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include "opt_init_path.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/kernel.h> diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c index a7ddb17..7ec74a2 100644 --- a/sys/kern/kern_acct.c +++ b/sys/kern/kern_acct.c @@ -70,8 +70,6 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include <sys/param.h> #include <sys/systm.h> #include <sys/acct.h> diff --git a/sys/kern/kern_alq.c b/sys/kern/kern_alq.c index 9f37244..5296928 100644 --- a/sys/kern/kern_alq.c +++ b/sys/kern/kern_alq.c @@ -27,8 +27,6 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> diff --git a/sys/kern/kern_environment.c b/sys/kern/kern_environment.c index 038515b..fc0039a 100644 --- a/sys/kern/kern_environment.c +++ b/sys/kern/kern_environment.c @@ -37,8 +37,6 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include <sys/types.h> #include <sys/param.h> #include <sys/proc.h> diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index f36f803..fcd8530 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include "opt_hwpmc_hooks.h" #include "opt_kdtrace.h" #include "opt_ktrace.h" -#include "opt_mac.h" #include "opt_vm.h" #include <sys/param.h> diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 575fe9b..e24d7ea 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include "opt_kdtrace.h" #include "opt_ktrace.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 0c16c3f..43afbbf 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include "opt_kdtrace.h" #include "opt_ktrace.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index b6a6d56..7a8a090 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/types.h> diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 6e680fb..7506b6f 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ktrace.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index f032d43..fbfd6cf 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include "opt_hwpmc_hooks.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/kernel.h> diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index e699a4e..51045ee 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -675,8 +675,8 @@ malloc_init(void *data) KASSERT(cnt.v_page_count != 0, ("malloc_register before vm_init")); mtp = data; - KASSERT(mtp->ks_magic == M_MAGIC, - ("malloc_init: bad malloc type magic")); + if (mtp->ks_magic != M_MAGIC) + panic("malloc_init: bad malloc type magic"); mtip = uma_zalloc(mt_zone, M_WAITOK | M_ZERO); mtp->ks_handle = mtip; @@ -709,9 +709,13 @@ malloc_uninit(void *data) if (mtp != kmemstatistics) { for (temp = kmemstatistics; temp != NULL; temp = temp->ks_next) { - if (temp->ks_next == mtp) + if (temp->ks_next == mtp) { temp->ks_next = mtp->ks_next; + break; + } } + KASSERT(temp, + ("malloc_uninit: type '%s' not found", mtp->ks_shortdesc)); } else kmemstatistics = mtp->ks_next; kmemcount--; diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c index 26b0250..58fa314 100644 --- a/sys/kern/kern_mbuf.c +++ b/sys/kern/kern_mbuf.c @@ -28,7 +28,6 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include "opt_mac.h" #include "opt_param.h" #include <sys/param.h> diff --git a/sys/kern/kern_priv.c b/sys/kern/kern_priv.c index 6dd7d4b..352e502 100644 --- a/sys/kern/kern_priv.c +++ b/sys/kern/kern_priv.c @@ -29,7 +29,6 @@ */ #include "opt_kdtrace.h" -#include "opt_mac.h" #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 4e0bdf0..5deff69 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index 3fc2e72..158b92a 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include "opt_kdb.h" -#include "opt_mac.h" #include "opt_panic.h" #include "opt_show_busybufs.h" #include "opt_sched.h" diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index d65041a..a9c2a33 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include "opt_ktrace.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index 5ab1ce5..57f0206 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include "opt_gdb.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c index 60c89d6..707c580 100644 --- a/sys/kern/link_elf_obj.c +++ b/sys/kern/link_elf_obj.c @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/kern/subr_clist.c b/sys/kern/subr_clist.c deleted file mode 100644 index 3baea99..0000000 --- a/sys/kern/subr_clist.c +++ /dev/null @@ -1,464 +0,0 @@ -/*- - * Copyright (c) 1994, David Greenman - * 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 unmodified, 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. - */ - -/* - * clist support routines - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/param.h> -#include <sys/kernel.h> -#include <sys/systm.h> -#include <sys/malloc.h> -#include <sys/clist.h> - -static MALLOC_DEFINE(M_CLIST, "clist", "clist queue blocks"); - -static struct cblock *cfreelist = NULL; - -static struct cblock *cblock_alloc(void); -static void cblock_alloc_cblocks(int number); -static void cblock_free(struct cblock *cblockp); -static void cblock_free_cblocks(int number); - -/* - * Remove a cblock from the cfreelist queue and return a pointer - * to it. - */ -static __inline struct cblock * -cblock_alloc(void) -{ - struct cblock *cblockp; - - cblockp = cfreelist; - if (cblockp == NULL) - panic("clist reservation botch"); - cfreelist = cblockp->c_next; - cblockp->c_next = NULL; - return (cblockp); -} - -/* - * Add a cblock to the cfreelist queue. - */ -static __inline void -cblock_free(struct cblock *cblockp) -{ - cblockp->c_next = cfreelist; - cfreelist = cblockp; -} - -/* - * Allocate some cblocks for the cfreelist queue. - */ -static void -cblock_alloc_cblocks(int number) -{ - int i; - struct cblock *cbp; - - for (i = 0; i < number; ++i) { - cbp = malloc(sizeof *cbp, M_CLIST, M_WAITOK); - cblock_free(cbp); - } -} - -/* - * Set the cblock allocation policy for a clist. - * Must be called in process context at spltty(). - */ -void -clist_alloc_cblocks(struct clist *clistp, int ccmax, int ccreserved) -{ - int dcbr; - - /* - * Allow for wasted space at the head. - */ - if (ccmax != 0) - ccmax += CBSIZE - 1; - if (ccreserved != 0) - ccreserved += CBSIZE - 1; - - clistp->c_cbmax = roundup(ccmax, CBSIZE) / CBSIZE; - dcbr = roundup(ccreserved, CBSIZE) / CBSIZE - clistp->c_cbreserved; - if (dcbr >= 0) - cblock_alloc_cblocks(dcbr); - else { - if (clistp->c_cbreserved + dcbr < clistp->c_cbcount) - dcbr = clistp->c_cbcount - clistp->c_cbreserved; - cblock_free_cblocks(-dcbr); - } - clistp->c_cbreserved += dcbr; -} - -/* - * Free some cblocks from the cfreelist queue back to the - * system malloc pool. - */ -static void -cblock_free_cblocks(int number) -{ - int i; - - for (i = 0; i < number; ++i) - free(cblock_alloc(), M_CLIST); -} - -/* - * Free the cblocks reserved for a clist. - * Must be called at spltty(). - */ -void -clist_free_cblocks(struct clist *clistp) -{ - if (clistp->c_cbcount != 0) - panic("freeing active clist cblocks"); - cblock_free_cblocks(clistp->c_cbreserved); - clistp->c_cbmax = 0; - clistp->c_cbreserved = 0; -} - -/* - * Get a character from the head of a clist. - */ -int -getc(struct clist *clistp) -{ - int chr = -1; - int s; - struct cblock *cblockp; - - s = spltty(); - - /* If there are characters in the list, get one */ - if (clistp->c_cc) { - cblockp = (struct cblock *)((intptr_t)clistp->c_cf & ~CROUND); - chr = (u_char)*clistp->c_cf; - - /* - * Advance to next character. - */ - clistp->c_cf++; - clistp->c_cc--; - /* - * If we have advanced the 'first' character pointer - * past the end of this cblock, advance to the next one. - * If there are no more characters, set the first and - * last pointers to NULL. In either case, free the - * current cblock. - */ - if ((clistp->c_cf >= (char *)(cblockp+1)) || (clistp->c_cc == 0)) { - if (clistp->c_cc > 0) { - clistp->c_cf = cblockp->c_next->c_info; - } else { - clistp->c_cf = clistp->c_cl = NULL; - } - cblock_free(cblockp); - --clistp->c_cbcount; - } - } - - splx(s); - return (chr); -} - -/* - * Copy 'amount' of chars, beginning at head of clist 'clistp' to - * destination linear buffer 'dest'. Return number of characters - * actually copied. - */ -int -q_to_b(struct clist *clistp, char *dest, int amount) -{ - struct cblock *cblockp; - struct cblock *cblockn; - char *dest_orig = dest; - int numc; - int s; - - s = spltty(); - - while (clistp && amount && (clistp->c_cc > 0)) { - cblockp = (struct cblock *)((intptr_t)clistp->c_cf & ~CROUND); - cblockn = cblockp + 1; /* pointer arithmetic! */ - numc = min(amount, (char *)cblockn - clistp->c_cf); - numc = min(numc, clistp->c_cc); - bcopy(clistp->c_cf, dest, numc); - amount -= numc; - clistp->c_cf += numc; - clistp->c_cc -= numc; - dest += numc; - /* - * If this cblock has been emptied, advance to the next - * one. If there are no more characters, set the first - * and last pointer to NULL. In either case, free the - * current cblock. - */ - if ((clistp->c_cf >= (char *)cblockn) || (clistp->c_cc == 0)) { - if (clistp->c_cc > 0) { - clistp->c_cf = cblockp->c_next->c_info; - } else { - clistp->c_cf = clistp->c_cl = NULL; - } - cblock_free(cblockp); - --clistp->c_cbcount; - } - } - - splx(s); - return (dest - dest_orig); -} - -/* - * Flush 'amount' of chars, beginning at head of clist 'clistp'. - */ -void -ndflush(struct clist *clistp, int amount) -{ - struct cblock *cblockp; - struct cblock *cblockn; - int numc; - int s; - - s = spltty(); - - while (amount && (clistp->c_cc > 0)) { - cblockp = (struct cblock *)((intptr_t)clistp->c_cf & ~CROUND); - cblockn = cblockp + 1; /* pointer arithmetic! */ - numc = min(amount, (char *)cblockn - clistp->c_cf); - numc = min(numc, clistp->c_cc); - amount -= numc; - clistp->c_cf += numc; - clistp->c_cc -= numc; - /* - * If this cblock has been emptied, advance to the next - * one. If there are no more characters, set the first - * and last pointer to NULL. In either case, free the - * current cblock. - */ - if ((clistp->c_cf >= (char *)cblockn) || (clistp->c_cc == 0)) { - if (clistp->c_cc > 0) { - clistp->c_cf = cblockp->c_next->c_info; - } else { - clistp->c_cf = clistp->c_cl = NULL; - } - cblock_free(cblockp); - --clistp->c_cbcount; - } - } - - splx(s); -} - -/* - * Add a character to the end of a clist. Return -1 is no - * more clists, or 0 for success. - */ -int -putc(char chr, struct clist *clistp) -{ - struct cblock *cblockp; - int s; - - s = spltty(); - - if (clistp->c_cl == NULL) { - if (clistp->c_cbreserved < 1) { - splx(s); - printf("putc to a clist with no reserved cblocks\n"); - return (-1); /* nothing done */ - } - cblockp = cblock_alloc(); - clistp->c_cbcount = 1; - clistp->c_cf = clistp->c_cl = cblockp->c_info; - clistp->c_cc = 0; - } else { - cblockp = (struct cblock *)((intptr_t)clistp->c_cl & ~CROUND); - if (((intptr_t)clistp->c_cl & CROUND) == 0) { - struct cblock *prev = (cblockp - 1); - - if (clistp->c_cbcount >= clistp->c_cbreserved) { - splx(s); - return (-1); - } - cblockp = cblock_alloc(); - clistp->c_cbcount++; - prev->c_next = cblockp; - clistp->c_cl = cblockp->c_info; - } - } - - *clistp->c_cl++ = chr; - clistp->c_cc++; - - splx(s); - return (0); -} - -/* - * Copy data from linear buffer to clist chain. Return the - * number of characters not copied. - */ -int -b_to_q(char *src, int amount, struct clist *clistp) -{ - struct cblock *cblockp; - int numc, s; - - /* - * Avoid allocating an initial cblock and then not using it. - * c_cc == 0 must imply c_cbount == 0. - */ - if (amount <= 0) - return (amount); - - s = spltty(); - - /* - * If there are no cblocks assigned to this clist yet, - * then get one. - */ - if (clistp->c_cl == NULL) { - if (clistp->c_cbreserved < 1) { - splx(s); - printf("b_to_q to a clist with no reserved cblocks.\n"); - return (amount); /* nothing done */ - } - cblockp = cblock_alloc(); - clistp->c_cbcount = 1; - clistp->c_cf = clistp->c_cl = cblockp->c_info; - clistp->c_cc = 0; - } else { - cblockp = (struct cblock *)((intptr_t)clistp->c_cl & ~CROUND); - } - - while (amount) { - /* - * Get another cblock if needed. - */ - if (((intptr_t)clistp->c_cl & CROUND) == 0) { - struct cblock *prev = cblockp - 1; - - if (clistp->c_cbcount >= clistp->c_cbreserved) { - splx(s); - return (amount); - } - cblockp = cblock_alloc(); - clistp->c_cbcount++; - prev->c_next = cblockp; - clistp->c_cl = cblockp->c_info; - } - - /* - * Copy a chunk of the linear buffer up to the end - * of this cblock. - */ - numc = min(amount, (char *)(cblockp + 1) - clistp->c_cl); - bcopy(src, clistp->c_cl, numc); - - /* - * ...and update pointer for the next chunk. - */ - src += numc; - clistp->c_cl += numc; - clistp->c_cc += numc; - amount -= numc; - /* - * If we go through the loop again, it's always - * for data in the next cblock, so by adding one (cblock), - * (which makes the pointer 1 beyond the end of this - * cblock) we prepare for the assignment of 'prev' - * above. - */ - cblockp += 1; - - } - - splx(s); - return (amount); -} - -/* - * "Unput" a character from a clist. - */ -int -unputc(struct clist *clistp) -{ - struct cblock *cblockp = NULL, *cbp = NULL; - int s; - int chr = -1; - - - s = spltty(); - - if (clistp->c_cc) { - --clistp->c_cc; - --clistp->c_cl; - - chr = (u_char)*clistp->c_cl; - - cblockp = (struct cblock *)((intptr_t)clistp->c_cl & ~CROUND); - - /* - * If all of the characters have been unput in this - * cblock, then find the previous one and free this - * one. - */ - if (clistp->c_cc && (clistp->c_cl <= (char *)cblockp->c_info)) { - cbp = (struct cblock *)((intptr_t)clistp->c_cf & ~CROUND); - - while (cbp->c_next != cblockp) - cbp = cbp->c_next; - - /* - * When the previous cblock is at the end, the 'last' - * pointer always points (invalidly) one past. - */ - clistp->c_cl = (char *)(cbp+1); - cblock_free(cblockp); - --clistp->c_cbcount; - cbp->c_next = NULL; - } - } - - /* - * If there are no more characters on the list, then - * free the last cblock. - */ - if ((clistp->c_cc == 0) && clistp->c_cl) { - cblockp = (struct cblock *)((intptr_t)clistp->c_cl & ~CROUND); - cblock_free(cblockp); - --clistp->c_cbcount; - clistp->c_cf = clistp->c_cl = NULL; - } - - splx(s); - return (chr); -} diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index ba54524..0f4636e 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ktrace.h" -#include "opt_mac.h" #ifdef __i386__ #include "opt_npx.h" #endif diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index fb6b35d..ed48e54 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -91,8 +91,6 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include <sys/param.h> #include <sys/systm.h> #include <sys/fcntl.h> diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index 5e5695c..93da80d 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -32,8 +32,6 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include <sys/param.h> #include <sys/systm.h> #include <sys/file.h> diff --git a/sys/kern/sysv_msg.c b/sys/kern/sysv_msg.c index 2a2a3d0..89de07c 100644 --- a/sys/kern/sysv_msg.c +++ b/sys/kern/sysv_msg.c @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include "opt_sysvipc.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c index a99cf4e..fa60acf 100644 --- a/sys/kern/sysv_sem.c +++ b/sys/kern/sysv_sem.c @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include "opt_sysvipc.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index b374b5c..b59aea5 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -64,7 +64,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include "opt_sysvipc.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index ea53885..a5ddd88 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -32,7 +32,6 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include "opt_mac.h" #include "opt_param.h" #include "opt_mbuf_stress_test.h" #include "opt_mbuf_profiling.h" diff --git a/sys/kern/uipc_mbuf2.c b/sys/kern/uipc_mbuf2.c index 6fe83b0..3dc4238 100644 --- a/sys/kern/uipc_mbuf2.c +++ b/sys/kern/uipc_mbuf2.c @@ -65,8 +65,6 @@ __FBSDID("$FreeBSD$"); /*#define PULLDOWN_DEBUG*/ -#include "opt_mac.h" - #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> diff --git a/sys/kern/uipc_sem.c b/sys/kern/uipc_sem.c index da233a6..5ca13f8 100644 --- a/sys/kern/uipc_sem.c +++ b/sys/kern/uipc_sem.c @@ -34,7 +34,6 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include "opt_mac.h" #include "opt_posix.h" #include <sys/param.h> diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c index 00fb438..3819154 100644 --- a/sys/kern/uipc_shm.c +++ b/sys/kern/uipc_shm.c @@ -55,8 +55,6 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include <sys/param.h> #include <sys/fcntl.h> #include <sys/file.h> diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 7341d3f..3367957 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -99,7 +99,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_mac.h" #include "opt_zero.h" #include "opt_compat.h" diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 964547c..4dfaf84 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include "opt_sctp.h" #include "opt_compat.h" #include "opt_ktrace.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index c9e7d39..a8fe7ca 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/domain.h> diff --git a/sys/kern/vfs_acl.c b/sys/kern/vfs_acl.c index dfbff09..ce1fa33 100644 --- a/sys/kern/vfs_acl.c +++ b/sys/kern/vfs_acl.c @@ -35,8 +35,6 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include <sys/param.h> #include <sys/systm.h> #include <sys/sysproto.h> diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 45ffe0d..0bd7975 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -1140,8 +1140,10 @@ vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir, error = vn_vptocnp_locked(&vp, buf, &buflen); if (error) return (error); - if (buflen == 0) + if (buflen == 0) { + CACHE_RUNLOCK(); return (ENOMEM); + } buf[--buflen] = '/'; slash_prefixed = 1; } @@ -1169,6 +1171,7 @@ vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir, if (error) break; if (buflen == 0) { + CACHE_RUNLOCK(); error = ENOMEM; SDT_PROBE(vfs, namecache, fullpath, return, error, startvp, NULL, 0, 0); diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index 5e5c2da..7b82a96 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD$"); #include <sys/dirent.h> #include <sys/poll.h> +#include <security/mac/mac_framework.h> + #include <vm/vm.h> #include <vm/vm_object.h> #include <vm/vm_extern.h> diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c index b75d364..5f024a8 100644 --- a/sys/kern/vfs_extattr.c +++ b/sys/kern/vfs_extattr.c @@ -29,8 +29,6 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include <sys/param.h> #include <sys/systm.h> #include <sys/lock.h> diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index c76bd5b..7847f35 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include "opt_kdtrace.h" #include "opt_ktrace.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 34a167f..19a6026 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -68,7 +68,6 @@ __FBSDID("$FreeBSD$"); #include <security/mac/mac_framework.h> #include "opt_rootdevname.h" -#include "opt_mac.h" #define ROOTNAME "root_device" #define VFS_MOUNTARG_SIZE_MAX (1024 * 64) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 8d694f8..47a5046 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index a99d435..72a53f8 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include "opt_kdtrace.h" #include "opt_ktrace.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 82527a6..702faae 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -37,8 +37,6 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include <sys/param.h> #include <sys/systm.h> #include <sys/fcntl.h> diff --git a/sys/modules/acpi/acpi/Makefile b/sys/modules/acpi/acpi/Makefile index f5ebb27..e6463e4 100644 --- a/sys/modules/acpi/acpi/Makefile +++ b/sys/modules/acpi/acpi/Makefile @@ -8,25 +8,16 @@ .error "The ACPI module is only for i386" .endif -.PATH: ${.CURDIR}/../../../contrib/dev/acpica/debugger \ - ${.CURDIR}/../../../contrib/dev/acpica/disassembler \ - ${.CURDIR}/../../../contrib/dev/acpica/dispatcher \ - ${.CURDIR}/../../../contrib/dev/acpica/events \ - ${.CURDIR}/../../../contrib/dev/acpica/executer \ - ${.CURDIR}/../../../contrib/dev/acpica/hardware \ - ${.CURDIR}/../../../contrib/dev/acpica/namespace \ - ${.CURDIR}/../../../contrib/dev/acpica/parser \ - ${.CURDIR}/../../../contrib/dev/acpica/resources \ - ${.CURDIR}/../../../contrib/dev/acpica/tables \ - ${.CURDIR}/../../../contrib/dev/acpica/utilities \ - ${.CURDIR}/../../../pci \ - ${.CURDIR}/../../../dev/acpica \ - ${.CURDIR}/../../../dev/acpica/Osd \ - ${.CURDIR}/../../../${MACHINE_ARCH}/acpica +.PATH: ${.CURDIR}/../../../contrib/dev/acpica \ + ${.CURDIR}/../../../pci \ + ${.CURDIR}/../../../dev/acpica \ + ${.CURDIR}/../../../dev/acpica/Osd \ + ${.CURDIR}/../../../${MACHINE_ARCH}/acpica KMOD= acpi # ACPI CA sources +CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica SRCS+= dsfield.c dsinit.c dsmethod.c dsmthdat.c dsobject.c dsopcode.c SRCS+= dsutils.c dswexec.c dswload.c dswscope.c dswstate.c SRCS+= evevent.c evgpe.c evgpeblk.c evmisc.c evregion.c evrgnini.c evsci.c @@ -35,17 +26,17 @@ SRCS+= exconfig.c exconvrt.c excreate.c exdump.c exfield.c exfldio.c exmisc.c SRCS+= exmutex.c exnames.c exoparg1.c exoparg2.c exoparg3.c exoparg6.c SRCS+= exprep.c exregion.c exresnte.c exresolv.c exresop.c exstore.c SRCS+= exstoren.c exstorob.c exsystem.c exutils.c -SRCS+= hwacpi.c hwgpe.c hwregs.c hwsleep.c hwtimer.c hwvalid.c hwxface.c +SRCS+= hwacpi.c hwgpe.c hwregs.c hwsleep.c hwtimer.c SRCS+= nsaccess.c nsalloc.c nsdump.c nseval.c nsinit.c nsload.c nsnames.c -SRCS+= nsobject.c nsparse.c nspredef.c nssearch.c nsutils.c nswalk.c -SRCS+= nsxfeval.c nsxfname.c nsxfobj.c +SRCS+= nsobject.c nsparse.c nssearch.c nsutils.c nswalk.c nsxfeval.c +SRCS+= nsxfname.c nsxfobj.c SRCS+= psargs.c psloop.c psopcode.c psparse.c psscope.c pstree.c psutils.c SRCS+= pswalk.c psxface.c SRCS+= rsaddr.c rscalc.c rscreate.c rsdump.c rsinfo.c rsio.c rsirq.c rslist.c SRCS+= rsmemory.c rsmisc.c rsutils.c rsxface.c SRCS+= tbfadt.c tbfind.c tbinstal.c tbutils.c tbxface.c tbxfroot.c -SRCS+= utalloc.c utcache.c utcopy.c utdebug.c utdelete.c uteval.c utglobal.c -SRCS+= utinit.c utlock.c utmath.c utmisc.c utmutex.c utobject.c utresrc.c +SRCS+= utalloc.c utcache.c utclib.c utcopy.c utdebug.c utdelete.c uteval.c +SRCS+= utglobal.c utinit.c utmath.c utmisc.c utmutex.c utobject.c utresrc.c SRCS+= utstate.c utxface.c # OSPM layer and core hardware drivers diff --git a/sys/modules/acpi/acpi_aiboost/Makefile b/sys/modules/acpi/acpi_aiboost/Makefile index e4a96c1..e33b6d3 100644 --- a/sys/modules/acpi/acpi_aiboost/Makefile +++ b/sys/modules/acpi/acpi_aiboost/Makefile @@ -3,6 +3,7 @@ .PATH: ${.CURDIR}/../../../dev/acpi_support KMOD= acpi_aiboost +CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica SRCS= acpi_aiboost.c opt_acpi.h device_if.h bus_if.h acpi_if.h .include <bsd.kmod.mk> diff --git a/sys/modules/acpi/acpi_asus/Makefile b/sys/modules/acpi/acpi_asus/Makefile index 83672d7..da7bcf8 100644 --- a/sys/modules/acpi/acpi_asus/Makefile +++ b/sys/modules/acpi/acpi_asus/Makefile @@ -3,6 +3,7 @@ .PATH: ${.CURDIR}/../../../dev/acpi_support KMOD= acpi_asus +CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica SRCS= acpi_asus.c opt_acpi.h acpi_if.h bus_if.h device_if.h SRCS+= opt_ddb.h diff --git a/sys/modules/acpi/acpi_dock/Makefile b/sys/modules/acpi/acpi_dock/Makefile index efbb973..f7287a4 100644 --- a/sys/modules/acpi/acpi_dock/Makefile +++ b/sys/modules/acpi/acpi_dock/Makefile @@ -2,6 +2,7 @@ .PATH: ${.CURDIR}/../../../dev/acpica KMOD= acpi_dock +CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica SRCS= acpi_dock.c opt_acpi.h device_if.h bus_if.h acpi_if.h SRCS+= opt_ddb.h diff --git a/sys/modules/acpi/acpi_fujitsu/Makefile b/sys/modules/acpi/acpi_fujitsu/Makefile index b77a225..03bf3c7 100644 --- a/sys/modules/acpi/acpi_fujitsu/Makefile +++ b/sys/modules/acpi/acpi_fujitsu/Makefile @@ -3,7 +3,8 @@ .PATH: ${.CURDIR}/../../../dev/acpi_support KMOD= acpi_fujitsu -CFLAGS+=-I${.CURDIR}/../../../dev/acpi_support +CFLAGS+=-I${.CURDIR}/../../../dev/acpi_support \ + -I${.CURDIR}/../../../contrib/dev/acpica SRCS= acpi_fujitsu.c opt_acpi.h acpi_if.h device_if.h bus_if.h .include <bsd.kmod.mk> diff --git a/sys/modules/acpi/acpi_ibm/Makefile b/sys/modules/acpi/acpi_ibm/Makefile index caf0c2b..75c22e7 100644 --- a/sys/modules/acpi/acpi_ibm/Makefile +++ b/sys/modules/acpi/acpi_ibm/Makefile @@ -2,6 +2,7 @@ .PATH: ${.CURDIR}/../../../dev/acpi_support KMOD= acpi_ibm +CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica SRCS= acpi_ibm.c opt_acpi.h device_if.h bus_if.h acpi_if.h SRCS+= opt_ddb.h diff --git a/sys/modules/acpi/acpi_panasonic/Makefile b/sys/modules/acpi/acpi_panasonic/Makefile index 36f8d77..663d3c2 100644 --- a/sys/modules/acpi/acpi_panasonic/Makefile +++ b/sys/modules/acpi/acpi_panasonic/Makefile @@ -3,6 +3,7 @@ .PATH: ${.CURDIR}/../../../dev/acpi_support KMOD= acpi_panasonic +CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica SRCS= acpi_panasonic.c opt_acpi.h acpi_if.h bus_if.h device_if.h .include <bsd.kmod.mk> diff --git a/sys/modules/acpi/acpi_sony/Makefile b/sys/modules/acpi/acpi_sony/Makefile index 027afef..3974094 100644 --- a/sys/modules/acpi/acpi_sony/Makefile +++ b/sys/modules/acpi/acpi_sony/Makefile @@ -3,6 +3,7 @@ .PATH: ${.CURDIR}/../../../dev/acpi_support KMOD= acpi_sony +CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica SRCS= acpi_sony.c opt_acpi.h device_if.h bus_if.h acpi_if.h .include <bsd.kmod.mk> diff --git a/sys/modules/acpi/acpi_toshiba/Makefile b/sys/modules/acpi/acpi_toshiba/Makefile index 1207015..24df091 100644 --- a/sys/modules/acpi/acpi_toshiba/Makefile +++ b/sys/modules/acpi/acpi_toshiba/Makefile @@ -3,6 +3,7 @@ .PATH: ${.CURDIR}/../../../dev/acpi_support KMOD= acpi_toshiba +CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica SRCS= acpi_toshiba.c opt_acpi.h acpi_if.h bus_if.h device_if.h .include <bsd.kmod.mk> diff --git a/sys/modules/acpi/acpi_video/Makefile b/sys/modules/acpi/acpi_video/Makefile index 67d3f08..77794ee 100644 --- a/sys/modules/acpi/acpi_video/Makefile +++ b/sys/modules/acpi/acpi_video/Makefile @@ -3,6 +3,7 @@ .PATH: ${.CURDIR}/../../../dev/acpica KMOD= acpi_video +CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica SRCS= acpi_video.c SRCS+= opt_acpi.h acpi_if.h bus_if.h device_if.h diff --git a/sys/modules/cpufreq/Makefile b/sys/modules/cpufreq/Makefile index 75b5c86..4e385b4 100644 --- a/sys/modules/cpufreq/Makefile +++ b/sys/modules/cpufreq/Makefile @@ -9,6 +9,7 @@ SRCS+= bus_if.h cpufreq_if.h device_if.h pci_if.h .if ${MACHINE} == "i386" || ${MACHINE} == "amd64" .PATH: ${.CURDIR}/../../i386/cpufreq +CFLAGS+= -I${.CURDIR}/../../contrib/dev/acpica SRCS+= acpi_if.h opt_acpi.h SRCS+= est.c hwpstate.c p4tcc.c powernow.c diff --git a/sys/modules/fdc/Makefile b/sys/modules/fdc/Makefile index 43b85f5..d61a307 100644 --- a/sys/modules/fdc/Makefile +++ b/sys/modules/fdc/Makefile @@ -9,6 +9,7 @@ SRCS= fdc.c fdc_cbus.c .PATH: ${.CURDIR}/../../dev/fdc SRCS= fdc.c fdc_isa.c fdc_pccard.c .if ${MACHINE} == "i386" || ${MACHINE} == "amd64" +CFLAGS+= -I${.CURDIR}/../../contrib/dev/acpica SRCS+= opt_acpi.h acpi_if.h fdc_acpi.c .endif .endif diff --git a/sys/net/bpf.c b/sys/net/bpf.c index b944e29..c74d09f 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include "opt_bpf.h" -#include "opt_mac.h" #include "opt_netgraph.h" #include <sys/types.h> diff --git a/sys/net/if.c b/sys/net/if.c index ffff619..1a5dcd2 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -34,7 +34,6 @@ #include "opt_inet6.h" #include "opt_inet.h" #include "opt_route.h" -#include "opt_mac.h" #include "opt_carp.h" #include <sys/param.h> diff --git a/sys/net/if_atmsubr.c b/sys/net/if_atmsubr.c index 734acc5..d8a3313 100644 --- a/sys/net/if_atmsubr.c +++ b/sys/net/if_atmsubr.c @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_mac.h" #include "opt_natm.h" #include <sys/param.h> diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 276588b..f4551d1 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -3039,7 +3039,7 @@ bridge_pfil(struct mbuf **mp, struct ifnet *bifp, struct ifnet *ifp, int dir) goto bad; } - if (IPFW_LOADED && pfil_ipfw != 0 && dir == PFIL_OUT && ifp != NULL) { + if (ip_fw_chk_ptr && pfil_ipfw != 0 && dir == PFIL_OUT && ifp != NULL) { INIT_VNET_INET(curvnet); error = -1; @@ -3058,7 +3058,7 @@ bridge_pfil(struct mbuf **mp, struct ifnet *bifp, struct ifnet *ifp, int dir) if (*mp == NULL) return (error); - if (DUMMYNET_LOADED && (i == IP_FW_DUMMYNET)) { + if (ip_dn_io_ptr && (i == IP_FW_DUMMYNET)) { /* put the Ethernet header back on */ M_PREPEND(*mp, ETHER_HDR_LEN, M_DONTWAIT); diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 44f6b23..02ff422 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -35,7 +35,6 @@ #include "opt_inet6.h" #include "opt_ipx.h" #include "opt_route.h" -#include "opt_mac.h" #include "opt_netgraph.h" #include "opt_carp.h" #include "opt_mbuf_profiling.h" @@ -432,7 +431,7 @@ ether_output_frame(struct ifnet *ifp, struct mbuf *m) INIT_VNET_NET(ifp->if_vnet); struct ip_fw *rule = ip_dn_claim_rule(m); - if (IPFW_LOADED && V_ether_ipfw != 0) { + if (ip_fw_chk_ptr && V_ether_ipfw != 0) { if (ether_ipfw_chk(&m, ifp, &rule, 0) == 0) { if (m) { m_freem(m); @@ -520,7 +519,7 @@ ether_ipfw_chk(struct mbuf **m0, struct ifnet *dst, if (i == IP_FW_PASS) /* a PASS rule. */ return 1; - if (DUMMYNET_LOADED && (i == IP_FW_DUMMYNET)) { + if (ip_dn_io_ptr && (i == IP_FW_DUMMYNET)) { /* * Pass the pkt to dummynet, which consumes it. * If shared, make a copy and keep the original. @@ -766,7 +765,7 @@ ether_demux(struct ifnet *ifp, struct mbuf *m) * Allow dummynet and/or ipfw to claim the frame. * Do not do this for PROMISC frames in case we are re-entered. */ - if (IPFW_LOADED && V_ether_ipfw != 0 && !(m->m_flags & M_PROMISC)) { + if (ip_fw_chk_ptr && V_ether_ipfw != 0 && !(m->m_flags & M_PROMISC)) { struct ip_fw *rule = ip_dn_claim_rule(m); if (ether_ipfw_chk(&m, NULL, &rule, 0) == 0) { diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c index 28f6e3a..9074bff 100644 --- a/sys/net/if_fddisubr.c +++ b/sys/net/if_fddisubr.c @@ -40,7 +40,6 @@ #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipx.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/net/if_fwsubr.c b/sys/net/if_fwsubr.c index a5e0b19..4f30db4 100644 --- a/sys/net/if_fwsubr.c +++ b/sys/net/if_fwsubr.c @@ -32,7 +32,6 @@ #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c index 50279a2..6405725 100644 --- a/sys/net/if_gif.c +++ b/sys/net/if_gif.c @@ -32,7 +32,6 @@ #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/net/if_iso88025subr.c b/sys/net/if_iso88025subr.c index 99daf66..a6d25dc 100644 --- a/sys/net/if_iso88025subr.c +++ b/sys/net/if_iso88025subr.c @@ -43,7 +43,6 @@ #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipx.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c index cc9251b..2bbccac 100644 --- a/sys/net/if_loop.c +++ b/sys/net/if_loop.c @@ -39,7 +39,6 @@ #include "opt_inet6.h" #include "opt_ipx.h" #include "opt_route.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c index 1c2c649..911804e 100644 --- a/sys/net/if_stf.c +++ b/sys/net/if_stf.c @@ -76,7 +76,6 @@ #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index df965be..6b352e8 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -20,7 +20,6 @@ #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipx.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/priv.h> diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c index 602ab7a..42157a0 100644 --- a/sys/net80211/ieee80211_output.c +++ b/sys/net80211/ieee80211_output.c @@ -62,6 +62,8 @@ __FBSDID("$FreeBSD$"); #include <netinet/ip.h> #endif +#include <security/mac/mac_framework.h> + #define ETHER_HEADER_COPY(dst, src) \ memcpy(dst, src, sizeof(struct ether_header)) @@ -354,7 +356,7 @@ ieee80211_output(struct ifnet *ifp, struct mbuf *m, if (dst->sa_family != AF_IEEE80211) return vap->iv_output(ifp, m, dst, ro); #ifdef MAC - error = mac_check_ifnet_transmit(ifp, m); + error = mac_ifnet_check_transmit(ifp, m); if (error) senderr(error); #endif diff --git a/sys/netatalk/aarp.c b/sys/netatalk/aarp.c index fc328d3..d682230 100644 --- a/sys/netatalk/aarp.c +++ b/sys/netatalk/aarp.c @@ -51,7 +51,6 @@ */ #include "opt_atalk.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/netatalk/ddp_input.c b/sys/netatalk/ddp_input.c index d90b2e8..2e82a2a 100644 --- a/sys/netatalk/ddp_input.c +++ b/sys/netatalk/ddp_input.c @@ -49,8 +49,6 @@ * $FreeBSD$ */ -#include "opt_mac.h" - #include <sys/param.h> #include <sys/kernel.h> #include <sys/lock.h> diff --git a/sys/netatalk/ddp_output.c b/sys/netatalk/ddp_output.c index 9581094..203bc9f 100644 --- a/sys/netatalk/ddp_output.c +++ b/sys/netatalk/ddp_output.c @@ -23,8 +23,6 @@ /* $FreeBSD$ */ -#include "opt_mac.h" - #include <sys/param.h> #include <sys/systm.h> #include <sys/mbuf.h> diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 734dd02..f0716d2 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_route.h" -#include "opt_mac.h" #include "opt_carp.h" #include <sys/param.h> diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c index d7dcfc5..e4f2b5a 100644 --- a/sys/netinet/igmp.c +++ b/sys/netinet/igmp.c @@ -50,7 +50,6 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include "opt_mac.h" #include "opt_route.h" #include <sys/param.h> diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 140f41a..a0d6f6d 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include "opt_ipsec.h" #include "opt_inet6.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c index 0894bfa4..0b72c65 100644 --- a/sys/netinet/ip_divert.c +++ b/sys/netinet/ip_divert.c @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #if !defined(KLD_MODULE) #include "opt_inet.h" #include "opt_ipfw.h" -#include "opt_mac.h" #include "opt_sctp.h" #ifndef INET #error "IPDIVERT requires INET." diff --git a/sys/netinet/ip_dummynet.c b/sys/netinet/ip_dummynet.c index 5816be9..2f11ae0 100644 --- a/sys/netinet/ip_dummynet.c +++ b/sys/netinet/ip_dummynet.c @@ -242,7 +242,7 @@ static void dummynet(void *); static void dummynet_flush(void); static void dummynet_send(struct mbuf *); void dummynet_drain(void); -static ip_dn_io_t dummynet_io; +static int dummynet_io(struct mbuf **, int , struct ip_fw_args *); static void dn_rule_delete(void *); /* @@ -1638,9 +1638,11 @@ dn_rule_delete_fs(struct dn_flow_set *fs, void *r) pkt->rule = ip_fw_default_rule ; } } + /* - * when a firewall rule is deleted, scan all queues and remove the flow-id - * from packets matching this rule. + * When a firewall rule is deleted, scan all queues and remove the pointer + * to the rule from matching packets, making them point to the default rule. + * The pointer is used to reinject packets in case one_pass = 0. */ void dn_rule_delete(void *r) @@ -2337,7 +2339,7 @@ dummynet_modevent(module_t mod, int type, void *data) switch (type) { case MOD_LOAD: - if (DUMMYNET_LOADED) { + if (ip_dn_io_ptr) { printf("DUMMYNET already loaded\n"); return EEXIST ; } diff --git a/sys/netinet/ip_dummynet.h b/sys/netinet/ip_dummynet.h index 43e6842..118bdbb 100644 --- a/sys/netinet/ip_dummynet.h +++ b/sys/netinet/ip_dummynet.h @@ -373,13 +373,6 @@ struct dn_pipe_max { SLIST_HEAD(dn_pipe_head, dn_pipe); #ifdef _KERNEL -typedef int ip_dn_ctl_t(struct sockopt *); /* raw_ip.c */ -typedef void ip_dn_ruledel_t(void *); /* ip_fw.c */ -typedef int ip_dn_io_t(struct mbuf **m, int dir, struct ip_fw_args *fwa); -extern ip_dn_ctl_t *ip_dn_ctl_ptr; -extern ip_dn_ruledel_t *ip_dn_ruledel_ptr; -extern ip_dn_io_t *ip_dn_io_ptr; -#define DUMMYNET_LOADED (ip_dn_io_ptr != NULL) /* * Return the IPFW rule associated with the dummynet tag; if any. diff --git a/sys/netinet/ip_fw.h b/sys/netinet/ip_fw.h index c9fb9aa..5602e9e 100644 --- a/sys/netinet/ip_fw.h +++ b/sys/netinet/ip_fw.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2002 Luigi Rizzo, Universita` di Pisa + * Copyright (c) 2002-2009 Luigi Rizzo, Universita` di Pisa * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -43,6 +43,20 @@ #define IPFW_TABLES_MAX 128 /* + * Most commands (queue, pipe, tag, untag, limit...) can have a 16-bit + * argument between 1 and 65534. The value 0 is unused, the value + * 65535 (IP_FW_TABLEARG) is used to represent 'tablearg', i.e. the + * can be 1..65534, or 65535 to indicate the use of a 'tablearg' + * result of the most recent table() lookup. + * Note that 16bit is only a historical limit, resulting from + * the use of a 16-bit fields for that value. In reality, we can have + * 2^32 pipes, queues, tag values and so on, and use 0 as a tablearg. + */ +#define IPFW_ARG_MIN 1 +#define IPFW_ARG_MAX 65534 +#define IP_FW_TABLEARG 65535 /* XXX should use 0 */ + +/* * The kernel representation of ipfw rules is made of a list of * 'instructions' (for all practical purposes equivalent to BPF * instructions), which specify which fields of the packet @@ -239,8 +253,6 @@ typedef struct _ipfw_insn { /* template for instructions */ */ #define F_INSN_SIZE(t) ((sizeof (t))/sizeof(u_int32_t)) -#define MTAG_IPFW 1148380143 /* IPFW-tagged cookie */ - /* * This is used to store an array of 16-bit entries (ports etc.) */ @@ -558,13 +570,13 @@ typedef struct _ipfw_table { ipfw_table_entry ent[0]; /* entries */ } ipfw_table; -#define IP_FW_TABLEARG 65535 - /* * Main firewall chains definitions and global var's definitions. */ #ifdef _KERNEL +#define MTAG_IPFW 1148380143 /* IPFW-tagged cookie */ + /* Return values from ipfw_chk() */ enum { IP_FW_PASS = 0, @@ -636,9 +648,6 @@ void ipfw_destroy(void); void ipfw_nat_destroy(void); #endif -typedef int ip_fw_ctl_t(struct sockopt *); -extern ip_fw_ctl_t *ip_fw_ctl_ptr; - #ifdef VIMAGE_GLOBALS extern int fw_one_pass; extern int fw_enable; @@ -647,11 +656,6 @@ extern int fw6_enable; #endif #endif -/* For kernel ipfw_ether and ipfw_bridge. */ -typedef int ip_fw_chk_t(struct ip_fw_args *args); -extern ip_fw_chk_t *ip_fw_chk_ptr; -#define IPFW_LOADED (ip_fw_chk_ptr != NULL) - struct ip_fw_chain { struct ip_fw *rules; /* list of rules */ struct ip_fw *reap; /* list of rules to reap */ diff --git a/sys/netinet/ip_fw2.c b/sys/netinet/ip_fw2.c index 965cddb..760150a 100644 --- a/sys/netinet/ip_fw2.c +++ b/sys/netinet/ip_fw2.c @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #endif #include "opt_inet6.h" #include "opt_ipsec.h" -#include "opt_mac.h" #include "opt_route.h" #include <sys/param.h> @@ -3603,6 +3602,12 @@ remove_rule(struct ip_fw_chain *chain, struct ip_fw *rule, return n; } +/* + * Hook for cleaning up dummynet when an ipfw rule is deleted. + * Set/cleared when dummynet module is loaded/unloaded. + */ +void (*ip_dn_ruledel_ptr)(void *) = NULL; + /** * Reclaim storage associated with a list of rules. This is * typically the list created using remove_rule. @@ -3614,7 +3619,7 @@ reap_rules(struct ip_fw *head) while ((rule = head) != NULL) { head = head->next; - if (DUMMYNET_LOADED) + if (ip_dn_ruledel_ptr) ip_dn_ruledel_ptr(rule); free(rule, M_IPFW); } diff --git a/sys/netinet/ip_fw_pfil.c b/sys/netinet/ip_fw_pfil.c index 3064cd9..0b1ba2d 100644 --- a/sys/netinet/ip_fw_pfil.c +++ b/sys/netinet/ip_fw_pfil.c @@ -77,9 +77,6 @@ int fw6_enable = 1; int ipfw_chg_hook(SYSCTL_HANDLER_ARGS); -/* Dummynet hooks. */ -ip_dn_ruledel_t *ip_dn_ruledel_ptr = NULL; - /* Divert hooks. */ ip_divert_packet_t *ip_divert_ptr = NULL; @@ -167,7 +164,7 @@ again: break; /* not reached */ case IP_FW_DUMMYNET: - if (!DUMMYNET_LOADED) + if (ip_dn_io_ptr == NULL) goto drop; if (mtod(*m0, struct ip *)->ip_v == 4) ip_dn_io_ptr(m0, DN_TO_IP_IN, &args); @@ -302,7 +299,7 @@ again: break; /* not reached */ case IP_FW_DUMMYNET: - if (!DUMMYNET_LOADED) + if (ip_dn_io_ptr == NULL) break; if (mtod(*m0, struct ip *)->ip_v == 4) ip_dn_io_ptr(m0, DN_TO_IP_OUT, &args); diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index 8c2ef26..cfd27f0 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ipsec.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 2859b8c..bdc0c6d 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ipstealth.h" #include "opt_ipsec.h" #include "opt_route.h" -#include "opt_mac.h" #include "opt_carp.h" #include <sys/param.h> @@ -85,10 +84,6 @@ __FBSDID("$FreeBSD$"); #include <sys/socketvar.h> -/* XXX: Temporary until ipfw_ether and ipfw_bridge are converted. */ -#include <netinet/ip_fw.h> -#include <netinet/ip_dummynet.h> - #include <security/mac/mac_framework.h> #ifdef CTASSERT @@ -217,12 +212,6 @@ SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip, OID_AUTO, output_flowtable_size, CTLFLAG_RDTUN, ip_output_flowtable_size, 2048, "number of entries in the per-cpu output flow caches"); -/* - * ipfw_ether and ipfw_bridge hooks. - * XXX: Temporary until those are converted to pfil_hooks as well. - */ -ip_fw_chk_t *ip_fw_chk_ptr = NULL; -ip_dn_io_t *ip_dn_io_ptr = NULL; #ifdef VIMAGE_GLOBALS int fw_one_pass; #endif diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index fdea118..65dc944 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -70,7 +70,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" -#include "opt_mac.h" #include "opt_mrouting.h" #define _PIM_VT 1 diff --git a/sys/netinet/ip_options.c b/sys/netinet/ip_options.c index dbb7d81..b59d708 100644 --- a/sys/netinet/ip_options.c +++ b/sys/netinet/ip_options.c @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ipstealth.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 65e06a0..eded15c 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ipfw.h" #include "opt_ipsec.h" #include "opt_route.h" -#include "opt_mac.h" #include "opt_mbuf_stress_test.h" #include "opt_mpath.h" #include "opt_sctp.h" diff --git a/sys/netinet/ip_var.h b/sys/netinet/ip_var.h index 472a458..aa9beb1 100644 --- a/sys/netinet/ip_var.h +++ b/sys/netinet/ip_var.h @@ -173,7 +173,8 @@ extern int ipstealth; /* stealth forwarding */ extern int rsvp_on; extern struct socket *ip_rsvpd; /* reservation protocol daemon */ extern struct socket *ip_mrouter; /* multicast routing daemon */ -#endif +#endif /* VIMAGE_GLOBALS */ + extern u_char ip_protox[]; extern int (*legal_vif_num)(int); extern u_long (*ip_mcast_src)(int); @@ -223,6 +224,13 @@ extern struct pfil_head inet_pfil_hook; /* packet filter hooks */ void in_delayed_cksum(struct mbuf *m); +/* ipfw and dummynet hooks. Most are declared in raw_ip.c */ +struct ip_fw_args; +extern int (*ip_fw_chk_ptr)(struct ip_fw_args *args); +extern int (*ip_fw_ctl_ptr)(struct sockopt *); +extern int (*ip_dn_ctl_ptr)(struct sockopt *); +extern int (*ip_dn_io_ptr)(struct mbuf **m, int dir, struct ip_fw_args *fwa); +extern void (*ip_dn_ruledel_ptr)(void *); /* in ip_fw2.c */ #endif /* _KERNEL */ #endif /* !_NETINET_IP_VAR_H_ */ diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 080ab09..806fc1d 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include "opt_ipsec.h" #include "opt_route.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/jail.h> @@ -70,8 +69,6 @@ __FBSDID("$FreeBSD$"); #include <netinet/ip_var.h> #include <netinet/ip_mroute.h> -#include <netinet/ip_fw.h> -#include <netinet/ip_dummynet.h> #include <netinet/vinet.h> #ifdef IPSEC @@ -85,9 +82,15 @@ struct inpcbhead ripcb; struct inpcbinfo ripcbinfo; #endif -/* control hooks for ipfw and dummynet */ -ip_fw_ctl_t *ip_fw_ctl_ptr = NULL; -ip_dn_ctl_t *ip_dn_ctl_ptr = NULL; +/* + * Control and data hooks for ipfw and dummynet. + * The data hooks are not used here but it is convenient + * to keep them all in one place. + */ +int (*ip_fw_ctl_ptr)(struct sockopt *) = NULL; +int (*ip_dn_ctl_ptr)(struct sockopt *) = NULL; +int (*ip_fw_chk_ptr)(struct ip_fw_args *args) = NULL; +int (*ip_dn_io_ptr)(struct mbuf **m, int dir, struct ip_fw_args *fwa) = NULL; /* * Hooks for multicast routing. They all default to NULL, so leave them not diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 674c77e..eecf2fb 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" -#include "opt_mac.h" #include "opt_tcpdebug.h" #include <sys/param.h> diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index d014fdd..3117fc3 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" -#include "opt_mac.h" #include "opt_tcpdebug.h" #include <sys/param.h> diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 3c65a54..489617b 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" -#include "opt_mac.h" #include "opt_tcpdebug.h" #include <sys/param.h> diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 2763183..033e506 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/netinet/tcp_syncache.h b/sys/netinet/tcp_syncache.h index e4e3fac..e488039 100644 --- a/sys/netinet/tcp_syncache.h +++ b/sys/netinet/tcp_syncache.h @@ -74,9 +74,7 @@ struct syncache { struct toe_usrreqs *sc_tu; /* TOE operations */ void *sc_toepcb; /* TOE protocol block */ #endif -#ifdef MAC struct label *sc_label; /* MAC label reference */ -#endif struct ucred *sc_cred; /* cred cache for jail checks */ }; diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index 5ee6087..4c0fe94 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_mac.h" #include "opt_tcpdebug.h" #include <sys/param.h> diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index caeb2ae..33be911 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ipfw.h" #include "opt_inet6.h" #include "opt_ipsec.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/domain.h> diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c index d0f333d..2f4e256 100644 --- a/sys/netinet6/frag6.c +++ b/sys/netinet6/frag6.c @@ -32,8 +32,6 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include <sys/param.h> #include <sys/systm.h> #include <sys/malloc.h> diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index 800564c..051cd9b 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -66,7 +66,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index ffcd996..ccfdb8f 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_mac.h" #include "opt_route.h" #include <sys/param.h> diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index 11dcf24..590e6d6 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -68,7 +68,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/jail.h> diff --git a/sys/nfsserver/nfs_srvkrpc.c b/sys/nfsserver/nfs_srvkrpc.c index 2b3b48a..12f40c8 100644 --- a/sys/nfsserver/nfs_srvkrpc.c +++ b/sys/nfsserver/nfs_srvkrpc.c @@ -81,6 +81,8 @@ __FBSDID("$FreeBSD$"); #include <nfsserver/nfsrvcache.h> #include <nfsserver/nfs_fha.h> +#include <security/mac/mac_framework.h> + #ifndef NFS_LEGACYRPC static MALLOC_DEFINE(M_NFSSVC, "nfss_srvsock", "Nfs server structure"); diff --git a/sys/nfsserver/nfs_srvsock.c b/sys/nfsserver/nfs_srvsock.c index db48869..13679ef 100644 --- a/sys/nfsserver/nfs_srvsock.c +++ b/sys/nfsserver/nfs_srvsock.c @@ -39,8 +39,6 @@ __FBSDID("$FreeBSD$"); * Socket operations for use by nfs */ -#include "opt_mac.h" - #include <sys/param.h> #include <sys/systm.h> #include <sys/jail.h> diff --git a/sys/powerpc/booke/platform_bare.c b/sys/powerpc/booke/platform_bare.c index a9ee450..92d8ec8 100644 --- a/sys/powerpc/booke/platform_bare.c +++ b/sys/powerpc/booke/platform_bare.c @@ -56,7 +56,7 @@ extern uint8_t __boot_page[]; /* Boot page body */ extern uint32_t kernload; /* Kernel physical load address */ #endif -static int cpu; +static int cpu, maxcpu; static int bare_probe(platform_t); static void bare_mem_regions(platform_t, struct mem_region **phys, int *physsz, @@ -91,6 +91,13 @@ PLATFORM_DEF(bare_platform); static int bare_probe(platform_t plat) { + uint32_t ver; + + ver = SVR_VER(mfspr(SPR_SVR)); + if (ver == SVR_MPC8572E || ver == SVR_MPC8572) + maxcpu = 2; + else + maxcpu = 1; return (BUS_PROBE_GENERIC); } @@ -161,7 +168,7 @@ static int bare_smp_next_cpu(platform_t plat, struct cpuref *cpuref) { - if (cpu >= MAXCPU) + if (cpu >= maxcpu) return (ENOENT); cpuref->cr_cpuid = cpu++; diff --git a/sys/powerpc/booke/pmap.c b/sys/powerpc/booke/pmap.c index 961836c..5eaa2ef 100644 --- a/sys/powerpc/booke/pmap.c +++ b/sys/powerpc/booke/pmap.c @@ -966,8 +966,9 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_offset_t kernelend) u_int s, e, sz; u_int phys_avail_count; vm_size_t physsz, hwphyssz, kstack0_sz; - vm_offset_t kernel_pdir, kstack0; + vm_offset_t kernel_pdir, kstack0, va; vm_paddr_t kstack0_phys; + pte_t *pte; debugf("mmu_booke_bootstrap: entered\n"); @@ -1216,6 +1217,19 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_offset_t kernelend) /* Initialize each CPU's tidbusy entry 0 with kernel_pmap */ tidbusy[i][0] = kernel_pmap; } + + /* + * Fill in PTEs covering kernel code and data. They are not required + * for address translation, as this area is covered by static TLB1 + * entries, but for pte_vatopa() to work correctly with kernel area + * addresses. + */ + for (va = KERNBASE; va < data_end; va += PAGE_SIZE) { + pte = &(kernel_pmap->pm_pdir[PDIR_IDX(va)][PTBL_IDX(va)]); + pte->rpn = kernload + (va - KERNBASE); + pte->flags = PTE_M | PTE_SR | PTE_SW | PTE_SX | PTE_WIRED | + PTE_VALID; + } /* Mark kernel_pmap active on all CPUs */ kernel_pmap->pm_active = ~0; diff --git a/sys/rpc/svc_vc.c b/sys/rpc/svc_vc.c index 7249270..d8059b3 100644 --- a/sys/rpc/svc_vc.c +++ b/sys/rpc/svc_vc.c @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include <sys/malloc.h> #include <sys/mbuf.h> #include <sys/mutex.h> +#include <sys/proc.h> #include <sys/protosw.h> #include <sys/queue.h> #include <sys/socket.h> @@ -63,6 +64,8 @@ __FBSDID("$FreeBSD$"); #include <rpc/rpc_com.h> +#include <security/mac/mac_framework.h> + static bool_t svc_vc_rendezvous_recv(SVCXPRT *, struct rpc_msg *, struct sockaddr **, struct mbuf **); static enum xprt_stat svc_vc_rendezvous_stat(SVCXPRT *); @@ -273,7 +276,7 @@ svc_vc_accept(struct socket *head, struct socket **sop) goto done; } #ifdef MAC - error = mac_socket_check_accept(td->td_ucred, head); + error = mac_socket_check_accept(curthread->td_ucred, head); if (error != 0) goto done; #endif diff --git a/sys/security/audit/audit_syscalls.c b/sys/security/audit/audit_syscalls.c index bb1e707..1811660 100644 --- a/sys/security/audit/audit_syscalls.c +++ b/sys/security/audit/audit_syscalls.c @@ -30,8 +30,6 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include "opt_mac.h" - #include <sys/param.h> #include <sys/mount.h> #include <sys/namei.h> diff --git a/sys/sys/clist.h b/sys/sys/clist.h deleted file mode 100644 index d497022..0000000 --- a/sys/sys/clist.h +++ /dev/null @@ -1,67 +0,0 @@ -/*- - * Copyright (c) 1990, 1993 - * The Regents of the University of California. 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. - * - * @(#)clist.h 8.1 (Berkeley) 6/4/93 - * $FreeBSD$ - */ - -#ifndef _SYS_CLIST_H_ -#define _SYS_CLIST_H_ - -#include <sys/param.h> - -/* - * Clists are character lists, which is a variable length linked list - * of cblocks, with a count of the number of characters in the list. - */ -struct clist { - int c_cc; /* Number of characters in the clist. */ - int c_cbcount; /* Number of cblocks. */ - int c_cbmax; /* Max # cblocks allowed for this clist. */ - int c_cbreserved; /* # cblocks reserved for this clist. */ - char *c_cf; /* Pointer to the first cblock. */ - char *c_cl; /* Pointer to the last cblock. */ -}; - -struct cblock { - struct cblock *c_next; /* next cblock in queue */ - unsigned char c_info[CBSIZE]; /* characters */ -}; - -#ifdef _KERNEL -int b_to_q(char *cp, int cc, struct clist *q); -void clist_alloc_cblocks(struct clist *q, int ccmax, int ccres); -void clist_free_cblocks(struct clist *q); -int getc(struct clist *q); -void ndflush(struct clist *q, int cc); -int putc(char c, struct clist *q); -int q_to_b(struct clist *q, char *cp, int cc); -int unputc(struct clist *q); -#endif - -#endif diff --git a/sys/sys/param.h b/sys/sys/param.h index bf3892d..764a5a0 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -196,11 +196,6 @@ #define NODEV (dev_t)(-1) /* non-existent device */ -#define CBLOCK 128 /* Clist block size, must be a power of 2. */ - /* Data chars/clist. */ -#define CBSIZE (CBLOCK - sizeof(struct cblock *)) -#define CROUND (CBLOCK - 1) /* Clist rounding. */ - /* * File system parameters and macros. * diff --git a/sys/sys/pcpu.h b/sys/sys/pcpu.h index 63c3fa3..dc26c1a 100644 --- a/sys/sys/pcpu.h +++ b/sys/sys/pcpu.h @@ -76,10 +76,6 @@ struct pcpu { cpumask_t pc_other_cpus; /* Mask of all other cpus */ SLIST_ENTRY(pcpu) pc_allcpu; struct lock_list_entry *pc_spinlocks; -#ifdef KTR_PERCPU - int pc_ktr_idx; /* Index into trace table */ - char *pc_ktr_buf; -#endif #ifdef KTR char pc_name[PCPU_NAME_LEN]; /* String name for KTR. */ #endif diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index c5c1328..7aae808 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -32,7 +32,6 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include "opt_mac.h" #include "opt_quota.h" #include "opt_ufs.h" #include "opt_ffs.h" diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 49ced43..38c2543 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -37,7 +37,6 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include "opt_mac.h" #include "opt_quota.h" #include "opt_suiddir.h" #include "opt_ufs.h" diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 6b58294..769a11d 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -69,7 +69,6 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include "opt_mac.h" #include "opt_swap.h" #include "opt_vm.h" diff --git a/sys/vm/vm_contig.c b/sys/vm/vm_contig.c index 8fec101..6c82e14 100644 --- a/sys/vm/vm_contig.c +++ b/sys/vm/vm_contig.c @@ -281,9 +281,7 @@ again: void contigfree(void *addr, unsigned long size, struct malloc_type *type) { - vm_pindex_t npgs; - npgs = round_page(size) >> PAGE_SHIFT; kmem_free(kernel_map, (vm_offset_t)addr, size); - malloc_type_freed(type, npgs << PAGE_SHIFT); + malloc_type_freed(type, round_page(size)); } diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index d6ec2ba..17a7700 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -455,7 +455,6 @@ vm_thread_swapin(struct thread *td) if (rv != VM_PAGER_OK) panic("vm_thread_swapin: cannot get kstack for proc: %d", td->td_proc->p_pid); m = vm_page_lookup(ksobj, i); - m->valid = VM_PAGE_BITS_ALL; } ma[i] = m; vm_page_lock_queues(); diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index c79a0f4..fb9bb5f1 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include "opt_hwpmc_hooks.h" -#include "opt_mac.h" #include <sys/param.h> #include <sys/systm.h> |