1 /* SPDX-License-Identifier: GPL-2.0-only */
4 #include <device/mmio.h>
6 #define SPIKE_CLINT_BASE 0x02000000
8 /* This function is used to initialize HLS()->time/HLS()->timecmp */
11 long hart_id
= read_csr(mhartid
);
12 HLS()->time
= (uint64_t *)(SPIKE_CLINT_BASE
+ 0xbff8);
13 HLS()->timecmp
= (uint64_t *)(SPIKE_CLINT_BASE
+ 0x4000 + 8 * hart_id
);
16 void set_msip(int hartid
, int val
)
18 write32((void *)(SPIKE_CLINT_BASE
+ 4 * (uintptr_t)hartid
), !!val
);