xref: /freebsd-src/sys/dev/hwpmc/hwpmc_soft.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
1f5f9340bSFabien Thomas /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
3718cf2ccSPedro F. Giffuni  *
4f5f9340bSFabien Thomas  * Copyright (c) 2012 Fabien Thomas
5f5f9340bSFabien Thomas  * All rights reserved.
6f5f9340bSFabien Thomas  *
7f5f9340bSFabien Thomas  * Redistribution and use in source and binary forms, with or without
8f5f9340bSFabien Thomas  * modification, are permitted provided that the following conditions
9f5f9340bSFabien Thomas  * are met:
10f5f9340bSFabien Thomas  * 1. Redistributions of source code must retain the above copyright
11f5f9340bSFabien Thomas  *    notice, this list of conditions and the following disclaimer.
12f5f9340bSFabien Thomas  * 2. Redistributions in binary form must reproduce the above copyright
13f5f9340bSFabien Thomas  *    notice, this list of conditions and the following disclaimer in the
14f5f9340bSFabien Thomas  *    documentation and/or other materials provided with the distribution.
15f5f9340bSFabien Thomas  *
16f5f9340bSFabien Thomas  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17f5f9340bSFabien Thomas  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18f5f9340bSFabien Thomas  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19f5f9340bSFabien Thomas  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20f5f9340bSFabien Thomas  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21f5f9340bSFabien Thomas  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22f5f9340bSFabien Thomas  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23f5f9340bSFabien Thomas  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24f5f9340bSFabien Thomas  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25f5f9340bSFabien Thomas  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26f5f9340bSFabien Thomas  * SUCH DAMAGE.
27f5f9340bSFabien Thomas  */
28f5f9340bSFabien Thomas 
29f5f9340bSFabien Thomas #ifndef _DEV_HWPMC_SOFT_H_
30f5f9340bSFabien Thomas #define _DEV_HWPMC_SOFT_H_ 1
31f5f9340bSFabien Thomas 
32f5f9340bSFabien Thomas #include <sys/pmckern.h>
33f5f9340bSFabien Thomas 
34f5f9340bSFabien Thomas #ifdef	_KERNEL
35f5f9340bSFabien Thomas 
36f5f9340bSFabien Thomas #define	PMC_CLASS_INDEX_SOFT	0
37f5f9340bSFabien Thomas #define	SOFT_NPMCS		16
38f5f9340bSFabien Thomas 
39f5f9340bSFabien Thomas /*
40f5f9340bSFabien Thomas  * Prototypes.
41f5f9340bSFabien Thomas  */
42f5f9340bSFabien Thomas 
43f5f9340bSFabien Thomas void pmc_soft_initialize(struct pmc_mdep *md);
44f5f9340bSFabien Thomas void pmc_soft_finalize(struct pmc_mdep *md);
45f5f9340bSFabien Thomas int pmc_soft_intr(struct pmckern_soft *ks);
46f5f9340bSFabien Thomas 
47f5f9340bSFabien Thomas #endif	/* _KERNEL */
48f5f9340bSFabien Thomas #endif	/* _DEV_HWPMC_SOFT_H */
49