Index: sparc64/autoconf.c =================================================================== RCS file: /cvsroot/src/sys/arch/sparc64/sparc64/autoconf.c,v retrieving revision 1.176 diff -p -r1.176 autoconf.c *** sparc64/autoconf.c 11 Aug 2010 19:14:26 -0000 1.176 --- sparc64/autoconf.c 1 Mar 2011 10:52:47 -0000 *************** __KERNEL_RCSID(0, "$NetBSD: autoconf.c,v *** 91,96 **** --- 91,97 ---- #include #include #include + #include #include #include *************** struct evcnt intr_evcnts[] = { *** 128,134 **** EVCNT_INITIALIZER(EVCNT_TYPE_INTR, NULL, "intr", "lev12"), EVCNT_INITIALIZER(EVCNT_TYPE_INTR, NULL, "intr", "lev13"), EVCNT_INITIALIZER(EVCNT_TYPE_INTR, NULL, "intr", "prof"), ! EVCNT_INITIALIZER(EVCNT_TYPE_INTR, NULL, "intr", "lev15") }; void *bootinfo = 0; --- 129,140 ---- EVCNT_INITIALIZER(EVCNT_TYPE_INTR, NULL, "intr", "lev12"), EVCNT_INITIALIZER(EVCNT_TYPE_INTR, NULL, "intr", "lev13"), EVCNT_INITIALIZER(EVCNT_TYPE_INTR, NULL, "intr", "prof"), ! EVCNT_INITIALIZER(EVCNT_TYPE_INTR, NULL, "intr", "lev15"), ! }; ! ! struct evcnt misc_evcnts[] = { ! EVCNT_INITIALIZER(EVCNT_TYPE_INTR, NULL, "busdma", "null unload"), ! EVCNT_INITIALIZER(EVCNT_TYPE_INTR, NULL, "busdma", "null sync"), }; void *bootinfo = 0; *************** extern struct sparc_bus_space_tag mainbu *** 589,598 **** panic("None of the CPUs found"); /* ! * Init static interrupt eventcounters */ for (i = 0; i < sizeof(intr_evcnts)/sizeof(intr_evcnts[0]); i++) evcnt_attach_static(&intr_evcnts[i]); node = findroot(); --- 595,608 ---- panic("None of the CPUs found"); /* ! * Init static event counters. We do this here as we need ! * evcnt_init() to be setup, and this is the most convient ! * place to do this afterwards. */ for (i = 0; i < sizeof(intr_evcnts)/sizeof(intr_evcnts[0]); i++) evcnt_attach_static(&intr_evcnts[i]); + for (i = 0; i < sizeof(misc_evcnts)/sizeof(misc_evcnts[0]); i++) + evcnt_attach_static(&misc_evcnts[i]); node = findroot(); Index: sparc64/evcnts.h =================================================================== RCS file: sparc64/evcnts.h diff -N sparc64/evcnts.h *** /dev/null 1 Jan 1970 00:00:00 -0000 --- sparc64/evcnts.h 1 Mar 2011 10:52:47 -0000 *************** *** 0 **** --- 1,55 ---- + /* $NetBSD$ */ + + /* + * Copyright (c) 2011 Matthew R. Green + * 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. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + /* + * declare the various evcnt(9) counters used in sparc64 MD code. + */ + #ifndef _SPARC64_EVCNTS_H_ + #define _SPARC64_EVCNTS_H_ + + #include + + /* + * Global interrupt counters, level 0 (spurious) to level 15. These + * are handled inside locore. + */ + extern struct evcnt intr_evcnts[]; + + /* + * Misc. counters: + */ + extern struct evcnt misc_evcnts[]; + #define SP64_EVCNT_NULL_UNLOAD 0 /* got a NULL address + * in a bus_dmamem_unload */ + #define SP64_EVCNT_NULL_SYNC 1 /* got a NULL address + * in a bus_dmamem_sync */ + + + #endif /* _SPARC64_EVCNTS_H_ */ Index: sparc64/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/sparc64/sparc64/machdep.c,v retrieving revision 1.255 diff -p -r1.255 machdep.c *** sparc64/machdep.c 14 Jan 2011 02:06:32 -0000 1.255 --- sparc64/machdep.c 1 Mar 2011 10:52:48 -0000 *************** __KERNEL_RCSID(0, "$NetBSD: machdep.c,v *** 129,134 **** --- 129,135 ---- #include #include + #include /* #include "fb.h" */ *************** _bus_dmamap_unload(bus_dma_tag_t t, bus_ *** 1289,1294 **** --- 1290,1296 ---- * PA info so just blow the entire cache away. */ blast_dcache(); + misc_evcnts[SP64_EVCNT_NULL_UNLOAD].ev_count++; break; } TAILQ_FOREACH(pg, pglist, pageq.queue) { *************** _bus_dmamap_sync(bus_dma_tag_t t, bus_dm *** 1320,1325 **** --- 1322,1330 ---- int i; struct vm_page *pg; struct pglist *pglist; + #if 0 + extern bool tomatillo_extra_blk_commit; + #endif /* * We sync out our caches, but the bus must do the same. *************** _bus_dmamap_sync(bus_dma_tag_t t, bus_dm *** 1337,1345 **** if (ops & BUS_DMASYNC_POSTREAD) { /* Invalidate the vcache */ for (i = 0; i < map->dm_nsegs; i++) { ! if ((pglist = map->dm_segs[i]._ds_mlist) == NULL) /* Should not really happen. */ continue; TAILQ_FOREACH(pg, pglist, pageq.queue) { paddr_t start; psize_t size = PAGE_SIZE; --- 1342,1357 ---- if (ops & BUS_DMASYNC_POSTREAD) { /* Invalidate the vcache */ for (i = 0; i < map->dm_nsegs; i++) { ! if ((pglist = map->dm_segs[i]._ds_mlist) == NULL) { /* Should not really happen. */ + misc_evcnts[SP64_EVCNT_NULL_SYNC].ev_count++; + #if 0 continue; + #else + blast_dcache(); + goto done; + #endif + } TAILQ_FOREACH(pg, pglist, pageq.queue) { paddr_t start; psize_t size = PAGE_SIZE;