blob: c38fa863afa8d9d0616e214c8bf0a40af754e790 [file] [log] [blame]
Thomas Gleixner2874c5f2019-05-27 08:55:01 +02001// SPDX-License-Identifier: GPL-2.0-or-later
Jonas Bonn816ebaa2011-06-04 22:18:56 +03002/*
3 * OpenRISC irq.c
4 *
5 * Linux architectural port borrowing liberally from similar works of
6 * others. All original copyrights apply as per the original source
7 * declaration.
8 *
9 * Modifications for the OpenRISC architecture:
10 * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
Jonas Bonn816ebaa2011-06-04 22:18:56 +030011 */
12
Jonas Bonn816ebaa2011-06-04 22:18:56 +030013#include <linux/interrupt.h>
14#include <linux/init.h>
Jonas Bonn816ebaa2011-06-04 22:18:56 +030015#include <linux/ftrace.h>
16#include <linux/irq.h>
Stefan Kristiansson4db8e6d2014-05-26 23:31:42 +030017#include <linux/irqchip.h>
Jonas Bonnabdf8b52012-02-15 15:00:32 +010018#include <linux/export.h>
Jonas Bonn816ebaa2011-06-04 22:18:56 +030019#include <linux/irqflags.h>
20
21/* read interrupt enabled status */
22unsigned long arch_local_save_flags(void)
23{
24 return mfspr(SPR_SR) & (SPR_SR_IEE|SPR_SR_TEE);
25}
26EXPORT_SYMBOL(arch_local_save_flags);
27
28/* set interrupt enabled status */
29void arch_local_irq_restore(unsigned long flags)
30{
31 mtspr(SPR_SR, ((mfspr(SPR_SR) & ~(SPR_SR_IEE|SPR_SR_TEE)) | flags));
32}
33EXPORT_SYMBOL(arch_local_irq_restore);
34
Jonas Bonn816ebaa2011-06-04 22:18:56 +030035void __init init_IRQ(void)
36{
Stefan Kristiansson4db8e6d2014-05-26 23:31:42 +030037 irqchip_init();
Jonas Bonn816ebaa2011-06-04 22:18:56 +030038}
39
Stefan Kristiansson4db8e6d2014-05-26 23:31:42 +030040void __irq_entry do_IRQ(struct pt_regs *regs)
41{
42 handle_arch_irq(regs);
43}