Index: sys/sys/_vm_domain.h =================================================================== --- sys/sys/_vm_domain.h (revision 300377) +++ sys/sys/_vm_domain.h (working copy) @@ -31,8 +31,6 @@ #ifndef __SYS_VM_DOMAIN_H__ #define __SYS_VM_DOMAIN_H__ -#include - typedef enum { VM_POLICY_NONE, VM_POLICY_ROUND_ROBIN, @@ -49,7 +47,7 @@ }; struct vm_domain_policy { - seq_t seq; + int seq; struct vm_domain_policy_entry p; }; Index: sys/sys/buf.h =================================================================== --- sys/sys/buf.h (revision 300377) +++ sys/sys/buf.h (working copy) @@ -38,6 +38,7 @@ #ifndef _SYS_BUF_H_ #define _SYS_BUF_H_ +#include #include #include #include Index: sys/sys/fbio.h =================================================================== --- sys/sys/fbio.h (revision 300377) +++ sys/sys/fbio.h (working copy) @@ -151,21 +151,7 @@ int fbd_register(struct fb_info *); int fbd_unregister(struct fb_info *); -static inline int -register_framebuffer(struct fb_info *info) -{ - EVENTHANDLER_INVOKE(register_framebuffer, info); - return (0); -} - -static inline int -unregister_framebuffer(struct fb_info *info) -{ - - EVENTHANDLER_INVOKE(unregister_framebuffer, info); - return (0); -} #endif #ifdef notdef Index: sys/sys/file.h =================================================================== --- sys/sys/file.h (revision 300377) +++ sys/sys/file.h (working copy) @@ -68,6 +68,7 @@ #define DTYPE_DEV 11 /* Device specific fd type */ #define DTYPE_PROCDESC 12 /* process descriptor */ #define DTYPE_LINUXEFD 13 /* emulation eventfd type */ +#define DTYPE_DMABUF 14 /* dma_buf compatibility */ #ifdef _KERNEL Index: sys/sys/filedesc.h =================================================================== --- sys/sys/filedesc.h (revision 300377) +++ sys/sys/filedesc.h (working copy) @@ -38,7 +38,6 @@ #include #include #include -#include #include #include @@ -54,7 +53,7 @@ struct file *fde_file; /* file structure for open file */ struct filecaps fde_caps; /* per-descriptor rights */ uint8_t fde_flags; /* per-process open file flags */ - seq_t fde_seq; /* keep file and caps in sync */ + uint32_t fde_seq; /* keep file and caps in sync */ }; #define fde_rights fde_caps.fc_rights #define fde_fcntls fde_caps.fc_fcntls @@ -192,7 +191,7 @@ /* Return a referenced file from an unlocked descriptor. */ int fget_unlocked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, - struct file **fpp, seq_t *seqp); + struct file **fpp, uint32_t *seqp); /* Requires a FILEDESC_{S,X}LOCK held and returns without a ref. */ static __inline struct file * @@ -207,13 +206,8 @@ return (fdp->fd_ofiles[fd].fde_file); } -static __inline bool -fd_modified(struct filedesc *fdp, int fd, seq_t seq) -{ +bool fd_modified(struct filedesc *fdp, int fd, uint32_t seq); - return (!seq_consistent(fd_seq(fdp->fd_files, fd), seq)); -} - /* cdir/rdir/jdir manipulation functions. */ void pwd_chdir(struct thread *td, struct vnode *vp); int pwd_chroot(struct thread *td, struct vnode *vp); Index: sys/kern/kern_descrip.c =================================================================== --- sys/kern/kern_descrip.c (revision 300377) +++ sys/kern/kern_descrip.c (working copy) @@ -70,6 +70,7 @@ #include #include #include +#include #include #include #include @@ -4050,6 +4051,13 @@ return (EINVAL); } +bool +fd_modified(struct filedesc *fdp, int fd, uint32_t seq) +{ + + return (!seq_consistent(fd_seq(fdp->fd_files, fd), seq)); +} + /*-------------------------------------------------------------------*/ /* Index: sys/kern/kern_shutdown.c =================================================================== --- sys/kern/kern_shutdown.c (revision 300377) +++ sys/kern/kern_shutdown.c (working copy) @@ -702,6 +702,14 @@ spinlock_enter(); +#if 0 +/***** DEBUGGING DRM *****/ + + doadump(0); + EVENTHANDLER_INVOKE(shutdown_final, RB_NOSYNC); + +/************************/ +#endif #ifdef SMP /* * stop_cpus_hard(other_cpus) should prevent multiple CPUs from Index: sys/dev/netmap/netmap_freebsd.c =================================================================== --- sys/dev/netmap/netmap_freebsd.c (revision 300377) +++ sys/dev/netmap/netmap_freebsd.c (working copy) @@ -492,7 +492,7 @@ static int netmap_dev_pager_fault(vm_object_t object, vm_ooffset_t offset, - int prot, vm_page_t *mres) + int prot, vm_page_t *mres, int count, int *rahead) { struct netmap_vm_handle_t *vmh = object->handle; struct netmap_priv_d *priv = vmh->priv; @@ -502,6 +502,9 @@ vm_memattr_t memattr; vm_pindex_t pidx; + if (rahead) + *rahead = 0; + ND("object %p offset %jd prot %d mres %p", object, (intmax_t)offset, prot, mres); memattr = object->memattr; Index: sys/dev/netmap/netmap_freebsd.c =================================================================== --- sys/dev/netmap/netmap_freebsd.c (revision 300377) +++ sys/dev/netmap/netmap_freebsd.c (working copy) @@ -492,7 +492,7 @@ static int netmap_dev_pager_fault(vm_object_t object, vm_ooffset_t offset, - int prot, vm_page_t *mres) + int prot, vm_page_t *mres, int count, int *rahead) { struct netmap_vm_handle_t *vmh = object->handle; struct netmap_priv_d *priv = vmh->priv; @@ -502,6 +502,9 @@ vm_memattr_t memattr; vm_pindex_t pidx; + if (rahead) + *rahead = 0; + ND("object %p offset %jd prot %d mres %p", object, (intmax_t)offset, prot, mres); memattr = object->memattr; Index: sys/dev/random/randomdev.c =================================================================== --- sys/dev/random/randomdev.c (revision 300377) +++ sys/dev/random/randomdev.c (working copy) @@ -56,6 +56,8 @@ #include #include +#include + #define RANDOM_UNIT 0 #if defined(RANDOM_LOADABLE) Index: sys/dev/xen/privcmd/privcmd.c =================================================================== --- sys/dev/xen/privcmd/privcmd.c (revision 300377) +++ sys/dev/xen/privcmd/privcmd.c (working copy) @@ -90,7 +90,7 @@ vm_ooffset_t foff, struct ucred *cred, u_short *color); static void privcmd_pg_dtor(void *handle); static int privcmd_pg_fault(vm_object_t object, vm_ooffset_t offset, - int prot, vm_page_t *mres); + int prot, vm_page_t *mres, int count, int *rahead); static struct cdev_pager_ops privcmd_pg_ops = { .cdev_pg_fault = privcmd_pg_fault, @@ -151,12 +151,15 @@ static int privcmd_pg_fault(vm_object_t object, vm_ooffset_t offset, - int prot, vm_page_t *mres) + int prot, vm_page_t *mres, int count, int *rahead) { struct privcmd_map *map = object->handle; vm_pindex_t pidx; vm_page_t page, oldm; + if (rahead) + *rahead = 0; + if (map->mapped != true) return (VM_PAGER_FAIL); Index: sys/geom/uzip/g_uzip_wrkthr.c =================================================================== --- sys/geom/uzip/g_uzip_wrkthr.c (revision 300377) +++ sys/geom/uzip/g_uzip_wrkthr.c (working copy) @@ -29,6 +29,7 @@ #include #include +#include #include #include #include Index: sys/compat/cloudabi/cloudabi_fd.c =================================================================== --- sys/compat/cloudabi/cloudabi_fd.c (revision 300377) +++ sys/compat/cloudabi/cloudabi_fd.c (working copy) @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include Index: sys/x86/x86/stack_machdep.c =================================================================== --- sys/x86/x86/stack_machdep.c (revision 300377) +++ sys/x86/x86/stack_machdep.c (working copy) @@ -38,6 +38,7 @@ #include #include +#include #include #include Index: sys/vm/device_pager.c =================================================================== --- sys/vm/device_pager.c (revision 300377) +++ sys/vm/device_pager.c (working copy) @@ -90,7 +90,7 @@ vm_ooffset_t foff, struct ucred *cred, u_short *color); static void old_dev_pager_dtor(void *handle); static int old_dev_pager_fault(vm_object_t object, vm_ooffset_t offset, - int prot, vm_page_t *mres); + int prot, vm_page_t *mres, int count, int *rahead); static struct cdev_pager_ops old_dev_pager_ops = { .cdev_pg_ctor = old_dev_pager_ctor, @@ -265,8 +265,13 @@ /* Since our haspage reports zero after/before, the count is 1. */ KASSERT(count == 1, ("%s: count %d", __func__, count)); VM_OBJECT_ASSERT_WLOCKED(object); + if (object->type == OBJT_DEVICE) { + count = 1; + if (rahead) + *rahead = 0; + } error = object->un_pager.devp.ops->cdev_pg_fault(object, - IDX_TO_OFF(ma[0]->pindex), PROT_READ, &ma[0]); + IDX_TO_OFF(ma[0]->pindex), PROT_READ, ma, count, rahead); VM_OBJECT_ASSERT_WLOCKED(object); @@ -282,8 +287,6 @@ } if (rbehind) *rbehind = 0; - if (rahead) - *rahead = 0; } return (error); @@ -291,7 +294,7 @@ static int old_dev_pager_fault(vm_object_t object, vm_ooffset_t offset, int prot, - vm_page_t *mres) + vm_page_t *mres, int count, int *rahead) { vm_paddr_t paddr; vm_page_t m_paddr, page; @@ -302,6 +305,9 @@ vm_memattr_t memattr, memattr1; int ref, ret; + if (rahead) + *rahead = 0; + memattr = object->memattr; VM_OBJECT_WUNLOCK(object); Index: sys/vm/vm_pager.h =================================================================== --- sys/vm/vm_pager.h (revision 300377) +++ sys/vm/vm_pager.h (working copy) @@ -176,7 +176,7 @@ struct cdev_pager_ops { int (*cdev_pg_fault)(vm_object_t vm_obj, vm_ooffset_t offset, - int prot, vm_page_t *mres); + int prot, vm_page_t *mres, int count, int *rahead); int (*cdev_pg_ctor)(void *handle, vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t foff, struct ucred *cred, u_short *color); void (*cdev_pg_dtor)(void *handle); Index: sys/contrib/dev/acpica/components/namespace/nsxfeval.c =================================================================== --- sys/contrib/dev/acpica/components/namespace/nsxfeval.c (revision 300377) +++ sys/contrib/dev/acpica/components/namespace/nsxfeval.c (working copy) @@ -1022,23 +1022,25 @@ /******************************************************************************* * - * FUNCTION: AcpiGetData + * FUNCTION: AcpiGetDataFull * * PARAMETERS: ObjHandle - Namespace node - * Handler - Handler used in call to AttachData + * Handle - Handler used in call to attach_data * Data - Where the data is returned + * Callback - function to execute before returning * * RETURN: Status * - * DESCRIPTION: Retrieve data that was previously attached to a namespace node. + * DESCRIPTION: Retrieve data that was previously attached to a namespace node + * and execute a callback before returning. * ******************************************************************************/ - ACPI_STATUS -AcpiGetData ( +AcpiGetDataFull ( ACPI_HANDLE ObjHandle, ACPI_OBJECT_HANDLER Handler, - void **Data) + void **Data, + void (*Callback)(void *)) { ACPI_NAMESPACE_NODE *Node; ACPI_STATUS Status; @@ -1069,10 +1071,34 @@ } Status = AcpiNsGetAttachedData (Node, Handler, Data); - + if (ACPI_SUCCESS(Status) && Callback) { + Callback(*Data); + } UnlockAndExit: (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); return (Status); } +ACPI_EXPORT_SYMBOL (AcpiGetDataFull) +/******************************************************************************* + * + * FUNCTION: AcpiGetData + * + * PARAMETERS: ObjHandle - Namespace node + * Handler - Handler used in call to AttachData + * Data - Where the data is returned + * + * RETURN: Status + * + * DESCRIPTION: Retrieve data that was previously attached to a namespace node. + * + ******************************************************************************/ +ACPI_STATUS +AcpiGetData ( + ACPI_HANDLE ObjHandle, + ACPI_OBJECT_HANDLER Handler, + void **Data) +{ + return (AcpiGetDataFull(ObjHandle, Handler, Data, NULL)); +} ACPI_EXPORT_SYMBOL (AcpiGetData) Index: sys/contrib/dev/acpica/include/acpixf.h =================================================================== --- sys/contrib/dev/acpica/include/acpixf.h (revision 300377) +++ sys/contrib/dev/acpica/include/acpixf.h (working copy) @@ -644,6 +644,14 @@ ACPI_EXTERNAL_RETURN_STATUS ( ACPI_STATUS +AcpiGetDataFull ( + ACPI_HANDLE Object, + ACPI_OBJECT_HANDLER Handler, + void **Data, + void (*Callback)(void *))) + +ACPI_EXTERNAL_RETURN_STATUS ( +ACPI_STATUS AcpiDebugTrace ( const char *Name, UINT32 DebugLevel, Index: sys/dev/acpica/acpi_lid.c =================================================================== --- sys/dev/acpica/acpi_lid.c (revision 300377) +++ sys/dev/acpica/acpi_lid.c (working copy) @@ -52,6 +52,8 @@ int lid_status; /* open or closed */ }; +ACPI_HANDLE acpi_lid_handle; + ACPI_SERIAL_DECL(lid, "ACPI lid"); static int acpi_lid_probe(device_t dev); @@ -105,7 +107,7 @@ sc = device_get_softc(dev); sc->lid_dev = dev; - sc->lid_handle = acpi_get_handle(dev); + acpi_lid_handle = sc->lid_handle = acpi_get_handle(dev); /* * If a system does not get lid events, it may make sense to change