Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * Copyright (C) 1992, 1998-2006 Linus Torvalds, Ingo Molnar
0004  * Copyright (C) 2005-2006, Thomas Gleixner, Russell King
0005  *
0006  * This file contains the dummy interrupt chip implementation
0007  */
0008 #include <linux/interrupt.h>
0009 #include <linux/irq.h>
0010 #include <linux/export.h>
0011 
0012 #include "internals.h"
0013 
0014 /*
0015  * What should we do if we get a hw irq event on an illegal vector?
0016  * Each architecture has to answer this themselves.
0017  */
0018 static void ack_bad(struct irq_data *data)
0019 {
0020     struct irq_desc *desc = irq_data_to_desc(data);
0021 
0022     print_irq_desc(data->irq, desc);
0023     ack_bad_irq(data->irq);
0024 }
0025 
0026 /*
0027  * NOP functions
0028  */
0029 static void noop(struct irq_data *data) { }
0030 
0031 static unsigned int noop_ret(struct irq_data *data)
0032 {
0033     return 0;
0034 }
0035 
0036 /*
0037  * Generic no controller implementation
0038  */
0039 struct irq_chip no_irq_chip = {
0040     .name       = "none",
0041     .irq_startup    = noop_ret,
0042     .irq_shutdown   = noop,
0043     .irq_enable = noop,
0044     .irq_disable    = noop,
0045     .irq_ack    = ack_bad,
0046     .flags      = IRQCHIP_SKIP_SET_WAKE,
0047 };
0048 
0049 /*
0050  * Generic dummy implementation which can be used for
0051  * real dumb interrupt sources
0052  */
0053 struct irq_chip dummy_irq_chip = {
0054     .name       = "dummy",
0055     .irq_startup    = noop_ret,
0056     .irq_shutdown   = noop,
0057     .irq_enable = noop,
0058     .irq_disable    = noop,
0059     .irq_ack    = noop,
0060     .irq_mask   = noop,
0061     .irq_unmask = noop,
0062     .flags      = IRQCHIP_SKIP_SET_WAKE,
0063 };
0064 EXPORT_SYMBOL_GPL(dummy_irq_chip);