pmc_mdep.h (147191) | pmc_mdep.h (174395) |
---|---|
1/*- 2 * Copyright (c) 2003-2005 Joseph Koshy | 1/*- 2 * Copyright (c) 2003-2005 Joseph Koshy |
3 * Copyright (c) 2007 The FreeBSD Foundation |
|
3 * All rights reserved. 4 * | 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 * |
|
5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. --- 5 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 9 * Redistribution and use in source and binary forms, with or without 10 * modification, are permitted provided that the following conditions 11 * are met: 12 * 1. Redistributions of source code must retain the above copyright 13 * notice, this list of conditions and the following disclaimer. 14 * 2. Redistributions in binary form must reproduce the above copyright 15 * notice, this list of conditions and the following disclaimer in the 16 * documentation and/or other materials provided with the distribution. --- 5 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 * |
26 * $FreeBSD: head/sys/i386/include/pmc_mdep.h 147191 2005-06-09 19:45:09Z jkoshy $ | 30 * $FreeBSD: head/sys/i386/include/pmc_mdep.h 174395 2007-12-07 08:20:17Z jkoshy $ |
27 */ 28 29#ifndef _MACHINE_PMC_MDEP_H 30#define _MACHINE_PMC_MDEP_H 1 31 32/* 33 * On the i386 platform we support the following PMCs. 34 * --- 33 unchanged lines hidden (view full) --- 68 struct pmc_md_amd_pmc pm_amd; 69 struct pmc_md_ppro_pmc pm_ppro; 70 struct pmc_md_pentium_pmc pm_pentium; 71 struct pmc_md_p4_pmc pm_p4; 72}; 73 74struct pmc; 75 | 31 */ 32 33#ifndef _MACHINE_PMC_MDEP_H 34#define _MACHINE_PMC_MDEP_H 1 35 36/* 37 * On the i386 platform we support the following PMCs. 38 * --- 33 unchanged lines hidden (view full) --- 72 struct pmc_md_amd_pmc pm_amd; 73 struct pmc_md_ppro_pmc pm_ppro; 74 struct pmc_md_pentium_pmc pm_pentium; 75 struct pmc_md_p4_pmc pm_p4; 76}; 77 78struct pmc; 79 |
80#define PMC_TRAPFRAME_TO_PC(TF) ((TF)->tf_eip) 81#define PMC_TRAPFRAME_TO_FP(TF) ((TF)->tf_ebp) 82#define PMC_TRAPFRAME_TO_SP(TF) ((TF)->tf_esp) 83 84#define PMC_IN_KERNEL_STACK(S,START,END) \ 85 ((S) >= (START) && (S) < (END)) 86#define PMC_IN_KERNEL(va) (((va) >= USRSTACK) && \ 87 ((va) < VM_MAX_KERNEL_ADDRESS)) 88 89#define PMC_IN_USERSPACE(va) ((va) <= VM_MAXUSER_ADDRESS) 90 91#define PMC_IN_TRAP_HANDLER(PC) \ 92 ((PC) >= (uintptr_t) start_exceptions && \ 93 (PC) < (uintptr_t) end_exceptions) 94 95#define PMC_AT_FUNCTION_PROLOGUE_PUSH_BP(I) \ 96 (((I) & 0xffffffff) == 0xe5894855) /* pushq %rbp; movq %rsp,%rbp */ 97#define PMC_AT_FUNCTION_PROLOGUE_MOV_SP_BP(I) \ 98 (((I) & 0x00ffffff) == 0x00e58948) /* movq %rsp,%rbp */ 99#define PMC_AT_FUNCTION_EPILOGUE_RET(I) \ 100 (((I) & 0xFF) == 0xC3) /* ret */ 101 |
|
76/* 77 * Prototypes 78 */ 79 | 102/* 103 * Prototypes 104 */ 105 |
106void start_exceptions(void), end_exceptions(void); |
|
80void pmc_x86_lapic_enable_pmc_interrupt(void); 81 82#endif /* _KERNEL */ 83#endif /* _MACHINE_PMC_MDEP_H */ | 107void pmc_x86_lapic_enable_pmc_interrupt(void); 108 109#endif /* _KERNEL */ 110#endif /* _MACHINE_PMC_MDEP_H */ |