Snitch Runtime
Loading...
Searching...
No Matches
cluster_interrupts.h
1// Copyright 2023 ETH Zurich and University of Bologna.
2// Licensed under the Apache License, Version 2.0, see LICENSE for details.
3// SPDX-License-Identifier: Apache-2.0
4
5#pragma once
6
7#include "../../deps/riscv-opcodes/encoding.h"
8
13inline void snrt_int_cluster_set(uint32_t mask) {
14 *(snrt_cluster_clint_set_ptr()) = mask;
15}
16
21inline void snrt_int_cluster_clr(uint32_t mask) {
22 *(snrt_cluster_clint_clr_ptr()) = mask;
23}
24
32inline void snrt_int_clr_mcip_unsafe() {
33 snrt_int_cluster_clr(1 << snrt_cluster_core_idx());
34}
35
39inline void snrt_int_wait_mcip_clr() {
40 while (read_csr(mip) & MIP_MCIP)
41 ;
42}
43
47inline void snrt_int_clr_mcip() {
48 snrt_int_clr_mcip_unsafe();
49 snrt_int_wait_mcip_clr();
50}
51
52inline void snrt_int_set_mcip() {
53 snrt_int_cluster_set(1 << snrt_cluster_core_idx());
54}