Deleted Added
full compact
pmc.h (184802) pmc.h (185363)
1/*-
2 * Copyright (c) 2003-2008, 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 *

--- 13 unchanged lines hidden (view full) ---

22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
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 *
1/*-
2 * Copyright (c) 2003-2008, 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 *

--- 13 unchanged lines hidden (view full) ---

22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
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 * $FreeBSD: head/sys/sys/pmc.h 184802 2008-11-09 17:37:54Z jkoshy $
30 * $FreeBSD: head/sys/sys/pmc.h 185363 2008-11-27 09:00:47Z jkoshy $
31 */
32
33#ifndef _SYS_PMC_H_
34#define _SYS_PMC_H_
35
36#include <dev/hwpmc/pmc_events.h>
37
38#include <machine/pmc_mdep.h>

--- 11 unchanged lines hidden (view full) ---

50 *
51 * Minor numbers are incremented when a backwards compatible change
52 * occurs that allows older correct programs to run unchanged. For
53 * example, when support for a new PMC type is added.
54 *
55 * The patch version is incremented for every bug fix.
56 */
57#define PMC_VERSION_MAJOR 0x03
31 */
32
33#ifndef _SYS_PMC_H_
34#define _SYS_PMC_H_
35
36#include <dev/hwpmc/pmc_events.h>
37
38#include <machine/pmc_mdep.h>

--- 11 unchanged lines hidden (view full) ---

50 *
51 * Minor numbers are incremented when a backwards compatible change
52 * occurs that allows older correct programs to run unchanged. For
53 * example, when support for a new PMC type is added.
54 *
55 * The patch version is incremented for every bug fix.
56 */
57#define PMC_VERSION_MAJOR 0x03
58#define PMC_VERSION_MINOR 0x00
58#define PMC_VERSION_MINOR 0x01
59#define PMC_VERSION_PATCH 0x0000
60
61#define PMC_VERSION (PMC_VERSION_MAJOR << 24 | \
62 PMC_VERSION_MINOR << 16 | PMC_VERSION_PATCH)
63
64/*
65 * Kinds of CPUs known.
66 *

--- 10 unchanged lines hidden (view full) ---

77 __PMC_CPU(INTEL_P6, 0x81, "Intel Pentium Pro") \
78 __PMC_CPU(INTEL_CL, 0x82, "Intel Celeron") \
79 __PMC_CPU(INTEL_PII, 0x83, "Intel Pentium II") \
80 __PMC_CPU(INTEL_PIII, 0x84, "Intel Pentium III") \
81 __PMC_CPU(INTEL_PM, 0x85, "Intel Pentium M") \
82 __PMC_CPU(INTEL_PIV, 0x86, "Intel Pentium IV") \
83 __PMC_CPU(INTEL_CORE, 0x87, "Intel Core Solo/Duo") \
84 __PMC_CPU(INTEL_CORE2, 0x88, "Intel Core2") \
59#define PMC_VERSION_PATCH 0x0000
60
61#define PMC_VERSION (PMC_VERSION_MAJOR << 24 | \
62 PMC_VERSION_MINOR << 16 | PMC_VERSION_PATCH)
63
64/*
65 * Kinds of CPUs known.
66 *

--- 10 unchanged lines hidden (view full) ---

77 __PMC_CPU(INTEL_P6, 0x81, "Intel Pentium Pro") \
78 __PMC_CPU(INTEL_CL, 0x82, "Intel Celeron") \
79 __PMC_CPU(INTEL_PII, 0x83, "Intel Pentium II") \
80 __PMC_CPU(INTEL_PIII, 0x84, "Intel Pentium III") \
81 __PMC_CPU(INTEL_PM, 0x85, "Intel Pentium M") \
82 __PMC_CPU(INTEL_PIV, 0x86, "Intel Pentium IV") \
83 __PMC_CPU(INTEL_CORE, 0x87, "Intel Core Solo/Duo") \
84 __PMC_CPU(INTEL_CORE2, 0x88, "Intel Core2") \
85 __PMC_CPU(INTEL_CORE2EXTREME, 0x89, "Intel Core2 Extreme") \
85 __PMC_CPU(INTEL_ATOM, 0x8A, "Intel Atom")
86
87enum pmc_cputype {
88#undef __PMC_CPU
89#define __PMC_CPU(S,V,D) PMC_CPU_##S = V,
90 __PMC_CPUS()
91};
92

--- 822 unchanged lines hidden (view full) ---

915 uint32_t pmd_npmc; /* number of PMCs per CPU */
916 uint32_t pmd_nclass; /* number of PMC classes present */
917
918 /*
919 * Machine dependent methods.
920 */
921
922 /* per-cpu initialization and finalization */
86 __PMC_CPU(INTEL_ATOM, 0x8A, "Intel Atom")
87
88enum pmc_cputype {
89#undef __PMC_CPU
90#define __PMC_CPU(S,V,D) PMC_CPU_##S = V,
91 __PMC_CPUS()
92};
93

--- 822 unchanged lines hidden (view full) ---

916 uint32_t pmd_npmc; /* number of PMCs per CPU */
917 uint32_t pmd_nclass; /* number of PMC classes present */
918
919 /*
920 * Machine dependent methods.
921 */
922
923 /* per-cpu initialization and finalization */
923 int (*pmd_pcpu_init)(int _cpu); /* initialization */
924 int (*pmd_pcpu_fini)(int _cpu); /* finalization */
924 int (*pmd_pcpu_init)(struct pmc_mdep *_md, int _cpu);
925 int (*pmd_pcpu_fini)(struct pmc_mdep *_md, int _cpu);
925
926 /* thread context switch in/out */
927 int (*pmd_switch_in)(struct pmc_cpu *_p, struct pmc_process *_pp);
928 int (*pmd_switch_out)(struct pmc_cpu *_p, struct pmc_process *_pp);
929
930 /* handle a PMC interrupt */
931 int (*pmd_intr)(int _cpu, struct trapframe *_tf);
932

--- 4 unchanged lines hidden (view full) ---

937};
938
939/*
940 * Per-CPU state. This is an array of 'mp_ncpu' pointers
941 * to struct pmc_cpu descriptors.
942 */
943
944extern struct pmc_cpu **pmc_pcpu;
926
927 /* thread context switch in/out */
928 int (*pmd_switch_in)(struct pmc_cpu *_p, struct pmc_process *_pp);
929 int (*pmd_switch_out)(struct pmc_cpu *_p, struct pmc_process *_pp);
930
931 /* handle a PMC interrupt */
932 int (*pmd_intr)(int _cpu, struct trapframe *_tf);
933

--- 4 unchanged lines hidden (view full) ---

938};
939
940/*
941 * Per-CPU state. This is an array of 'mp_ncpu' pointers
942 * to struct pmc_cpu descriptors.
943 */
944
945extern struct pmc_cpu **pmc_pcpu;
945extern struct pmc_mdep *md;
946
947/* driver statistics */
948extern struct pmc_op_getdriverstats pmc_stats;
949
950#if defined(DEBUG) && DEBUG
951
952/* debug flags, major flag groups */
953struct pmc_debugflags {

--- 106 unchanged lines hidden ---
946
947/* driver statistics */
948extern struct pmc_op_getdriverstats pmc_stats;
949
950#if defined(DEBUG) && DEBUG
951
952/* debug flags, major flag groups */
953struct pmc_debugflags {

--- 106 unchanged lines hidden ---