4
* Daniel Hellstrom, Gaisler Research, daniel@gaisler.com.
6
* SPDX-License-Identifier: GPL-2.0+
9
#ifndef __SPARC_IRQ_H__
10
#define __SPARC_IRQ_H__
14
/* Set SPARC Processor Interrupt Level */
15
extern inline void set_pil(unsigned int level)
17
unsigned int psr = get_psr();
19
put_psr((psr & ~PSR_PIL) | ((level & 0xf) << PSR_PIL_OFS));
22
/* Get SPARC Processor Interrupt Level */
23
extern inline unsigned int get_pil(void)
25
unsigned int psr = get_psr();
26
return (psr & PSR_PIL) >> PSR_PIL_OFS;
29
/* Disables interrupts and return current PIL value */
30
extern int intLock(void);
32
/* Sets the PIL to oldLevel */
33
extern void intUnlock(int oldLevel);