11#include "accore_internal.h"
13static acUint8 masks_8[3] = {128u, 2u, 64u};
16static int intr_intr(
void *arg)
28 v2 = &argt->handlers[1];
29 sr = (*((
volatile acUint16 *)0xB241C000) & 0xFF00) >> 8;
32 if ( masks_8[index] && masks_8[index] == ((sr & masks_8[index]) & 0xFF) && v2->func )
41int acIntrClear(acIntrNum inum)
45 if ( inum == AC_INTR_NUM_ATA )
47 v2 = (acUint16 *)0xB3000000;
50 if ( inum == AC_INTR_NUM_UART )
52 v2 = (acUint16 *)0xB3100000;
58int acIntrEnable(acIntrNum inum)
62 if ( (
unsigned int)inum >= (AC_INTR_NUM_LAST | AC_INTR_NUM_JV) )
64 enable = Intrc.enable;
65 Intrc.enable |= 1 << inum;
68 if ( inum == AC_INTR_NUM_UART )
69 *((
volatile acUint16 *)0xB241511E) = 0;
73 *((
volatile acUint16 *)0xB241510C) = 0;
74 *((
volatile acUint16 *)0xB3000000) = 0;
89int acIntrDisable(acIntrNum inum)
95 if ( (
unsigned int)inum >= (AC_INTR_NUM_LAST | AC_INTR_NUM_JV) )
97 if ( inum == AC_INTR_NUM_ATA )
99 *((
volatile acUint16 *)0xB241510C) = 0;
101 if ( inum == AC_INTR_NUM_UART )
103 *((
volatile acUint16 *)0xB241511C) = 0;
110 if ( enable != (acUint32)-103 )
119int acIntrRegister(acIntrNum inum, acIntrHandler func,
void *arg)
127 handler = &Intrc.handlers[inum];
128 if ( (
unsigned int)inum >= (AC_INTR_NUM_LAST | AC_INTR_NUM_JV) )
133 active = Intrc.active;
134 handler->func = func;
136 Intrc.active = active | (1 << v3);
155int acIntrRelease(acIntrNum inum)
164 handler = &Intrc.handlers[inum];
165 if ( (
unsigned int)inum >= (AC_INTR_NUM_LAST | AC_INTR_NUM_JV) )
167 if ( !handler->func )
172 active = Intrc.active;
175 active_v5 = active & ~(1 << v1);
176 Intrc.active = active_v5;
195int acIntrModuleStart(
int argc,
char **argv)
203 if ( Intrc.active != 0 || !Intrc.enable )
214 v5 = (acUint32 *)((
char *)&Intrc.active + v4);
226int acIntrModuleStop()
237int acIntrModuleRestart(
int argc,
char **argv)
245int acIntrModuleStatus()
254 ret = Intrc.active != 0;
int CpuResumeIntr(int state)
int RegisterIntrHandler(int irq, int mode, int(*handler)(void *), void *arg)
int ReleaseIntrHandler(int irq)
int DisableIntr(int irq, int *res)
int CpuSuspendIntr(int *state)