2
0

riscv-iommu-hpm.h 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * RISC-V IOMMU - Hardware Performance Monitor (HPM) helpers
  3. *
  4. * Copyright (C) 2022-2023 Rivos Inc.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms and conditions of the GNU General Public License,
  8. * version 2 or later, as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License along
  16. * with this program; if not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef HW_RISCV_IOMMU_HPM_H
  19. #define HW_RISCV_IOMMU_HPM_H
  20. #include "qom/object.h"
  21. #include "hw/riscv/riscv-iommu.h"
  22. uint64_t riscv_iommu_hpmcycle_read(RISCVIOMMUState *s);
  23. void riscv_iommu_hpm_incr_ctr(RISCVIOMMUState *s, RISCVIOMMUContext *ctx,
  24. unsigned event_id);
  25. void riscv_iommu_hpm_timer_cb(void *priv);
  26. void riscv_iommu_process_iocntinh_cy(RISCVIOMMUState *s, bool prev_cy_inh);
  27. void riscv_iommu_process_hpmcycle_write(RISCVIOMMUState *s);
  28. void riscv_iommu_process_hpmevt_write(RISCVIOMMUState *s, uint32_t evt_reg);
  29. #endif