Commit 29c2f335 authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Fix bug in HAL_IRQDisable/HAL_FIQDisable in OMAP3 HAL

Detail:
  The code which checks if you've just disabled the active interrupt was broken and was dereferencing a bad pointer, causing (a) bad things, and (b) failure when alignment exceptions are turned on. This change fixes that, so the change I checked in a couple of hours ago won't cause the OS to crash anymore!
Admin:
  Tested on rev C2 beagleboard.


Version 0.15. Tagged as 'OMAP3-0_15'
parent dd2214f6
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "0.14"
Module_Version SETA 14
Module_MajorVersion SETS "0.15"
Module_Version SETA 15
Module_MinorVersion SETS ""
Module_Date SETS "27 Oct 2009"
Module_ApplicationDate SETS "27-Oct-09"
Module_Date SETS "07 Nov 2009"
Module_ApplicationDate SETS "07-Nov-09"
Module_ComponentName SETS "OMAP3"
Module_ComponentPath SETS "castle/RiscOS/Sources/HAL/OMAP3"
Module_FullVersion SETS "0.14"
Module_HelpVersion SETS "0.14 (27 Oct 2009)"
Module_FullVersion SETS "0.15"
Module_HelpVersion SETS "0.15 (07 Nov 2009)"
END
/* (0.14)
/* (0.15)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.14
#define Module_MajorVersion_CMHG 0.15
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 27 Oct 2009
#define Module_Date_CMHG 07 Nov 2009
#define Module_MajorVersion "0.14"
#define Module_Version 14
#define Module_MajorVersion "0.15"
#define Module_Version 15
#define Module_MinorVersion ""
#define Module_Date "27 Oct 2009"
#define Module_Date "07 Nov 2009"
#define Module_ApplicationDate "27-Oct-09"
#define Module_ApplicationDate "07-Nov-09"
#define Module_ComponentName "OMAP3"
#define Module_ComponentPath "castle/RiscOS/Sources/HAL/OMAP3"
#define Module_FullVersion "0.14"
#define Module_HelpVersion "0.14 (27 Oct 2009)"
#define Module_LibraryVersionInfo "0:14"
#define Module_FullVersion "0.15"
#define Module_HelpVersion "0.15 (07 Nov 2009)"
#define Module_LibraryVersionInfo "0:15"
......@@ -115,19 +115,19 @@ HAL_IRQDisable
ADD ip, a3, lr, LSL #5
MOV lr, #1
MOV a2, lr, LSL a2
LDR a3, [ip, #INTCPS_BITS+INTCPS_BITS_MIR] ; Get old state
LDR lr, [ip, #INTCPS_BITS+INTCPS_BITS_MIR] ; Get old state
STR a2, [ip, #INTCPS_BITS+INTCPS_BITS_MIR_SET] ; Mask the interrupt
; Check if we just disabled the active interrupt
LDR ip, [lr, #INTCPS_SIR_IRQ]
LDR ip, [a3, #INTCPS_SIR_IRQ]
CMP ip, a1
MOVEQ ip, #1
STREQ ip, [lr, #INTCPS_CONTROL]
STREQ ip, [a3, #INTCPS_CONTROL]
[ DebugInterrupts
MOVEQ ip, #-1
STREQ ip, LastInterrupt_IRQ
]
MSR CPSR_c, a4 ; Re-enable interrupts
BIC a1, a2, a3 ; Clear the masked interrupts from a2 to get nonzero result if it was enabled
BIC a1, a2, lr ; Clear the masked interrupts from a2 to get nonzero result if it was enabled
Pull "pc"
HAL_IRQClear
......@@ -278,19 +278,19 @@ HAL_FIQDisable
ADD ip, a3, lr, LSL #5
MOV lr, #1
MOV a2, lr, LSL a2
LDR a3, [ip, #INTCPS_BITS+INTCPS_BITS_MIR] ; Get old state
LDR lr, [ip, #INTCPS_BITS+INTCPS_BITS_MIR] ; Get old state
STR a2, [ip, #INTCPS_BITS+INTCPS_BITS_MIR_SET] ; Mask the interrupt
; Check if we just disabled the active interrupt
LDR ip, [lr, #INTCPS_SIR_FIQ]
LDR ip, [a3, #INTCPS_SIR_FIQ]
CMP ip, a1
MOVEQ ip, #2
STREQ ip, [lr, #INTCPS_CONTROL]
STREQ ip, [a3, #INTCPS_CONTROL]
[ DebugInterrupts
MOVEQ ip, #-1
STREQ ip, LastInterrupt_FIQ
]
MSR CPSR_c, a4 ; Re-enable interrupts
BIC a1, a2, a3 ; Clear the masked interrupts from a2 to get nonzero result if it was enabled
BIC a1, a2, lr ; Clear the masked interrupts from a2 to get nonzero result if it was enabled
Pull "pc"
HAL_FIQDisableAll
......
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