hwpmc_piv.c (184802) | hwpmc_piv.c (185341) |
---|---|
1/*- 2 * Copyright (c) 2003-2007 Joseph Koshy 3 * Copyright (c) 2007 The FreeBSD Foundation 4 * All rights reserved. 5 * 6 * Portions of this software were developed by A. Joseph Koshy under 7 * sponsorship from the FreeBSD Foundation and Google, Inc. 8 * --- 15 unchanged lines hidden (view full) --- 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 */ 30 31#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2003-2007 Joseph Koshy 3 * Copyright (c) 2007 The FreeBSD Foundation 4 * All rights reserved. 5 * 6 * Portions of this software were developed by A. Joseph Koshy under 7 * sponsorship from the FreeBSD Foundation and Google, Inc. 8 * --- 15 unchanged lines hidden (view full) --- 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 */ 30 31#include <sys/cdefs.h> |
32__FBSDID("$FreeBSD: head/sys/dev/hwpmc/hwpmc_piv.c 184802 2008-11-09 17:37:54Z jkoshy $"); | 32__FBSDID("$FreeBSD: head/sys/dev/hwpmc/hwpmc_piv.c 185341 2008-11-26 19:25:13Z jkim $"); |
33 34#include <sys/param.h> 35#include <sys/lock.h> 36#include <sys/mutex.h> 37#include <sys/pmc.h> 38#include <sys/pmckern.h> 39#include <sys/smp.h> 40#include <sys/systm.h> 41 42#include <machine/cpu.h> 43#include <machine/cpufunc.h> | 33 34#include <sys/param.h> 35#include <sys/lock.h> 36#include <sys/mutex.h> 37#include <sys/pmc.h> 38#include <sys/pmckern.h> 39#include <sys/smp.h> 40#include <sys/systm.h> 41 42#include <machine/cpu.h> 43#include <machine/cpufunc.h> |
44#include <machine/cputypes.h> |
|
44#include <machine/md_var.h> 45#include <machine/specialreg.h> 46 47/* 48 * PENTIUM 4 SUPPORT 49 * 50 * The P4 has 18 PMCs, divided into 4 groups with 4,4,4 and 6 PMCs 51 * respectively. Each PMC comprises of two model specific registers: --- 1553 unchanged lines hidden (view full) --- 1605 1606int 1607pmc_p4_initialize(struct pmc_mdep *md, int ncpus) 1608{ 1609 struct pmc_classdep *pcd; 1610 struct p4_event_descr *pe; 1611 1612 KASSERT(md != NULL, ("[p4,%d] md is NULL", __LINE__)); | 45#include <machine/md_var.h> 46#include <machine/specialreg.h> 47 48/* 49 * PENTIUM 4 SUPPORT 50 * 51 * The P4 has 18 PMCs, divided into 4 groups with 4,4,4 and 6 PMCs 52 * respectively. Each PMC comprises of two model specific registers: --- 1553 unchanged lines hidden (view full) --- 1606 1607int 1608pmc_p4_initialize(struct pmc_mdep *md, int ncpus) 1609{ 1610 struct pmc_classdep *pcd; 1611 struct p4_event_descr *pe; 1612 1613 KASSERT(md != NULL, ("[p4,%d] md is NULL", __LINE__)); |
1613 KASSERT(strcmp(cpu_vendor, "GenuineIntel") == 0, | 1614 KASSERT(cpu_vendor_id == CPU_VENDOR_INTEL, |
1614 ("[p4,%d] Initializing non-intel processor", __LINE__)); 1615 1616 PMCDBG(MDP,INI,1, "%s", "p4-initialize"); 1617 1618 /* Allocate space for pointers to per-cpu descriptors. */ 1619 p4_pcpu = malloc(sizeof(struct p4_cpu **) * ncpus, M_PMC, 1620 M_ZERO|M_WAITOK); 1621 --- 73 unchanged lines hidden --- | 1615 ("[p4,%d] Initializing non-intel processor", __LINE__)); 1616 1617 PMCDBG(MDP,INI,1, "%s", "p4-initialize"); 1618 1619 /* Allocate space for pointers to per-cpu descriptors. */ 1620 p4_pcpu = malloc(sizeof(struct p4_cpu **) * ncpus, M_PMC, 1621 M_ZERO|M_WAITOK); 1622 --- 73 unchanged lines hidden --- |