3 * Copyright (C) 2001 Dave Engebretsen & Mike Corrigan IBM Corporation.
5 * The PPC64 PMC subsystem encompases both the hardware PMC registers and
6 * a set of software event counters. An interface is provided via the
7 * proc filesystem which can be used to access this subsystem.
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 * 2001/06/05 : engebret : Created.
29 #ifndef _PPC64_TYPES_H
30 #include <asm/types.h>
36 #define STAB_ENTRY_MAX 64
56 u64 stab_faults; /* Count of faults on the stab */
57 u64 stab_capacity_castouts;/* Count of castouts from the stab */
58 u64 stab_invalidations; /* Count of invalidations from the */
59 /* stab, not including castouts */
60 u64 stab_entry_use[STAB_ENTRY_MAX];
62 u64 htab_primary_overflows;
63 u64 htab_capacity_castouts;
64 u64 htab_read_to_write_fault;
67 #define PMC_HW_TEXT_ENTRY_COUNT (sizeof(struct _pmc_hw) / sizeof(u64))
68 #define PMC_SW_TEXT_ENTRY_COUNT (sizeof(struct _pmc_sw) / sizeof(u64))
69 #define PMC_TEXT_ENTRY_SIZE 64
72 char buffer[PMC_SW_TEXT_ENTRY_COUNT * PMC_TEXT_ENTRY_SIZE];
76 char buffer[PMC_HW_TEXT_ENTRY_COUNT * PMC_TEXT_ENTRY_SIZE];
79 extern struct _pmc_sw pmc_sw_system;
80 extern struct _pmc_sw pmc_sw_cpu[];
82 extern struct _pmc_sw_text pmc_sw_text;
83 extern struct _pmc_hw_text pmc_hw_text;
84 extern char *ppc64_pmc_stab(int file);
85 extern char *ppc64_pmc_htab(int file);
86 extern char *ppc64_pmc_hw(int file);
88 void *btmalloc(unsigned long size);
89 void btfree(void *addr);
92 #define PMC_SW_PROCESSOR(F) pmc_sw_cpu[smp_processor_id()].F++
93 #define PMC_SW_PROCESSOR_A(F, E) (pmc_sw_cpu[smp_processor_id()].F[(E)])++
94 #define PMC_SW_SYSTEM(F) pmc_sw_system.F++
96 #define PMC_SW_PROCESSOR(F) do {;} while (0)
97 #define PMC_SW_PROCESSOR_A(F) do {;} while (0)
98 #define PMC_SW_SYSTEM(F) do {;} while (0)
101 #define PMC_CONTROL_CPI 1
102 #define PMC_CONTROL_TLB 2
104 /* To find an entry in the bolted page-table-directory */
105 #define pgd_offset_b(address) (bolted_pgd + pgd_index(address))
106 #define BTMALLOC_START 0xB000000000000000
107 #define BTMALLOC_END 0xB0000000ffffffff /* 4 GB Max-more or less arbitrary */