Changeset View
Changeset View
Standalone View
Standalone View
head/sys/riscv/riscv/machdep.c
Show First 20 Lines • Show All 467 Lines • ▼ Show 20 Lines | if (!busy) | ||||
cpu_activeclock(); | cpu_activeclock(); | ||||
spinlock_exit(); | spinlock_exit(); | ||||
} | } | ||||
void | void | ||||
cpu_halt(void) | cpu_halt(void) | ||||
{ | { | ||||
/* | |||||
* Try to power down using the HSM SBI extension and fall back to a | |||||
* simple wfi loop. | |||||
*/ | |||||
intr_disable(); | intr_disable(); | ||||
if (sbi_probe_extension(SBI_EXT_ID_HSM) != 0) | |||||
sbi_hsm_hart_stop(); | |||||
for (;;) | for (;;) | ||||
__asm __volatile("wfi"); | __asm __volatile("wfi"); | ||||
/* NOTREACHED */ | |||||
} | } | ||||
/* | /* | ||||
* Flush the D-cache for non-DMA I/O so that the I-cache can | * Flush the D-cache for non-DMA I/O so that the I-cache can | ||||
* be made coherent later. | * be made coherent later. | ||||
*/ | */ | ||||
void | void | ||||
cpu_flush_dcache(void *ptr, size_t len) | cpu_flush_dcache(void *ptr, size_t len) | ||||
▲ Show 20 Lines • Show All 416 Lines • Show Last 20 Lines |