Commit e277e70f authored by Jeffrey Lee's avatar Jeffrey Lee

Fix crash with HALDebug {TRUE}

Detail:
  s/Top - Update internal HAL debug functions to preserve all the required registers; the new HAL_Debug / UART function implementations corrupt more of the caller-save registers than the old ones did
Admin:
  Tested on Raspberry Pi


Version 0.65. Tagged as 'BCM2835-0_65'
parent 3467df7b
/* (0.64)
/* (0.65)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.64
#define Module_MajorVersion_CMHG 0.65
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 10 Dec 2016
#define Module_Date_CMHG 12 Dec 2016
#define Module_MajorVersion "0.64"
#define Module_Version 64
#define Module_MajorVersion "0.65"
#define Module_Version 65
#define Module_MinorVersion ""
#define Module_Date "10 Dec 2016"
#define Module_Date "12 Dec 2016"
#define Module_ApplicationDate "10-Dec-16"
#define Module_ApplicationDate "12-Dec-16"
#define Module_ComponentName "BCM2835"
#define Module_ComponentPath "mixed/RiscOS/Sources/HAL/BCM2835"
#define Module_FullVersion "0.64"
#define Module_HelpVersion "0.64 (10 Dec 2016)"
#define Module_LibraryVersionInfo "0:64"
#define Module_FullVersion "0.65"
#define Module_HelpVersion "0.65 (12 Dec 2016)"
#define Module_LibraryVersionInfo "0:65"
......@@ -950,22 +950,22 @@ HAL_InitDevices
[ HALDebug
; a2-> null terminated string
HAL_DebugTXS ROUT
STMFD sp!, {a1,lr}
SUB a2,a2,#1
1 LDRB a1, [a2,#1]!
STMFD sp!, {a1-a4,v1,ip,lr}
SUB v1, a2, #1
1 LDRB a1, [v1,#1]!
TEQ a1, #&0
LDMEQFD sp!, {a2,pc}
LDMEQFD sp!, {a1-a4,v1,ip,pc}
BL HAL_DebugTX
B %BT1
HAL_DebugHexTX
stmfd r13!, {r0-r3,lr}
stmfd r13!, {r0-r3,ip,lr}
b jbdt1
HAL_DebugHexTX2
stmfd r13!, {r0-r3,lr}
stmfd r13!, {r0-r3,ip,lr}
b jbdt2
HAL_DebugHexTX4
stmfd r13!, {r0-r3,lr}
stmfd r13!, {r0-r3,ip,lr}
mov r0,r0,ror #24 ; hi byte
bl jbdtxh
mov r0,r0,ror #24
......@@ -978,33 +978,33 @@ jbdt1
bl jbdtxh
mov r0,#' '
bl HAL_DebugTX
ldmfd r13!, {r0-r3,pc}
ldmfd r13!, {r0-r3,ip,pc}
HAL_DebugTXStrInline
stmfd r13!, {r0-r3} ; lr points to prinstring, immediately
stmfd r13!, {a1-a4,v1,ip} ; lr points to prinstring, immediately
; following call, null terminated
sub r3,lr,#1
1 ldrb r0,[r3,#1]! ; pop next char, auto incr
teq r0,#0 ; terminating null
biceq lr,r3,#3 ; round down address
ldmeqfd r13!,{r0-r3}
sub v1,lr,#1
1 ldrb a1,[v1,#1]! ; pop next char, auto incr
teq a1,#0 ; terminating null
biceq lr,v1,#3 ; round down address
ldmeqfd r13!,{a1-a4,v1,ip}
addeq pc,lr,#4 ; return to next word
bl HAL_DebugTX ; else send, then
b %bt1 ; loop
jbdtxh stmfd r13!,{r0-r3,lr} ; print byte as hex
and a4,a1,#&f ; get low nibble
jbdtxh stmfd r13!,{a1-a4,v1,ip,lr} ; print byte as hex
and v1,a1,#&f ; get low nibble
and a1,a1,#&f0 ; get hi nibble
mov a1,a1,lsr #4 ; shift to low nibble
cmp a1,#&9 ; 9?
addle a1,a1,#&30
addgt a1,a1,#&37 ; convert letter if needed
bl HAL_DebugTX
cmp a4,#9
addle a1,a4,#&30
addgt a1,a4,#&37
cmp v1,#9
addle a1,v1,#&30
addgt a1,v1,#&37
bl HAL_DebugTX
ldmfd r13!,{r0-r3,pc}
ldmfd r13!,{a1-a4,v1,ip,pc}
]
END
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