From 7f375f88063c102bb7f5d1b48ce1547736525f25 Mon Sep 17 00:00:00 2001
From: Jeffrey Lee <jlee@gitlab.riscosopen.org>
Date: Fri, 17 Jul 2009 00:19:57 +0000
Subject: [PATCH] Make Cortex kernel call HAL_IRQClear after servicing I2C
 interrupts

Detail:
  s/PMF/IIC - IICIRQ now calls HAL_IRQClear after HAL_IICMonitorTransfer, in order to make sure the IRQ controller is restarted.
Admin:
  Tested on rev C2 beagleboard


Version 5.35, 4.79.2.98.2.10. Tagged as 'Kernel-5_35-4_79_2_98_2_10'
---
 VersionASM | 10 +++++-----
 VersionNum | 14 +++++++-------
 s/PMF/IIC  |  8 ++++++++
 3 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/VersionASM b/VersionASM
index 6fc1e91..7bb63ac 100644
--- a/VersionASM
+++ b/VersionASM
@@ -13,11 +13,11 @@
                         GBLS    Module_ComponentPath
 Module_MajorVersion     SETS    "5.35"
 Module_Version          SETA    535
-Module_MinorVersion     SETS    "4.79.2.98.2.9"
-Module_Date             SETS    "16 Jun 2009"
-Module_ApplicationDate  SETS    "16-Jun-09"
+Module_MinorVersion     SETS    "4.79.2.98.2.10"
+Module_Date             SETS    "17 Jul 2009"
+Module_ApplicationDate  SETS    "17-Jul-09"
 Module_ComponentName    SETS    "Kernel"
 Module_ComponentPath    SETS    "castle/RiscOS/Sources/Kernel"
-Module_FullVersion      SETS    "5.35 (4.79.2.98.2.9)"
-Module_HelpVersion      SETS    "5.35 (16 Jun 2009) 4.79.2.98.2.9"
+Module_FullVersion      SETS    "5.35 (4.79.2.98.2.10)"
+Module_HelpVersion      SETS    "5.35 (17 Jul 2009) 4.79.2.98.2.10"
                         END
diff --git a/VersionNum b/VersionNum
index 124ab10..47da89a 100644
--- a/VersionNum
+++ b/VersionNum
@@ -5,19 +5,19 @@
  *
  */
 #define Module_MajorVersion_CMHG        5.35
-#define Module_MinorVersion_CMHG        4.79.2.98.2.9
-#define Module_Date_CMHG                16 Jun 2009
+#define Module_MinorVersion_CMHG        4.79.2.98.2.10
+#define Module_Date_CMHG                17 Jul 2009
 
 #define Module_MajorVersion             "5.35"
 #define Module_Version                  535
-#define Module_MinorVersion             "4.79.2.98.2.9"
-#define Module_Date                     "16 Jun 2009"
+#define Module_MinorVersion             "4.79.2.98.2.10"
+#define Module_Date                     "17 Jul 2009"
 
-#define Module_ApplicationDate          "16-Jun-09"
+#define Module_ApplicationDate          "17-Jul-09"
 
 #define Module_ComponentName            "Kernel"
 #define Module_ComponentPath            "castle/RiscOS/Sources/Kernel"
 
-#define Module_FullVersion              "5.35 (4.79.2.98.2.9)"
-#define Module_HelpVersion              "5.35 (16 Jun 2009) 4.79.2.98.2.9"
+#define Module_FullVersion              "5.35 (4.79.2.98.2.10)"
+#define Module_HelpVersion              "5.35 (17 Jul 2009) 4.79.2.98.2.10"
 #define Module_LibraryVersionInfo       "5:35"
diff --git a/s/PMF/IIC b/s/PMF/IIC
index e6ecb9f..c279294 100644
--- a/s/PMF/IIC
+++ b/s/PMF/IIC
@@ -858,6 +858,14 @@ IICIRQ
         CallHAL HAL_IICMonitorTransfer
         MOV     R12, #0
         STR     R0, [R12, #IICStatus]
+        ; this is a bit ugly - we really need a way to pass the device number to IRQ handlers
+        SUB     sp, sp, #12
+        MOV     a1, sp
+        MOV     a2, #0
+        CallHAL HAL_IICDevice
+        LDR     a1, [sp]
+        CallHAL HAL_IRQClear
+        ADD     sp, sp, #12
         Pull    "R9,PC"
 
 IICAbort
-- 
GitLab