hwpmc_powerpc.h revision 261342
155714Skris/*- 255714Skris * Copyright (c) 2013 Justin Hibbits 355714Skris * All rights reserved. 455714Skris * 555714Skris * Redistribution and use in source and binary forms, with or without 655714Skris * modification, are permitted provided that the following conditions 755714Skris * are met: 8280304Sjkim * 1. Redistributions of source code must retain the above copyright 955714Skris * notice, this list of conditions and the following disclaimer. 1055714Skris * 2. Redistributions in binary form must reproduce the above copyright 1155714Skris * notice, this list of conditions and the following disclaimer in the 1255714Skris * documentation and/or other materials provided with the distribution. 1355714Skris * 1455714Skris * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15280304Sjkim * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1655714Skris * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1755714Skris * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1855714Skris * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1955714Skris * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2055714Skris * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2155714Skris * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22280304Sjkim * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2355714Skris * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2455714Skris * SUCH DAMAGE. 2555714Skris * 2655714Skris * $FreeBSD: head/sys/dev/hwpmc/hwpmc_powerpc.h 261342 2014-02-01 02:03:50Z jhibbits $ 2755714Skris */ 2855714Skris 2955714Skris#ifndef _DEV_HWPMC_POWERPC_H_ 3055714Skris#define _DEV_HWPMC_POWERPC_H_ 1 3155714Skris 3255714Skris#ifdef _KERNEL 3355714Skris 3455714Skris#define POWERPC_PMC_CAPS (PMC_CAP_INTERRUPT | PMC_CAP_USER | \ 3555714Skris PMC_CAP_SYSTEM | PMC_CAP_EDGE | \ 3655714Skris PMC_CAP_THRESHOLD | PMC_CAP_READ | \ 37280304Sjkim PMC_CAP_WRITE | PMC_CAP_INVERT | \ 3855714Skris PMC_CAP_QUALIFIER) 3955714Skris 40280304Sjkim#define POWERPC_PMC_KERNEL_ENABLE (0x1 << 30) 4155714Skris#define POWERPC_PMC_USER_ENABLE (0x1 << 31) 4255714Skris 4355714Skris#define POWERPC_PMC_ENABLE (POWERPC_PMC_KERNEL_ENABLE | POWERPC_PMC_USER_ENABLE) 4455714Skris#define POWERPC_RELOAD_COUNT_TO_PERFCTR_VALUE(V) (0x80000000-(V)) 4555714Skris#define POWERPC_PERFCTR_VALUE_TO_RELOAD_COUNT(P) (0x80000000-(P)) 4655714Skris 4755714Skrisstruct powerpc_cpu { 4855714Skris struct pmc_hw *pc_ppcpmcs; 4955714Skris enum pmc_class pc_class; 5055714Skris}; 5155714Skris 52280304Sjkimextern struct powerpc_cpu **powerpc_pcpu; 5355714Skris 5455714Skrisextern int pmc_mpc7xxx_initialize(struct pmc_mdep *pmc_mdep); 5555714Skrisextern int pmc_ppc970_initialize(struct pmc_mdep *pmc_mdep); 5655714Skris 5755714Skrisextern int powerpc_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc); 5855714Skrisextern int powerpc_get_config(int cpu, int ri, struct pmc **ppm); 5955714Skris#endif /* _KERNEL */ 6055714Skris 6155714Skris#endif /* _DEV_HWPMC_POWERPC_H_ */ 6268651Skris