From 070ae73db22668df8d7efaf614dcc421d60d0ffe Mon Sep 17 00:00:00 2001
From: John Ballance <jballance@gitlab.riscosopen.org>
Date: Wed, 28 Oct 2020 13:58:30 +0000
Subject: [PATCH] Build fix to DebugTerminal

Changes in Kernel-6_44 left an undefined symbol in s.HAL in DebugTerminal_Rdch. These mods resolve that, and also add a note in s.Kernel to reflect this usage.

Version 6.45. Tagged as 'Kernel-6_45'
---
 VersionASM | 12 ++++++------
 VersionNum | 20 ++++++++++----------
 s/HAL      |  4 ++--
 s/Kernel   |  2 +-
 4 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/VersionASM b/VersionASM
index 6621731..c568b36 100644
--- a/VersionASM
+++ b/VersionASM
@@ -9,12 +9,12 @@
                         GBLS    Module_ApplicationDate
                         GBLS    Module_HelpVersion
                         GBLS    Module_ComponentName
-Module_MajorVersion     SETS    "6.44"
-Module_Version          SETA    644
+Module_MajorVersion     SETS    "6.45"
+Module_Version          SETA    645
 Module_MinorVersion     SETS    ""
-Module_Date             SETS    "24 Oct 2020"
-Module_ApplicationDate  SETS    "24-Oct-20"
+Module_Date             SETS    "28 Oct 2020"
+Module_ApplicationDate  SETS    "28-Oct-20"
 Module_ComponentName    SETS    "Kernel"
-Module_FullVersion      SETS    "6.44"
-Module_HelpVersion      SETS    "6.44 (24 Oct 2020)"
+Module_FullVersion      SETS    "6.45"
+Module_HelpVersion      SETS    "6.45 (28 Oct 2020)"
                         END
diff --git a/VersionNum b/VersionNum
index 4a4c8fe..48a0036 100644
--- a/VersionNum
+++ b/VersionNum
@@ -1,21 +1,21 @@
-/* (6.44)
+/* (6.45)
  *
  * This file is automatically maintained by srccommit, do not edit manually.
  *
  */
-#define Module_MajorVersion_CMHG        6.44
+#define Module_MajorVersion_CMHG        6.45
 #define Module_MinorVersion_CMHG
-#define Module_Date_CMHG                24 Oct 2020
+#define Module_Date_CMHG                28 Oct 2020
 
-#define Module_MajorVersion             "6.44"
-#define Module_Version                  644
+#define Module_MajorVersion             "6.45"
+#define Module_Version                  645
 #define Module_MinorVersion             ""
-#define Module_Date                     "24 Oct 2020"
+#define Module_Date                     "28 Oct 2020"
 
-#define Module_ApplicationDate          "24-Oct-20"
+#define Module_ApplicationDate          "28-Oct-20"
 
 #define Module_ComponentName            "Kernel"
 
-#define Module_FullVersion              "6.44"
-#define Module_HelpVersion              "6.44 (24 Oct 2020)"
-#define Module_LibraryVersionInfo       "6:44"
+#define Module_FullVersion              "6.45"
+#define Module_HelpVersion              "6.45 (28 Oct 2020)"
+#define Module_LibraryVersionInfo       "6:45"
diff --git a/s/HAL b/s/HAL
index 2be2b8a..48ca2e8 100644
--- a/s/HAL
+++ b/s/HAL
@@ -2780,9 +2780,9 @@ HardwareBadEntry
  [ DebugTerminal
 DebugTerminal_Rdch
         Push    "a2-a4,sb,ip"
-        WritePSRc SVC_mode, r1
         MOV     sb, ip
 20
+        WritePSRc SVC_mode, r1
         CallHAL HAL_DebugRX
         CMP     a1, #27
         BNE     %FT25
@@ -2803,7 +2803,7 @@ DebugTerminal_Rdch
         LDR     R0, =ZeroPage
         LDRB    R14, [R0, #CallBack_Flag]
         TST     R14, #CBack_VectorReq
-        BLNE    process_callback_chain
+        BLNE    process_callbacks_disableIRQ
         B       %BT20
 
 
diff --git a/s/Kernel b/s/Kernel
index 65aa6cb..0e4dd6b 100644
--- a/s/Kernel
+++ b/s/Kernel
@@ -956,7 +956,7 @@ Do_CallBack_postpone_already_clear
 
 
 ; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-; Also called from source.pmf.key, during readc
+; Also called from source.pmf.key, during readc amd in s.HAL in DebugTerminal_Rdch
 
 process_callbacks_disableIRQ ROUT
 
-- 
GitLab