/*-1* Copyright (c) 2009 Rui Paulo <[email protected]>2* All rights reserved.3*4* Redistribution and use in source and binary forms, with or without5* modification, are permitted provided that the following conditions6* are met:7* 1. Redistributions of source code must retain the above copyright8* notice, this list of conditions and the following disclaimer.9* 2. Redistributions in binary form must reproduce the above copyright10* notice, this list of conditions and the following disclaimer in the11* documentation and/or other materials provided with the distribution.12*13* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR14* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED15* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE16* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,17* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES18* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR19* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)20* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,21* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN22* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE23* POSSIBILITY OF SUCH DAMAGE.24*/2526#ifndef _MACHINE_PMC_MDEP_H_27#define _MACHINE_PMC_MDEP_H_2829#define PMC_MDEP_CLASS_INDEX_RISCV 130/*31* On the RISC-V platform we don't support any PMCs yet.32*/33#include <dev/hwpmc/hwpmc_riscv.h>3435union pmc_md_op_pmcallocate {36uint64_t __pad[4];37};3839/* Logging */40#define PMCLOG_READADDR PMCLOG_READ6441#define PMCLOG_EMITADDR PMCLOG_EMIT644243#ifdef _KERNEL44union pmc_md_pmc {45struct pmc_md_riscv_pmc pm_riscv;46};4748#define PMC_IN_KERNEL_STACK(va) kstack_contains(curthread, (va), sizeof(va))49#define PMC_IN_KERNEL(va) INKERNEL((va))50#define PMC_IN_USERSPACE(va) ((va) <= VM_MAXUSER_ADDRESS)51#define PMC_TRAPFRAME_TO_PC(TF) ((TF)->tf_ra)52#define PMC_TRAPFRAME_TO_FP(TF) (0) /* stub */5354/*55* Prototypes56*/57struct pmc_mdep *pmc_riscv_initialize(void);58void pmc_riscv_finalize(struct pmc_mdep *_md);59#endif /* _KERNEL */6061#endif /* !_MACHINE_PMC_MDEP_H_ */626364