forked from mirrors/linux
		
	These functions have been introduced by commit 10a8c383 (irq: introduce
entry and exit functions for chained handlers) in asm/mach/irq.h. This
patch moves them to linux/irqchip/chained_irq.h so that generic irqchip
drivers do not rely on architecture specific header files.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Tested-by: Marc Zyngier <marc.zyngier@arm.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Rob Herring <rob.herring@calxeda.com>
		
	
			
		
			
				
	
	
		
			52 lines
		
	
	
	
		
			1.4 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			52 lines
		
	
	
	
		
			1.4 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
/*
 | 
						|
 * Chained IRQ handlers support.
 | 
						|
 *
 | 
						|
 * Copyright (C) 2011 ARM Ltd.
 | 
						|
 *
 | 
						|
 * This program is free software: you can redistribute it and/or modify
 | 
						|
 * it under the terms of the GNU General Public License version 2 as
 | 
						|
 * published by the Free Software Foundation.
 | 
						|
 *
 | 
						|
 * This program is distributed in the hope that it will be useful,
 | 
						|
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
						|
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
						|
 * GNU General Public License for more details.
 | 
						|
 *
 | 
						|
 * You should have received a copy of the GNU General Public License
 | 
						|
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
						|
 */
 | 
						|
#ifndef __IRQCHIP_CHAINED_IRQ_H
 | 
						|
#define __IRQCHIP_CHAINED_IRQ_H
 | 
						|
 | 
						|
#include <linux/irq.h>
 | 
						|
 | 
						|
/*
 | 
						|
 * Entry/exit functions for chained handlers where the primary IRQ chip
 | 
						|
 * may implement either fasteoi or level-trigger flow control.
 | 
						|
 */
 | 
						|
static inline void chained_irq_enter(struct irq_chip *chip,
 | 
						|
				     struct irq_desc *desc)
 | 
						|
{
 | 
						|
	/* FastEOI controllers require no action on entry. */
 | 
						|
	if (chip->irq_eoi)
 | 
						|
		return;
 | 
						|
 | 
						|
	if (chip->irq_mask_ack) {
 | 
						|
		chip->irq_mask_ack(&desc->irq_data);
 | 
						|
	} else {
 | 
						|
		chip->irq_mask(&desc->irq_data);
 | 
						|
		if (chip->irq_ack)
 | 
						|
			chip->irq_ack(&desc->irq_data);
 | 
						|
	}
 | 
						|
}
 | 
						|
 | 
						|
static inline void chained_irq_exit(struct irq_chip *chip,
 | 
						|
				    struct irq_desc *desc)
 | 
						|
{
 | 
						|
	if (chip->irq_eoi)
 | 
						|
		chip->irq_eoi(&desc->irq_data);
 | 
						|
	else
 | 
						|
		chip->irq_unmask(&desc->irq_data);
 | 
						|
}
 | 
						|
 | 
						|
#endif /* __IRQCHIP_CHAINED_IRQ_H */
 |