2018-05-06 21:58:06 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2017-12-26 05:55:51 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2017 Andes Technology Corporation
|
|
|
|
* Rick Chen, Andes Technology Corporation <rick@andestech.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ASM_RISCV_SYSTEM_H
|
|
|
|
#define __ASM_RISCV_SYSTEM_H
|
|
|
|
|
2023-05-05 08:02:06 +00:00
|
|
|
#include <asm/csr.h>
|
|
|
|
|
2022-03-04 15:43:05 +00:00
|
|
|
struct event;
|
|
|
|
|
2017-12-26 05:55:51 +00:00
|
|
|
/*
|
2023-05-05 08:02:06 +00:00
|
|
|
* Interupt configuration macros
|
2017-12-26 05:55:51 +00:00
|
|
|
*/
|
|
|
|
|
2023-05-05 08:02:06 +00:00
|
|
|
#define local_irq_save(__flags) \
|
|
|
|
do { \
|
|
|
|
__flags = csr_read_clear(CSR_SSTATUS, SR_SIE) & SR_SIE; \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define local_irq_restore(__flags) \
|
|
|
|
do { \
|
|
|
|
csr_set(CSR_SSTATUS, __flags & SR_SIE); \
|
|
|
|
} while (0)
|
|
|
|
|
2022-03-04 15:43:05 +00:00
|
|
|
/* Hook to set up the CPU (called from SPL too) */
|
2023-08-22 03:16:56 +00:00
|
|
|
int riscv_cpu_setup(void);
|
2022-03-04 15:43:05 +00:00
|
|
|
|
2017-12-26 05:55:51 +00:00
|
|
|
#endif /* __ASM_RISCV_SYSTEM_H */
|