PAPI 7.1.0.0
Loading...
Searching...
No Matches
pfmlib_priv_ia64.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2003-2006 Hewlett-Packard Development Company, L.P.
3 * Contributed by Stephane Eranian <eranian@hpl.hp.com>
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9 * of the Software, and to permit persons to whom the Software is furnished to do so,
10 * subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in all
13 * copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
17 * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
18 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
19 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
20 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 *
22 * This file is part of libpfm, a performance monitoring support library for
23 * applications on Linux/ia64.
24 */
25#ifndef __PFMLIB_PRIV_IA64_H__
26#define __PFMLIB_PRIV_IA64_H__
27
28typedef struct {
29 unsigned long db_mask:56;
30 unsigned long db_plm:4;
31 unsigned long db_ig:2;
32 unsigned long db_w:1;
33 unsigned long db_rx:1;
35
36typedef union {
37 unsigned long val;
39} dbreg_t;
40
41static inline int
43{
44 return (int)((ia64_get_cpuid(3) >> 24) & 0xff);
45}
46
47static inline int
49{
50 return (int)((ia64_get_cpuid(3) >> 16) & 0xff);
51}
52
53/*
54 * find last bit set
55 */
56static inline int
57pfm_ia64_fls (unsigned long x)
58{
59 double d = x;
60 long exp;
61
62 exp = ia64_getf(d);
63 return exp - 0xffff;
64
65}
66#endif /* __PFMLIB_PRIV_IA64_H__ */
static int pfm_ia64_fls(unsigned long x)
static int pfm_ia64_get_cpu_model(void)
static int pfm_ia64_get_cpu_family(void)
unsigned long db_mask
unsigned long db_rx
unsigned long db_ig
unsigned long db_plm
unsigned long db_w
volatile double x
unsigned long val
br_mask_reg_t db