subr_devstat.c (197309) | subr_devstat.c (201223) |
---|---|
1/*- 2 * Copyright (c) 1997, 1998, 1999 Kenneth D. Merry. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 */ 28 29#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1997, 1998, 1999 Kenneth D. Merry. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/kern/subr_devstat.c 197309 2009-09-18 13:48:38Z attilio $"); | 30__FBSDID("$FreeBSD: head/sys/kern/subr_devstat.c 201223 2009-12-29 21:51:28Z rnoland $"); |
31 32#include <sys/param.h> 33#include <sys/kernel.h> 34#include <sys/systm.h> 35#include <sys/bio.h> 36#include <sys/devicestat.h> 37#include <sys/sysctl.h> 38#include <sys/malloc.h> --- 405 unchanged lines hidden (view full) --- 444 struct devstat *stat; 445 u_int nfree; 446}; 447 448static TAILQ_HEAD(, statspage) pagelist = TAILQ_HEAD_INITIALIZER(pagelist); 449static MALLOC_DEFINE(M_DEVSTAT, "devstat", "Device statistics"); 450 451static int | 31 32#include <sys/param.h> 33#include <sys/kernel.h> 34#include <sys/systm.h> 35#include <sys/bio.h> 36#include <sys/devicestat.h> 37#include <sys/sysctl.h> 38#include <sys/malloc.h> --- 405 unchanged lines hidden (view full) --- 444 struct devstat *stat; 445 u_int nfree; 446}; 447 448static TAILQ_HEAD(, statspage) pagelist = TAILQ_HEAD_INITIALIZER(pagelist); 449static MALLOC_DEFINE(M_DEVSTAT, "devstat", "Device statistics"); 450 451static int |
452devstat_mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot) | 452devstat_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, 453 int nprot, vm_memattr_t *memattr) |
453{ 454 struct statspage *spp; 455 456 if (nprot != VM_PROT_READ) 457 return (-1); 458 TAILQ_FOREACH(spp, &pagelist, list) { 459 if (offset == 0) { 460 *paddr = vtophys(spp->stat); --- 88 unchanged lines hidden --- | 454{ 455 struct statspage *spp; 456 457 if (nprot != VM_PROT_READ) 458 return (-1); 459 TAILQ_FOREACH(spp, &pagelist, list) { 460 if (offset == 0) { 461 *paddr = vtophys(spp->stat); --- 88 unchanged lines hidden --- |