Path: blob/master/arch/arm/include/asm/entry-macro-vic2.S
17370 views
/* arch/arm/include/asm/entry-macro-vic2.S1*2* Originally arch/arm/mach-s3c6400/include/mach/entry-macro.S3*4* Copyright 2008 Openmoko, Inc.5* Copyright 2008 Simtec Electronics6* http://armlinux.simtec.co.uk/7* Ben Dooks <[email protected]>8*9* Low-level IRQ helper macros for a device with two VICs10*11* This file is licensed under the terms of the GNU General Public12* License version 2. This program is licensed "as is" without any13* warranty of any kind, whether express or implied.14*/1516/* This should be included from <mach/entry-macro.S> with the necessary17* defines for virtual addresses and IRQ bases for the two vics.18*19* The code needs the following defined:20* IRQ_VIC0_BASE IRQ number of VIC0's first IRQ21* IRQ_VIC1_BASE IRQ number of VIC1's first IRQ22* VA_VIC0 Virtual address of VIC023* VA_VIC1 Virtual address of VIC124*25* Note, code assumes VIC0's virtual address is an ARM immediate constant26* away from VIC1.27*/2829#include <asm/hardware/vic.h>3031.macro disable_fiq32.endm3334.macro get_irqnr_preamble, base, tmp35ldr \base, =VA_VIC036.endm3738.macro arch_ret_to_user, tmp1, tmp239.endm4041.macro get_irqnr_and_base, irqnr, irqstat, base, tmp4243@ check the vic044mov \irqnr, #IRQ_VIC0_BASE + 3145ldr \irqstat, [ \base, # VIC_IRQ_STATUS ]46teq \irqstat, #04748@ otherwise try vic149addeq \tmp, \base, #(VA_VIC1 - VA_VIC0)50addeq \irqnr, \irqnr, #(IRQ_VIC1_BASE - IRQ_VIC0_BASE)51ldreq \irqstat, [ \tmp, # VIC_IRQ_STATUS ]52teqeq \irqstat, #05354clzne \irqstat, \irqstat55subne \irqnr, \irqnr, \irqstat56.endm575859