]> git.ipfire.org Git - people/ms/u-boot.git/blame - arch/sparc/include/asm/irq.h
Add GPL-2.0+ SPDX-License-Identifier to source files
[people/ms/u-boot.git] / arch / sparc / include / asm / irq.h
CommitLineData
c2f02da2
DH
1/* IRQ functions
2 *
3 * (C) Copyright 2007
4 * Daniel Hellstrom, Gaisler Research, daniel@gaisler.com.
5 *
1a459660 6 * SPDX-License-Identifier: GPL-2.0+
c2f02da2
DH
7 */
8
9#ifndef __SPARC_IRQ_H__
10#define __SPARC_IRQ_H__
11
12#include <asm/psr.h>
13
14/* Set SPARC Processor Interrupt Level */
15extern inline void set_pil(unsigned int level)
16{
17 unsigned int psr = get_psr();
18
19 put_psr((psr & ~PSR_PIL) | ((level & 0xf) << PSR_PIL_OFS));
20}
21
22/* Get SPARC Processor Interrupt Level */
23extern inline unsigned int get_pil(void)
24{
25 unsigned int psr = get_psr();
26 return (psr & PSR_PIL) >> PSR_PIL_OFS;
27}
28
29/* Disables interrupts and return current PIL value */
30extern int intLock(void);
31
32/* Sets the PIL to oldLevel */
33extern void intUnlock(int oldLevel);
34
35#endif