Commit 59d9f948 authored by Timothy E Baldwin's avatar Timothy E Baldwin Committed by ROOL
Browse files

Preserve LR and CPSR in DebugTX

This ensures that the debug macros may be freeley placed without
concern for if LR and CPSR contain important values, and avoid the
of code only working because the debug code changes the flags with
the effect of a bug appearing when debugging is enabled.

Version 6.49. Tagged as 'Kernel-6_49'
parent bbc7ad20
......@@ -9,12 +9,12 @@
GBLS Module_ApplicationDate
GBLS Module_HelpVersion
GBLS Module_ComponentName
Module_MajorVersion SETS "6.48"
Module_Version SETA 648
Module_MajorVersion SETS "6.49"
Module_Version SETA 649
Module_MinorVersion SETS ""
Module_Date SETS "16 Jan 2021"
Module_ApplicationDate SETS "16-Jan-21"
Module_Date SETS "23 Jan 2021"
Module_ApplicationDate SETS "23-Jan-21"
Module_ComponentName SETS "Kernel"
Module_FullVersion SETS "6.48"
Module_HelpVersion SETS "6.48 (16 Jan 2021)"
Module_FullVersion SETS "6.49"
Module_HelpVersion SETS "6.49 (23 Jan 2021)"
END
/* (6.48)
/* (6.49)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 6.48
#define Module_MajorVersion_CMHG 6.49
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 16 Jan 2021
#define Module_Date_CMHG 23 Jan 2021
#define Module_MajorVersion "6.48"
#define Module_Version 648
#define Module_MajorVersion "6.49"
#define Module_Version 649
#define Module_MinorVersion ""
#define Module_Date "16 Jan 2021"
#define Module_Date "23 Jan 2021"
#define Module_ApplicationDate "16-Jan-21"
#define Module_ApplicationDate "23-Jan-21"
#define Module_ComponentName "Kernel"
#define Module_FullVersion "6.48"
#define Module_HelpVersion "6.48 (16 Jan 2021)"
#define Module_LibraryVersionInfo "6:48"
#define Module_FullVersion "6.49"
#define Module_HelpVersion "6.49 (23 Jan 2021)"
#define Module_LibraryVersionInfo "6:49"
......@@ -2855,7 +2855,8 @@ Reset_IRQ_Exit
[ DebugHALTX
DebugHALPrint
Push "a1-a4,v1,sb,ip"
Push "a1-a4,v1,v2,sb,ip"
MRS v2, CPSR
AddressHAL
MOV v1, lr
10 LDRB a1, [v1], #1
......@@ -2869,7 +2870,8 @@ DebugHALPrint
; CallHAL HAL_DebugTX
ADD v1, v1, #3
BIC lr, v1, #3
Pull "a1-a4,v1,sb,ip"
MSR CPSR_sf, v2
Pull "a1-a4,v1,v2,sb,ip"
MOV pc, lr
]
......@@ -2877,6 +2879,7 @@ DebugHALPrint
[ DebugHALTX
DebugHALPrintReg ; Output number on top of stack to the serial port
Push "a1-a4,v1-v4,sb,ip,lr" ; this is 11 regs
MRS v1, CPSR
LDR v2, [sp,#11*4] ; find TOS value on stack
ADR v3, hextab
MOV v4, #8
......@@ -2892,6 +2895,7 @@ DebugHALPrintReg ; Output number on top of stack to the serial port
MOV a1, #10
CallHAL HAL_DebugTX
MSR CPSR_sf, v1
Pull "a1-a4,v1-v4,sb,ip,lr"
ADD sp, sp, #4
MOV pc, lr
......
......@@ -23,22 +23,26 @@
MACRO
DebugReg $reg, $str
[ DebugHALTX
Push "$reg"
Push lr
Push "$reg"
[ "$str" <> ""
BL DebugHALPrint
= "$str", 0
ALIGN
]
bl DebugHALPrintReg
BL DebugHALPrintReg
Pull lr
]
MEND
MACRO
DebugTX $str
[ DebugHALTX
Push lr
BL DebugHALPrint
= "$str", 13,10,00
ALIGN
Pull lr
]
MEND
......
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