1998-09-05 08:05:31 +04:00
|
|
|
/* $NetBSD: iomd_irq.S,v 1.19 1998/09/05 04:05:31 mark Exp $ */
|
1996-02-01 02:14:53 +03:00
|
|
|
|
|
|
|
/*
|
1998-09-05 08:05:31 +04:00
|
|
|
* Copyright (c) 1994-1998 Mark Brinicombe.
|
1996-02-01 02:14:53 +03:00
|
|
|
* Copyright (c) 1994 Brini.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This code is derived from software written for Brini by Mark Brinicombe
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
1998-09-05 08:05:31 +04:00
|
|
|
* This product includes software developed by Mark Brinicombe
|
|
|
|
* for the NetBSD Project.
|
1996-02-01 02:14:53 +03:00
|
|
|
* 4. The name of the company nor the name of the author may be used to
|
|
|
|
* endorse or promote products derived from this software without specific
|
|
|
|
* prior written permission.
|
|
|
|
*
|
1998-09-05 08:05:31 +04:00
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
1996-02-01 02:14:53 +03:00
|
|
|
*
|
|
|
|
* Low level irq and fiq handlers
|
|
|
|
*
|
|
|
|
* Created : 27/09/94
|
|
|
|
*/
|
|
|
|
|
1998-07-07 07:05:15 +04:00
|
|
|
#include "opt_cputypes.h"
|
1998-07-06 04:53:07 +04:00
|
|
|
#include "opt_irqstats.h"
|
1998-07-07 07:05:15 +04:00
|
|
|
#include "opt_uvm.h"
|
1998-07-06 04:53:07 +04:00
|
|
|
|
1996-02-02 05:34:09 +03:00
|
|
|
#include "assym.h"
|
1998-04-02 03:09:06 +04:00
|
|
|
#include <machine/asm.h>
|
1996-02-01 02:14:53 +03:00
|
|
|
#include <machine/cpu.h>
|
1997-02-10 06:50:53 +03:00
|
|
|
#include <machine/frame.h>
|
1997-10-14 15:05:58 +04:00
|
|
|
#include <arm32/iomd/iomdreg.h>
|
1996-02-01 02:14:53 +03:00
|
|
|
|
1996-10-16 03:20:40 +04:00
|
|
|
.text
|
1998-04-02 03:09:06 +04:00
|
|
|
.align 0
|
1996-02-01 02:14:53 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
*
|
|
|
|
* irq_entry
|
|
|
|
*
|
|
|
|
* Main entry point for the IRQ vector
|
|
|
|
*
|
|
|
|
* This function reads the irq request bits in the IOMD registers
|
|
|
|
* IRQRQA, IRQRQB and DMARQ
|
|
|
|
* It then calls an installed handler for each bit that is set.
|
|
|
|
* The function stray_irqhandler is called if a handler is not defined
|
|
|
|
* for a particular interrupt.
|
|
|
|
* If a interrupt handler is found then it is called with r0 containing
|
|
|
|
* the argument defined in the handler structure. If the field ih_arg
|
|
|
|
* is zero then a pointer to the IRQ frame on the stack is passed instead.
|
|
|
|
*/
|
|
|
|
|
|
|
|
Ldisabled_mask:
|
|
|
|
.word _disabled_mask
|
|
|
|
|
1996-03-27 23:42:53 +03:00
|
|
|
Lcurrent_spl_level:
|
|
|
|
.word _current_spl_level
|
1996-02-01 02:14:53 +03:00
|
|
|
|
1996-10-16 03:20:40 +04:00
|
|
|
Lcurrent_intr_depth:
|
|
|
|
.word _current_intr_depth
|
|
|
|
|
1998-09-05 08:05:31 +04:00
|
|
|
Lspl_masks:
|
|
|
|
.word _spl_masks
|
1996-02-01 02:14:53 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Regsister usage
|
|
|
|
*
|
|
|
|
* r6 - Address of current handler
|
|
|
|
* r7 - Pointer to handler pointer list
|
|
|
|
* r8 - Current IRQ requests.
|
|
|
|
* r9 - Used to count through possible IRQ bits.
|
|
|
|
* r10 - Base address of IOMD
|
|
|
|
*/
|
|
|
|
|
1998-04-02 03:09:06 +04:00
|
|
|
ASENTRY_NP(irq_entry)
|
1996-02-01 02:14:53 +03:00
|
|
|
sub lr, lr, #0x00000004 /* Adjust the lr */
|
|
|
|
|
1996-10-16 03:20:40 +04:00
|
|
|
PUSHFRAMEINSVC /* Push an interrupt frame */
|
1996-02-01 02:14:53 +03:00
|
|
|
|
1996-10-16 03:20:40 +04:00
|
|
|
/* Load r8 with the IOMD interrupt requests */
|
1996-03-27 23:42:53 +03:00
|
|
|
|
1996-02-01 02:14:53 +03:00
|
|
|
mov r10, #(IOMD_BASE) /* Point to the IOMD */
|
1997-10-14 15:05:58 +04:00
|
|
|
ldrb r8, [r10, #(IOMD_IRQRQA << 2)] /* Get IRQ request A */
|
|
|
|
ldrb r9, [r10, #(IOMD_IRQRQB << 2)] /* Get IRQ request B */
|
1996-02-01 02:14:53 +03:00
|
|
|
orr r8, r8, r9, lsl #8
|
1996-10-16 03:20:40 +04:00
|
|
|
#ifdef CPU_ARM7500
|
1997-10-14 15:05:58 +04:00
|
|
|
ldrb r9, [r10, #(IOMD_IRQRQC << 2)] /* Get IRQ request C */
|
1996-06-13 00:19:35 +04:00
|
|
|
orr r8, r8, r9, lsl #16
|
1997-10-14 15:05:58 +04:00
|
|
|
ldrb r9, [r10, #(IOMD_IRQRQD << 2)] /* Get IRQ request D */
|
1996-06-13 00:19:35 +04:00
|
|
|
orr r8, r8, r9, lsl #24
|
1997-10-14 15:05:58 +04:00
|
|
|
ldrb r9, [r10, #(IOMD_DMARQ << 2)] /* Get DMA Request */
|
1996-06-13 00:19:35 +04:00
|
|
|
tst r9, #0x10
|
|
|
|
orrne r8, r8, r9, lsl #27
|
|
|
|
#else
|
1997-10-14 15:05:58 +04:00
|
|
|
ldrb r9, [r10, #(IOMD_DMARQ << 2)] /* Get DMA Request */
|
1996-02-01 02:14:53 +03:00
|
|
|
orr r8, r8, r9, lsl #16
|
1996-10-16 03:20:40 +04:00
|
|
|
#endif /* CPU_ARM7500 */
|
1996-02-01 02:14:53 +03:00
|
|
|
|
1996-10-16 03:20:40 +04:00
|
|
|
and r0, r8, #0x7d /* Clear IOMD IRQA bits */
|
1997-10-14 15:05:58 +04:00
|
|
|
strb r0, [r10, #(IOMD_IRQRQA << 2)]
|
1996-02-01 02:14:53 +03:00
|
|
|
|
1996-10-16 03:20:40 +04:00
|
|
|
/*
|
|
|
|
* Note that we have entered the IRQ handler.
|
|
|
|
* We are in SVC mode so we cannot use the processor mode
|
|
|
|
* to determine if we are in an IRQ. Instead we will count the
|
|
|
|
* each time the interrupt handler is nested.
|
|
|
|
*/
|
|
|
|
|
|
|
|
ldr r0, Lcurrent_intr_depth
|
|
|
|
ldr r1, [r0]
|
|
|
|
add r1, r1, #1
|
|
|
|
str r1, [r0]
|
|
|
|
|
|
|
|
/* Block the current requested interrupts */
|
|
|
|
ldr r1, Ldisabled_mask
|
1996-02-01 02:14:53 +03:00
|
|
|
ldr r0, [r1]
|
1996-10-16 03:20:40 +04:00
|
|
|
stmfd sp!, {r0}
|
1996-02-01 02:14:53 +03:00
|
|
|
orr r0, r0, r8
|
|
|
|
|
1997-01-06 05:35:46 +03:00
|
|
|
/*
|
|
|
|
* Need to block all interrupts at the IPL or lower for
|
|
|
|
* all asserted interrupts.
|
|
|
|
* This basically emulates hardware interrupt priority levels.
|
|
|
|
* Means we need to go through the interrupt mask and for
|
|
|
|
* every asserted interrupt we need to mask out all other
|
|
|
|
* interrupts at the same or lower IPL.
|
|
|
|
* If only we could wait until the main loop but we need to sort
|
|
|
|
* this out first so interrupts can be re-enabled.
|
|
|
|
*
|
|
|
|
* This would benefit from a special ffs type routine
|
|
|
|
*/
|
|
|
|
|
1998-09-05 08:05:31 +04:00
|
|
|
mov r9, #(_SPL_LEVELS - 1)
|
|
|
|
ldr r7, Lspl_masks
|
1997-01-06 05:35:46 +03:00
|
|
|
|
1998-09-05 08:05:31 +04:00
|
|
|
Lfind_highest_ipl:
|
|
|
|
ldr r2, [r7, r9, lsl #2]
|
|
|
|
tst r8, r2
|
|
|
|
subeq r9, r9, #1
|
|
|
|
beq Lfind_highest_ipl
|
1997-01-06 05:35:46 +03:00
|
|
|
|
1998-09-05 08:05:31 +04:00
|
|
|
/* r9 = SPL level of highest priority interrupt */
|
|
|
|
add r9, r9, #1
|
|
|
|
ldr r2, [r7, r9, lsl #2]
|
|
|
|
mvn r2, r2
|
|
|
|
orr r0, r0, r2
|
1997-01-06 05:35:46 +03:00
|
|
|
|
|
|
|
str r0, [r1]
|
|
|
|
|
1998-09-05 08:05:31 +04:00
|
|
|
ldr r0, Lcurrent_spl_level
|
|
|
|
ldr r1, [r0]
|
|
|
|
str r9, [r0]
|
|
|
|
stmfd sp!, {r1}
|
1996-10-16 03:20:40 +04:00
|
|
|
|
1998-09-05 08:05:31 +04:00
|
|
|
/* Update the IOMD irq masks */
|
1996-10-16 03:20:40 +04:00
|
|
|
bl _irq_setmasks
|
1996-02-01 02:14:53 +03:00
|
|
|
|
|
|
|
mrs r0, cpsr_all /* Enable IRQ's */
|
|
|
|
bic r0, r0, #I32_bit
|
|
|
|
msr cpsr_all, r0
|
|
|
|
|
1998-09-05 08:05:31 +04:00
|
|
|
ldr r7, [pc, #Lirqhandlers - . - 8]
|
1996-02-01 02:14:53 +03:00
|
|
|
mov r9, #0x00000001
|
|
|
|
|
|
|
|
irqloop:
|
1997-01-06 05:35:46 +03:00
|
|
|
/* This would benefit from a special ffs type routine */
|
1996-02-01 02:14:53 +03:00
|
|
|
tst r8, r9 /* Is a bit set ? */
|
|
|
|
beq nextirq /* No ? try next bit */
|
|
|
|
|
|
|
|
ldr r6, [r7] /* Get address of first handler structure */
|
|
|
|
|
|
|
|
teq r6, #0x00000000 /* Do we have a handler */
|
|
|
|
moveq r0, r8 /* IRQ requests as arg 0 */
|
|
|
|
beq _stray_irqhandler /* call special handler */
|
|
|
|
|
1998-09-05 08:05:31 +04:00
|
|
|
ldr r0, Lcnt /* Stat info */
|
1996-02-01 02:14:53 +03:00
|
|
|
ldr r1, [r0, #(V_INTR)]
|
|
|
|
add r1, r1, #0x00000001
|
|
|
|
str r1, [r0, #(V_INTR)]
|
|
|
|
|
1998-09-05 08:05:31 +04:00
|
|
|
/*
|
|
|
|
* XXX: Should stats be accumlated for every interrupt routine
|
|
|
|
* called or for every physical interrupt that is serviced.
|
|
|
|
*/
|
1996-06-13 00:19:35 +04:00
|
|
|
|
1996-02-01 02:14:53 +03:00
|
|
|
#ifdef IRQSTATS
|
1998-06-03 00:41:46 +04:00
|
|
|
ldr r0, Lintrcnt
|
1996-02-01 02:14:53 +03:00
|
|
|
ldr r1, [r6, #(IH_NUM)]
|
|
|
|
|
|
|
|
add r0, r0, r1, lsl #2
|
|
|
|
ldr r1, [r0]
|
|
|
|
add r1, r1, #0x00000001
|
|
|
|
str r1, [r0]
|
1996-10-16 03:20:40 +04:00
|
|
|
#endif /* IRQSTATS */
|
1996-02-01 02:14:53 +03:00
|
|
|
|
1998-09-05 08:05:31 +04:00
|
|
|
irqchainloop:
|
|
|
|
add lr, pc, #nextinchain - . - 8 /* return address */
|
1996-02-01 02:14:53 +03:00
|
|
|
ldr r0, [r6, #(IH_ARG)] /* Get argument pointer */
|
|
|
|
teq r0, #0x00000000 /* If arg is zero pass stack frame */
|
1998-09-05 08:05:31 +04:00
|
|
|
addeq r0, sp, #8 /* ... stack frame [XXX needs care] */
|
1996-02-01 02:14:53 +03:00
|
|
|
ldr pc, [r6, #(IH_FUNC)] /* Call handler */
|
|
|
|
|
|
|
|
nextinchain:
|
|
|
|
teq r0, #0x00000001 /* Was the irq serviced ? */
|
1996-10-16 03:20:40 +04:00
|
|
|
beq irqdone
|
1996-02-01 02:14:53 +03:00
|
|
|
|
|
|
|
ldr r6, [r6, #(IH_NEXT)]
|
|
|
|
teq r6, #0x00000000
|
1996-06-13 00:19:35 +04:00
|
|
|
bne irqchainloop
|
1996-02-01 02:14:53 +03:00
|
|
|
|
1996-10-16 03:20:40 +04:00
|
|
|
irqdone:
|
1996-02-01 02:14:53 +03:00
|
|
|
nextirq:
|
|
|
|
add r7, r7, #0x00000004 /* update pointer to handlers */
|
|
|
|
mov r9, r9, lsl #1 /* move on to next bit */
|
1996-10-16 03:20:40 +04:00
|
|
|
#ifdef CPU_ARM7500
|
1996-06-13 00:19:35 +04:00
|
|
|
teq r9, #0 /* done the last bit ? */
|
|
|
|
#else
|
1996-02-01 02:14:53 +03:00
|
|
|
teq r9, #(1 << 24) /* done the last bit ? */
|
1996-10-16 03:20:40 +04:00
|
|
|
#endif /* CPU_ARM7500 */
|
1996-02-01 02:14:53 +03:00
|
|
|
bne irqloop /* no - loop back. */
|
|
|
|
|
1998-09-05 08:05:31 +04:00
|
|
|
ldmfd sp!, {r2}
|
|
|
|
ldr r1, Lcurrent_spl_level
|
|
|
|
str r2, [r1]
|
1996-02-01 02:14:53 +03:00
|
|
|
|
1996-10-16 03:20:40 +04:00
|
|
|
/* Restore previous disabled mask */
|
|
|
|
ldmfd sp!, {r2}
|
|
|
|
ldr r1, Ldisabled_mask
|
|
|
|
str r2, [r1]
|
|
|
|
bl _irq_setmasks
|
1996-02-01 02:14:53 +03:00
|
|
|
|
|
|
|
bl _dosoftints /* Handle the soft interrupts */
|
|
|
|
|
1996-10-16 03:20:40 +04:00
|
|
|
/* Manage AST's. Maybe this should be done as a soft interrupt ? */
|
|
|
|
ldr r0, [sp] /* Get the SPSR from stack */
|
1996-02-01 02:14:53 +03:00
|
|
|
|
1996-10-16 03:20:40 +04:00
|
|
|
and r0, r0, #(PSR_MODE) /* Test for USR32 mode before the IRQ */
|
|
|
|
teq r0, #(PSR_USR32_MODE)
|
|
|
|
ldreq r0, Lastpending /* Do we have an AST pending ? */
|
|
|
|
ldreq r1, [r0]
|
|
|
|
teqeq r1, #0x00000001
|
1996-02-01 02:14:53 +03:00
|
|
|
|
1996-10-16 03:20:40 +04:00
|
|
|
beq irqast /* call the AST handler */
|
1997-01-06 05:35:46 +03:00
|
|
|
|
1996-10-16 03:20:40 +04:00
|
|
|
/* Kill IRQ's in preparation for exit */
|
|
|
|
mrs r0, cpsr_all
|
|
|
|
orr r0, r0, #(I32_bit)
|
|
|
|
msr cpsr_all, r0
|
1996-02-01 02:14:53 +03:00
|
|
|
|
1996-10-16 03:20:40 +04:00
|
|
|
/* Decrement the nest count */
|
|
|
|
ldr r0, Lcurrent_intr_depth
|
|
|
|
ldr r1, [r0]
|
|
|
|
sub r1, r1, #1
|
|
|
|
str r1, [r0]
|
1996-02-01 02:14:53 +03:00
|
|
|
|
1996-10-16 03:20:40 +04:00
|
|
|
PULLFRAMEFROMSVCANDEXIT
|
1996-02-01 02:14:53 +03:00
|
|
|
|
1998-09-05 08:05:31 +04:00
|
|
|
/* NOT REACHED */
|
|
|
|
b . - 8
|
1996-02-01 02:14:53 +03:00
|
|
|
|
1996-10-16 03:20:40 +04:00
|
|
|
/*
|
|
|
|
* Ok, snag with current intr depth ...
|
|
|
|
* If ast() calls mi_sleep() the current_intr_depth will not be
|
|
|
|
* decremented until the process is woken up. This can result
|
|
|
|
* in the system believing it is still in the interrupt handler.
|
|
|
|
* If we are calling ast() then correct the current_intr_depth
|
|
|
|
* before the call.
|
|
|
|
*/
|
|
|
|
irqast:
|
|
|
|
mov r1, #0x00000000 /* Clear ast_pending */
|
|
|
|
str r1, [r0]
|
1996-02-01 02:14:53 +03:00
|
|
|
|
1996-10-16 03:20:40 +04:00
|
|
|
/* Kill IRQ's so we atomically decrement current_intr_depth */
|
|
|
|
mrs r2, cpsr_all
|
|
|
|
orr r3, r2, #(I32_bit)
|
|
|
|
msr cpsr_all, r3
|
1996-02-01 02:14:53 +03:00
|
|
|
|
1998-09-05 08:05:31 +04:00
|
|
|
/* Decrement the interrupt nesting count */
|
1996-10-16 03:20:40 +04:00
|
|
|
ldr r0, Lcurrent_intr_depth
|
|
|
|
ldr r1, [r0]
|
|
|
|
sub r1, r1, #1
|
|
|
|
str r1, [r0]
|
1996-02-01 02:14:53 +03:00
|
|
|
|
1996-10-16 03:20:40 +04:00
|
|
|
/* Restore IRQ's */
|
|
|
|
msr cpsr_all, r2
|
1996-02-01 02:14:53 +03:00
|
|
|
|
|
|
|
mov r0, sp
|
1996-10-16 03:20:40 +04:00
|
|
|
bl _ast
|
1996-02-01 02:14:53 +03:00
|
|
|
|
1998-09-05 08:05:31 +04:00
|
|
|
/* Kill IRQ's in preparation for exit */
|
1996-02-01 02:14:53 +03:00
|
|
|
mrs r0, cpsr_all
|
|
|
|
orr r0, r0, #(I32_bit)
|
|
|
|
msr cpsr_all, r0
|
|
|
|
|
1996-10-16 03:20:40 +04:00
|
|
|
PULLFRAMEFROMSVCANDEXIT
|
1996-02-01 02:14:53 +03:00
|
|
|
|
1998-09-05 08:05:31 +04:00
|
|
|
/* NOT REACHED */
|
|
|
|
b . - 8
|
1996-10-16 03:20:40 +04:00
|
|
|
|
1996-02-01 02:14:53 +03:00
|
|
|
|
|
|
|
Lspl_mask:
|
1996-10-16 03:20:40 +04:00
|
|
|
.word _spl_mask /* irq's allowed at current spl level */
|
1996-02-01 02:14:53 +03:00
|
|
|
|
|
|
|
Lcurrent_mask:
|
1996-10-16 03:20:40 +04:00
|
|
|
.word _current_mask /* irq's that are usable */
|
1996-02-01 02:14:53 +03:00
|
|
|
|
1998-04-02 03:09:06 +04:00
|
|
|
ENTRY(irq_setmasks)
|
1996-10-16 03:20:40 +04:00
|
|
|
/* Disable interrupts */
|
1996-06-13 00:19:35 +04:00
|
|
|
mrs r3, cpsr_all
|
|
|
|
orr r1, r3, #(I32_bit)
|
|
|
|
msr cpsr_all, r1
|
1996-10-16 03:20:40 +04:00
|
|
|
|
|
|
|
/* Calculate IOMD interrupt mask */
|
|
|
|
ldr r1, Lcurrent_mask /* All the enabled interrupts */
|
1996-02-01 02:14:53 +03:00
|
|
|
ldr r1, [r1]
|
1996-10-16 03:20:40 +04:00
|
|
|
ldr r2, Lspl_mask /* Block due to current spl level */
|
1996-02-01 02:14:53 +03:00
|
|
|
ldr r2, [r2]
|
|
|
|
and r1, r1, r2
|
1996-10-16 03:20:40 +04:00
|
|
|
ldr r2, Ldisabled_mask /* Block due to active interrupts */
|
1996-02-01 02:14:53 +03:00
|
|
|
ldr r2, [r2]
|
|
|
|
bic r1, r1, r2
|
|
|
|
|
|
|
|
mov r0, #(IOMD_BASE) /* Point to the IOMD */
|
1997-10-14 15:05:58 +04:00
|
|
|
strb r1, [r0, #(IOMD_IRQMSKA << 2)] /* Set IRQ mask A */
|
1996-02-01 02:14:53 +03:00
|
|
|
mov r1, r1, lsr #8
|
1997-10-14 15:05:58 +04:00
|
|
|
strb r1, [r0, #(IOMD_IRQMSKB << 2)] /* Set IRQ mask B */
|
1996-02-01 02:14:53 +03:00
|
|
|
mov r1, r1, lsr #8
|
1996-10-16 03:20:40 +04:00
|
|
|
#ifdef CPU_ARM7500
|
1997-10-14 15:05:58 +04:00
|
|
|
strb r1, [r0, #(IOMD_IRQMSKC << 2)]
|
1996-06-13 00:19:35 +04:00
|
|
|
mov r1, r1, lsr #8
|
|
|
|
and r2, r1, #0xef
|
1997-10-14 15:05:58 +04:00
|
|
|
strb r2, [r0, #(IOMD_IRQMSKD << 2)]
|
1996-06-13 00:19:35 +04:00
|
|
|
mov r1, r1, lsr #3
|
|
|
|
and r2, r1, #0x10
|
1997-10-14 15:05:58 +04:00
|
|
|
strb r2, [r0, #(IOMD_DMAMSK << 2)] /* Set DMA mask */
|
1996-06-13 00:19:35 +04:00
|
|
|
#else
|
1997-10-14 15:05:58 +04:00
|
|
|
strb r1, [r0, #(IOMD_DMAMSK << 2)] /* Set DMA mask */
|
1996-10-16 03:20:40 +04:00
|
|
|
#endif /* CPU_ARM7500 */
|
1996-06-13 00:19:35 +04:00
|
|
|
|
1996-10-16 03:20:40 +04:00
|
|
|
/* Restore old cpsr and exit */
|
1996-06-13 00:19:35 +04:00
|
|
|
msr cpsr_all, r3
|
1996-10-16 03:20:40 +04:00
|
|
|
mov pc, lr
|
1996-02-01 02:14:53 +03:00
|
|
|
|
|
|
|
Lcnt:
|
1998-06-03 00:41:46 +04:00
|
|
|
#if defined(UVM)
|
|
|
|
.word _uvmexp
|
|
|
|
#else
|
1996-02-01 02:14:53 +03:00
|
|
|
.word _cnt
|
1998-06-03 00:41:46 +04:00
|
|
|
#endif
|
1996-02-01 02:14:53 +03:00
|
|
|
|
|
|
|
Lintrcnt:
|
|
|
|
.word _intrcnt
|
|
|
|
|
|
|
|
|
1998-09-05 08:05:31 +04:00
|
|
|
Lirqhandlers:
|
1996-02-01 02:14:53 +03:00
|
|
|
.word _irqhandlers /* Pointer to array of irqhandlers */
|
|
|
|
|
|
|
|
Lastpending:
|
|
|
|
.word _astpending
|
|
|
|
|
|
|
|
#ifdef IRQSTATS
|
|
|
|
/* These symbols are used by vmstat */
|
|
|
|
|
1996-03-27 23:42:53 +03:00
|
|
|
.text
|
|
|
|
.global __intrnames
|
|
|
|
__intrnames:
|
|
|
|
.word _intrnames
|
|
|
|
|
|
|
|
.data
|
|
|
|
|
1998-09-05 08:05:31 +04:00
|
|
|
.globl _intrnames, _eintrnames, _intrcnt, _sintrcnt, _eintrcnt
|
1996-02-01 02:14:53 +03:00
|
|
|
_intrnames:
|
1996-03-27 23:42:53 +03:00
|
|
|
.asciz "interrupt 0 "
|
1998-09-05 08:05:31 +04:00
|
|
|
.asciz "interrupt 1 " /* reserved0 */
|
1996-03-27 23:42:53 +03:00
|
|
|
.asciz "interrupt 2 "
|
|
|
|
.asciz "interrupt 3 "
|
|
|
|
.asciz "interrupt 4 "
|
|
|
|
.asciz "interrupt 5 "
|
|
|
|
.asciz "interrupt 6 "
|
1998-09-05 08:05:31 +04:00
|
|
|
.asciz "interrupt 7 " /* reserved1 */
|
|
|
|
.asciz "interrupt 8 " /* reserved2 */
|
1996-03-27 23:42:53 +03:00
|
|
|
.asciz "interrupt 9 "
|
|
|
|
.asciz "interrupt 10 "
|
|
|
|
.asciz "interrupt 11 "
|
|
|
|
.asciz "interrupt 12 "
|
|
|
|
.asciz "interrupt 13 "
|
|
|
|
.asciz "interrupt 14 "
|
|
|
|
.asciz "interrupt 15 "
|
1996-02-01 02:14:53 +03:00
|
|
|
.asciz "dma channel 0"
|
|
|
|
.asciz "dma channel 1"
|
|
|
|
.asciz "dma channel 2"
|
|
|
|
.asciz "dma channel 3"
|
1996-03-27 23:42:53 +03:00
|
|
|
.asciz "interrupt 20 "
|
|
|
|
.asciz "interrupt 21 "
|
|
|
|
.asciz "reserved 3 "
|
|
|
|
.asciz "reserved 4 "
|
|
|
|
.asciz "exp card 0 "
|
|
|
|
.asciz "exp card 1 "
|
|
|
|
.asciz "exp card 2 "
|
|
|
|
.asciz "exp card 3 "
|
|
|
|
.asciz "exp card 4 "
|
|
|
|
.asciz "exp card 5 "
|
|
|
|
.asciz "exp card 6 "
|
|
|
|
.asciz "exp card 7 "
|
1998-09-05 08:05:31 +04:00
|
|
|
|
|
|
|
_sintrnames:
|
|
|
|
.asciz "softclock "
|
|
|
|
.asciz "softnet "
|
|
|
|
.asciz "softserial "
|
|
|
|
.asciz "softintr 3 "
|
|
|
|
.asciz "softintr 4 "
|
|
|
|
.asciz "softintr 5 "
|
|
|
|
.asciz "softintr 6 "
|
|
|
|
.asciz "softintr 7 "
|
|
|
|
.asciz "softintr 8 "
|
|
|
|
.asciz "softintr 9 "
|
|
|
|
.asciz "softintr 10 "
|
|
|
|
.asciz "softintr 11 "
|
|
|
|
.asciz "softintr 12 "
|
|
|
|
.asciz "softintr 13 "
|
|
|
|
.asciz "softintr 14 "
|
|
|
|
.asciz "softintr 15 "
|
|
|
|
.asciz "softintr 16 "
|
|
|
|
.asciz "softintr 17 "
|
|
|
|
.asciz "softintr 18 "
|
|
|
|
.asciz "softintr 19 "
|
|
|
|
.asciz "softintr 20 "
|
|
|
|
.asciz "softintr 21 "
|
|
|
|
.asciz "softintr 22 "
|
|
|
|
.asciz "softintr 23 "
|
|
|
|
.asciz "softintr 24 "
|
|
|
|
.asciz "softintr 25 "
|
|
|
|
.asciz "softintr 26 "
|
|
|
|
.asciz "softintr 27 "
|
|
|
|
.asciz "softintr 28 "
|
|
|
|
.asciz "softintr 29 "
|
|
|
|
.asciz "softintr 30 "
|
|
|
|
.asciz "softintr 31 "
|
1996-02-01 02:14:53 +03:00
|
|
|
_eintrnames:
|
|
|
|
|
|
|
|
.bss
|
|
|
|
.align 0
|
|
|
|
_intrcnt:
|
1996-06-13 00:19:35 +04:00
|
|
|
.space 32*4 /* XXX Should be linked to number of interrupts */
|
1998-09-05 08:05:31 +04:00
|
|
|
|
|
|
|
_sintrcnt:
|
|
|
|
.space 32*4 /* XXX Should be linked to number of interrupts */
|
1996-02-01 02:14:53 +03:00
|
|
|
_eintrcnt:
|
|
|
|
|
1996-10-16 03:20:40 +04:00
|
|
|
#else /* IRQSTATS */
|
1998-09-05 08:05:31 +04:00
|
|
|
/* Dummy entries to keep vmstat happy */
|
1996-02-01 02:14:53 +03:00
|
|
|
|
1996-03-27 23:42:53 +03:00
|
|
|
.text
|
1996-02-01 02:14:53 +03:00
|
|
|
.globl _intrnames, _eintrnames, _intrcnt, _eintrcnt
|
|
|
|
_intrnames:
|
|
|
|
.long 0
|
|
|
|
_eintrnames:
|
|
|
|
|
|
|
|
_intrcnt:
|
|
|
|
.long 0
|
|
|
|
_eintrcnt:
|
1996-10-16 03:20:40 +04:00
|
|
|
#endif /* IRQSTATS */
|
1996-02-01 02:14:53 +03:00
|
|
|
|
|
|
|
/* FIQ code */
|
|
|
|
|
1998-04-02 03:09:06 +04:00
|
|
|
ENTRY(fiq_setregs) /* Sets up the FIQ handler */
|
1996-02-01 02:14:53 +03:00
|
|
|
mrs r2, cpsr_all
|
|
|
|
mov r3, r2
|
|
|
|
bic r2, r2, #(PSR_MODE)
|
|
|
|
orr r2, r2, #(PSR_FIQ32_MODE)
|
|
|
|
msr cpsr_all, r2
|
|
|
|
|
1996-05-06 04:25:43 +04:00
|
|
|
ldr r8, [r0, #FH_R8] /* Update FIQ registers*/
|
|
|
|
ldr r9, [r0, #FH_R9]
|
|
|
|
ldr r10, [r0, #FH_R10]
|
|
|
|
ldr r11, [r0, #FH_R11]
|
|
|
|
ldr r12, [r0, #FH_R12]
|
|
|
|
ldr r13, [r0, #FH_R13]
|
|
|
|
|
|
|
|
msr cpsr_all, r3 /* Back to old mode */
|
|
|
|
|
|
|
|
mov pc, lr /* Exit */
|
|
|
|
|
1998-04-02 03:09:06 +04:00
|
|
|
ENTRY(fiq_getregs) /* Gets the FIQ registers */
|
1996-05-06 04:25:43 +04:00
|
|
|
mrs r2, cpsr_all
|
|
|
|
mov r3, r2
|
|
|
|
bic r2, r2, #(PSR_MODE)
|
|
|
|
orr r2, r2, #(PSR_FIQ32_MODE)
|
|
|
|
msr cpsr_all, r2
|
|
|
|
|
|
|
|
str r8, [r0, #FH_R8] /* Update FIQ registers*/
|
|
|
|
str r9, [r0, #FH_R9]
|
|
|
|
str r10, [r0, #FH_R10]
|
|
|
|
str r11, [r0, #FH_R11]
|
|
|
|
str r12, [r0, #FH_R12]
|
|
|
|
str r13, [r0, #FH_R13]
|
1996-02-01 02:14:53 +03:00
|
|
|
|
|
|
|
msr cpsr_all, r3 /* Back to old mode */
|
|
|
|
|
|
|
|
mov pc, lr /* Exit */
|
|
|
|
|
|
|
|
/* End of irq.S */
|