Commit 20c93a96 authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Improve Reset_IRQ_Handler

Detail:
  s/HAL - Reset_IRQ_Handler now uses HAL_IRQSource to determine the cause of the interrupt, using that value to work out which IIC bus (if any) generated the IRQ. If it's unrecognised it passes it to HAL_KbdScanInterrupt, and if that fails to do anything it'll disable the IRQ.
  This aims to fix the spurious "No XStart!" debug spam that the OMAP IIC drivers produce when the keyboard scan is running, and to fix the potential IIC breakage that could occur by the IIC code trying to clear the non-existant interrupt.
  Note that behaviour of HAL_KbdScanInterrupt has now been changed; it now accepts the device number in a1, and is expected to return either -1 (if the interrupt was handled) or the device number given as input (if the interrupt wasn't handled, e.g. not from a device managed by the keyboard scan code).
Admin:
  Tested on rev C2 BB


Version 5.35, 4.79.2.98.2.49. Tagged as 'Kernel-5_35-4_79_2_98_2_49'
parent 2247d8e9
......@@ -13,11 +13,11 @@
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.35"
Module_Version SETA 535
Module_MinorVersion SETS "4.79.2.98.2.48"
Module_Date SETS "08 Aug 2011"
Module_ApplicationDate SETS "08-Aug-11"
Module_MinorVersion SETS "4.79.2.98.2.49"
Module_Date SETS "22 Aug 2011"
Module_ApplicationDate SETS "22-Aug-11"
Module_ComponentName SETS "Kernel"
Module_ComponentPath SETS "castle/RiscOS/Sources/Kernel"
Module_FullVersion SETS "5.35 (4.79.2.98.2.48)"
Module_HelpVersion SETS "5.35 (08 Aug 2011) 4.79.2.98.2.48"
Module_FullVersion SETS "5.35 (4.79.2.98.2.49)"
Module_HelpVersion SETS "5.35 (22 Aug 2011) 4.79.2.98.2.49"
END
......@@ -5,19 +5,19 @@
*
*/
#define Module_MajorVersion_CMHG 5.35
#define Module_MinorVersion_CMHG 4.79.2.98.2.48
#define Module_Date_CMHG 08 Aug 2011
#define Module_MinorVersion_CMHG 4.79.2.98.2.49
#define Module_Date_CMHG 22 Aug 2011
#define Module_MajorVersion "5.35"
#define Module_Version 535
#define Module_MinorVersion "4.79.2.98.2.48"
#define Module_Date "08 Aug 2011"
#define Module_MinorVersion "4.79.2.98.2.49"
#define Module_Date "22 Aug 2011"
#define Module_ApplicationDate "08-Aug-11"
#define Module_ApplicationDate "22-Aug-11"
#define Module_ComponentName "Kernel"
#define Module_ComponentPath "castle/RiscOS/Sources/Kernel"
#define Module_FullVersion "5.35 (4.79.2.98.2.48)"
#define Module_HelpVersion "5.35 (08 Aug 2011) 4.79.2.98.2.48"
#define Module_FullVersion "5.35 (4.79.2.98.2.49)"
#define Module_HelpVersion "5.35 (22 Aug 2011) 4.79.2.98.2.49"
#define Module_LibraryVersionInfo "5:35"
......@@ -2416,25 +2416,34 @@ Reset_IRQ_Handler
ORR a3, a2, #SVC32_mode
MSR CPSR_c, a3
Push "a1-a2,lr"
; If it's not an IIC interrupt, pass it on to the keyboard scan code
LDR v2, =ZeroPage
AddressHAL v2
CallHAL HAL_IRQSource
ADD v1, v2, #IICBus_Base
[ ZeroPage <> 0
MOV v2, #0
]
MOV ip, #0
10
LDR a2, [v1, #IICBus_Type]
TST a2, #IICFlag_Background
MOVNE ip, v2
BLNE IICIRQ
ADD v2, v2, #1
BEQ %FT20
LDR a2, [v1, #IICBus_Device]
CMP a2, a1
ADREQ lr, Reset_IRQ_Exit
BEQ IICIRQ
20
ADD ip, ip, #1
ADD v1, v1, #IICBus_Size
CMP v2, #IICBus_Count
CMP ip, #IICBus_Count
BNE %BT10
LDR a1, =ZeroPage+InitIRQWs
LDRB a1, [a1, #KbdScanActive]
TEQ a1, #0
LDRB a2, [v2, #InitIRQWs+KbdScanActive]
TEQ a2, #0
CallHAL HAL_KbdScanInterrupt,NE
; Keyboard scan code will have return -1 if it handled the IRQ
; If it didn't handle it, or keyboard scanning is inactive, something
; bad has happened
CMP a1, #-1
CallHAL HAL_IRQDisable,NE ; Stop the rogue device from killing us completely
Reset_IRQ_Exit
Pull "a1-a2,lr"
MSR CPSR_c, a2
MSR SPSR_cxsf, a1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment