Thomas Gleixner | 2874c5f | 2019-05-27 08:55:01 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
Jonas Bonn | 816ebaa | 2011-06-04 22:18:56 +0300 | [diff] [blame] | 2 | /* |
| 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 Bonn | 816ebaa | 2011-06-04 22:18:56 +0300 | [diff] [blame] | 11 | */ |
| 12 | |
Jonas Bonn | 816ebaa | 2011-06-04 22:18:56 +0300 | [diff] [blame] | 13 | #include <linux/interrupt.h> |
| 14 | #include <linux/init.h> |
Jonas Bonn | 816ebaa | 2011-06-04 22:18:56 +0300 | [diff] [blame] | 15 | #include <linux/ftrace.h> |
| 16 | #include <linux/irq.h> |
Stefan Kristiansson | 4db8e6d | 2014-05-26 23:31:42 +0300 | [diff] [blame] | 17 | #include <linux/irqchip.h> |
Jonas Bonn | abdf8b5 | 2012-02-15 15:00:32 +0100 | [diff] [blame] | 18 | #include <linux/export.h> |
Jonas Bonn | 816ebaa | 2011-06-04 22:18:56 +0300 | [diff] [blame] | 19 | #include <linux/irqflags.h> |
| 20 | |
| 21 | /* read interrupt enabled status */ |
| 22 | unsigned long arch_local_save_flags(void) |
| 23 | { |
| 24 | return mfspr(SPR_SR) & (SPR_SR_IEE|SPR_SR_TEE); |
| 25 | } |
| 26 | EXPORT_SYMBOL(arch_local_save_flags); |
| 27 | |
| 28 | /* set interrupt enabled status */ |
| 29 | void arch_local_irq_restore(unsigned long flags) |
| 30 | { |
| 31 | mtspr(SPR_SR, ((mfspr(SPR_SR) & ~(SPR_SR_IEE|SPR_SR_TEE)) | flags)); |
| 32 | } |
| 33 | EXPORT_SYMBOL(arch_local_irq_restore); |
| 34 | |
Jonas Bonn | 816ebaa | 2011-06-04 22:18:56 +0300 | [diff] [blame] | 35 | void __init init_IRQ(void) |
| 36 | { |
Stefan Kristiansson | 4db8e6d | 2014-05-26 23:31:42 +0300 | [diff] [blame] | 37 | irqchip_init(); |
Jonas Bonn | 816ebaa | 2011-06-04 22:18:56 +0300 | [diff] [blame] | 38 | } |
| 39 | |
Stefan Kristiansson | 4db8e6d | 2014-05-26 23:31:42 +0300 | [diff] [blame] | 40 | void __irq_entry do_IRQ(struct pt_regs *regs) |
| 41 | { |
| 42 | handle_arch_irq(regs); |
| 43 | } |