.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2012 Regents of the University of California |
---|
3 | | - * |
---|
4 | | - * This program is free software; you can redistribute it and/or |
---|
5 | | - * modify it under the terms of the GNU General Public License |
---|
6 | | - * as published by the Free Software Foundation, version 2. |
---|
7 | | - * |
---|
8 | | - * This program is distributed in the hope that it will be useful, |
---|
9 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
10 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
11 | | - * GNU General Public License for more details. |
---|
12 | 4 | */ |
---|
13 | 5 | |
---|
14 | 6 | |
---|
.. | .. |
---|
21 | 13 | /* read interrupt enabled status */ |
---|
22 | 14 | static inline unsigned long arch_local_save_flags(void) |
---|
23 | 15 | { |
---|
24 | | - return csr_read(sstatus); |
---|
| 16 | + return csr_read(CSR_STATUS); |
---|
25 | 17 | } |
---|
26 | 18 | |
---|
27 | 19 | /* unconditionally enable interrupts */ |
---|
28 | 20 | static inline void arch_local_irq_enable(void) |
---|
29 | 21 | { |
---|
30 | | - csr_set(sstatus, SR_SIE); |
---|
| 22 | + csr_set(CSR_STATUS, SR_IE); |
---|
31 | 23 | } |
---|
32 | 24 | |
---|
33 | 25 | /* unconditionally disable interrupts */ |
---|
34 | 26 | static inline void arch_local_irq_disable(void) |
---|
35 | 27 | { |
---|
36 | | - csr_clear(sstatus, SR_SIE); |
---|
| 28 | + csr_clear(CSR_STATUS, SR_IE); |
---|
37 | 29 | } |
---|
38 | 30 | |
---|
39 | 31 | /* get status and disable interrupts */ |
---|
40 | 32 | static inline unsigned long arch_local_irq_save(void) |
---|
41 | 33 | { |
---|
42 | | - return csr_read_clear(sstatus, SR_SIE); |
---|
| 34 | + return csr_read_clear(CSR_STATUS, SR_IE); |
---|
43 | 35 | } |
---|
44 | 36 | |
---|
45 | 37 | /* test flags */ |
---|
46 | 38 | static inline int arch_irqs_disabled_flags(unsigned long flags) |
---|
47 | 39 | { |
---|
48 | | - return !(flags & SR_SIE); |
---|
| 40 | + return !(flags & SR_IE); |
---|
49 | 41 | } |
---|
50 | 42 | |
---|
51 | 43 | /* test hardware interrupt enable bit */ |
---|
.. | .. |
---|
57 | 49 | /* set interrupt enabled status */ |
---|
58 | 50 | static inline void arch_local_irq_restore(unsigned long flags) |
---|
59 | 51 | { |
---|
60 | | - csr_set(sstatus, flags & SR_SIE); |
---|
| 52 | + csr_set(CSR_STATUS, flags & SR_IE); |
---|
61 | 53 | } |
---|
62 | 54 | |
---|
63 | 55 | #endif /* _ASM_RISCV_IRQFLAGS_H */ |
---|