Commit 3a7f1161 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Stop peeking zero page.

Now uses OS_ReadSysInfo 6 to get the address of the domain id.
Put the throwback subreasons into the exported constants.
Remove more of the hardwired constants.
Remove all occurences of LDMFD r13! {lr and pc together} cos ARM have deprecated it.

Version 1.68. Tagged as 'DDEUtils-1_68'
parent 8428684d
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "1.67"
Module_Version SETA 167
Module_MajorVersion SETS "1.68"
Module_Version SETA 168
Module_MinorVersion SETS ""
Module_Date SETS "17 Sep 2011"
Module_ApplicationDate SETS "17-Sep-11"
Module_ComponentName SETS "DDEUtils"
Module_ComponentPath SETS "castle/RiscOS/Sources/Programmer/DDEUtils"
Module_FullVersion SETS "1.67"
Module_HelpVersion SETS "1.67 (17 Sep 2011)"
Module_FullVersion SETS "1.68"
Module_HelpVersion SETS "1.68 (17 Sep 2011)"
END
/* (1.67)
/* (1.68)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 1.67
#define Module_MajorVersion_CMHG 1.68
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 17 Sep 2011
#define Module_MajorVersion "1.67"
#define Module_Version 167
#define Module_MajorVersion "1.68"
#define Module_Version 168
#define Module_MinorVersion ""
#define Module_Date "17 Sep 2011"
......@@ -18,6 +18,6 @@
#define Module_ComponentName "DDEUtils"
#define Module_ComponentPath "castle/RiscOS/Sources/Programmer/DDEUtils"
#define Module_FullVersion "1.67"
#define Module_HelpVersion "1.67 (17 Sep 2011)"
#define Module_LibraryVersionInfo "1:67"
#define Module_FullVersion "1.68"
#define Module_HelpVersion "1.68 (17 Sep 2011)"
#define Module_LibraryVersionInfo "1:68"
......@@ -34,5 +34,9 @@ SWIClass SETS DDEUtilsSWI_Name
AddSWI ReadPrefix
AddSWI FlushCL
Throwback_ReasonProcessing * 0
Throwback_ReasonErrorDetails * 1
Throwback_ReasonInfoDetails * 2
OPT OldOpt
END
......@@ -16,11 +16,12 @@
; Purpose: Assembler source for DDEUtils module
;
GET VersionASM
GET Hdr:ListOpts
GET Hdr:Macros
GET Hdr:System
GET Hdr:Services
GET Hdr:OSRSI6
GET Hdr:PublicWS
GET Hdr:HighFSI
GET Hdr:FSNumbers
GET Hdr:NewErrors
......@@ -29,6 +30,7 @@
GET Hdr:MsgTrans
GET Hdr:ModHand
GET hdr.DDEUtils
GET VersionASM
; JRF: Debugging. Turn this off for ROMing
GBLL Debug
......@@ -65,11 +67,6 @@ AllowDirChanging SETL {TRUE}
GBLL HandleImages
HandleImages SETL {FALSE}
; DDEUtils throwback subreasons
reason_processing * 0
reason_errordetails * 1
reason_infodetails * 2
; DDEUtils error codes
ddeutils_errbase * ErrorBase_AcornDDE
^ ddeutils_errbase
......@@ -92,25 +89,23 @@ msg_throwback_end # 1
msg_throwback_infoforfile # 1
msg_throwback_infodetails # 1
; DDEUtils linked list
; DDEUtils workspace
^ 0, r12
chain # 4
fname_buffer # 4
cli_buffer # 4
cli_size # 4
receiver_id # 4
wimp_domain # 4
workspace_end # 0
o_next EQU &00
ASSERT :INDEX: o_next = 0
o_wimpdomain EQU &04
o_prefix EQU &08
zp_wimpdomain * &ff8
! 0, "Warning: Zero page grubbing with domain!"
IMPORT |__RelocCode|
; DDEUtils linked list member
^ 0
o_next # 4
o_wimpdomain # 4
o_prefix # 4
AREA |!|, CODE, READONLY
AREA |ddeutils$$module|, CODE, READONLY
module_start
DCD 0 ; Run
......@@ -143,7 +138,7 @@ swi_table
DCB "SetCLSize", 0
DCB "SetCL", 0
DCB "GetCLSize", 0
DCB "GetCl", 0
DCB "GetCl", 0 ; Lowercase 'L'? Go figure.
DCB "ThrowbackRegister", 0
DCB "ThrowbackUnRegister", 0
DCB "ThrowbackStart", 0
......@@ -192,7 +187,7 @@ service
MOVNE pc,lr
ursservice
; Service_Reset
TEQ r1,#Service_Reset
TEQ r1, #Service_Reset
LDREQ r12,[r12]
BEQ reset
; else Service_WimpCloseDown
......@@ -263,7 +258,17 @@ init
STRVC r0, cli_size
STRVC r0, receiver_id
BLVC claimvectors
BVS %FT10
MOV r0, #6
MOV r1, #0
MOV r2, #OSRSI6_DomainId
SWI XOS_ReadSysInfo
MOVVS r2, #0
TEQ r2, #0
LDREQ r2, =Legacy_DomainId
STR r2, wimp_domain
BL claimvectors
MOVVC r0, #ModHandReason_Claim
MOVVC r3, #FilenameLength * 2
SWIVC XOS_Module
......@@ -274,6 +279,7 @@ init
MOVVC r3, #0
MOVVC r4, #VarType_Code
SWIVC XOS_SetVarVal
10
LDMFD sp!, {r7, r8, r9, r10, r11, lr}
xferv
TEQ pc, pc
......@@ -342,8 +348,8 @@ claimvectors
ADRNEL r1, file_handler_26
SWI XOS_Release
01
LDMFD sp!, {r2,r3,lr}
MOV r0,r3
LDMFD sp!, {r2,r3,lr}
TEQ pc, pc
ORRNES pc,lr,#V_bit
MSR CPSR_f, #V_bit
......@@ -442,7 +448,8 @@ finish2
; Output: R0: pointer to prefix dir for that task or 0 if none.
doswi_readprefix
MOVS r11, r0, lsl #16
LDREQ r11, [r11, #zp_wimpdomain]
LDREQ r11, wimp_domain
LDREQ r11, [r11]
MOVEQ r11, r11, ror #16
MOV r0, #0
STMFD sp!, {r1, r2, r3, r8, lr}
......@@ -473,7 +480,7 @@ do_swi_orig
CMP r11,#first_unused_swi
ADDLT pc,pc,r11,LSL #2
B module_swierror
do_lowest_swi
lowest_swi
B doswi_prefix
B doswi_setclsize
B doswi_setcl
......@@ -486,8 +493,8 @@ do_lowest_swi
B doswi_throwbackend
B doswi_readprefix
B doswi_flushcl
do_highest_swi
first_unused_swi * (do_highest_swi - do_lowest_swi) / 4
highest_swi
first_unused_swi * (highest_swi - lowest_swi) / 4
module_swierror
STMFD sp!, {r1-r4, lr}
......@@ -504,17 +511,16 @@ msg_swierror
ALIGN
doswi_prefix
MOV r10, r0
STMFD sp!, {r1, r2, r3, r8, lr}
TEQ r0,#0
MOVS r10, r0
BEQ %FT01 ; they gave 0
LDRB r0,[r10]
CMP r0,#32
CMP r0,#' '
BLO %FT01 ; it was a null command
[ CanonicalisePath
STMFD sp!, {r4, r5}
MOV r0,#37
MOV r0,#FSControl_CanonicalisePath
MOV r1,r10
LDR r2,fname_buffer
MOV r3,#0 ; no path var
......@@ -543,7 +549,8 @@ doswi_prefix
]
ASSERT DDEUtils_Prefix = DDEUtilsSWI_Base
LDR r11, [r11, #zp_wimpdomain]
LDR r11, wimp_domain
LDR r11, [r11]
ADR r8, chain
LDR r2, chain
do_swi1
......@@ -627,7 +634,7 @@ write_name0
SWICS OS_WriteC
CMP r0, #' '+1
BCS write_name0
SWI os_newline
SWI OS_NewLine
LDMFD sp!,{r0-r2}
]
MOV r2, r1
......@@ -750,7 +757,7 @@ write_name1
SWICS OS_WriteC
CMP r0, #' '+1
BCS write_name1
SWI os_newline
SWI OS_NewLine
]
LDMFD sp!, {r0, r1, r2, r3, r4, lr}
TEQ pc, pc
......@@ -822,7 +829,7 @@ file_handler_32
SWICS OS_WriteC
CMP r0, #' '+1
BHS %BT01
SWI os_newline
SWI OS_NewLine
LDMFD sp!, {r0,r1}
02
|
......@@ -831,13 +838,13 @@ file_handler_32
STMFD sp!, {r8, r11, lr}
]
LDR r8, chain
MOV lr, #0
LDR lr, [lr, #zp_wimpdomain] ; lr = domainid
LDR lr, wimp_domain
LDR lr, [lr] ; lr = domainid
file_handler1
CMP r8, #0
BEQ file_handler2
LDR r11, [r8, #o_wimpdomain]
CMP r11, lr
CMP r11, lr ; hunt for domainid in linked list of tasks
LDRNE r8, [r8, #o_next]
BNE file_handler1
LDR r11, fname_buffer
......@@ -876,13 +883,14 @@ fscontrol_handler_26
ORRS pc, lr, #V_bit
fscontrol_handler_32
CMP r0, #25 ; Rename objects
BLO fscontrol_handler1
CMP r0, #27 ; Copy objects
BLO copy_or_rename
CMPNE r0, #28 ; Count objects
CMPNE r0, #32 ; *FileInfo
CMPNE r0, #37 ; Canonicalise
CMP r0, #FSControl_Access
BLS fscontrol_handler1
ASSERT (FSControl_Rename > FSControl_Access) :LAND: (FSControl_Rename < FSControl_Copy)
CMP r0, #FSControl_Copy
BLS copy_or_rename
CMPNE r0, #FSControl_Count
CMPNE r0, #FSControl_FileInfo
CMPNE r0, #FSControl_CanonicalisePath
[ HandleImages
CMPNE r0, #41 ; return defects for image
CMPNE r0, #42 ; map out defects for image
......@@ -891,8 +899,7 @@ fscontrol_handler_32
CMPNE r0, #48 ; write boot for disc/image
CMPNE r0, #49 ; read free space for disc/image
CMPNE r0, #50 ; rename disc/image
; (should already be canonical, I think - JRF)
; CMPNE r0, #51 ; update stamp
; CMPNE r0, #51 ; update stamp (should already be canonical, I think - JRF)
CMPNE r0, #52 ; find object at offset
CMPNE r0, #55 ; read freespace (large)
CMPNE r0, #56 ; read defects (large)
......@@ -900,22 +907,22 @@ fscontrol_handler_32
]
BEQ file_handler_external_entry
[ AllowDirChanging
CMP r0, #53
CMP r0, #FSControl_SetDir
BEQ set_given_dir
CMP r0, #43
CMP r0, #FSControl_NoDir
BEQ unset_dir
]
CMP r0, r0
MOV pc, lr
fscontrol_handler1
CMP r0, #5 ; *.
CMPNE r0, #6 ; *Ex
CMPNE r0, #9 ; *Info
CMPNE r0, #24 ; *Access
CMP r0, #FSControl_Cat
CMPNE r0, #FSControl_Ex
CMPNE r0, #FSControl_Info
CMPNE r0, #FSControl_Access
BEQ file_handler_external_entry
[ AllowDirChanging
CMP r0, #0
CMP r0, #FSControl_Dir
BEQ change_dir
]
CMP r0, r0
......@@ -928,16 +935,13 @@ unset_dir
SWI XDDEUtils_ReadPrefix ; read context
BVS %FT01
TEQ r0,#0
LDMEQFD sp!, {r0,pc}
LDMEQFD sp!, {r0, pc}
MOV r0,#0
SWI XDDEUtils_Prefix
01
LDMVCFD sp!, {r0,lr,pc}
ADDVS sp,sp,#4
LDMFD sp!, {lr,pc}
BVS %FT01
set_given_dir
CMP r2,#0
CMP r2, #Dir_Current
MOVNE pc,lr ; only process if 'set CSD'
STMFD sp!, {r0, lr}
......@@ -945,13 +949,13 @@ set_given_dir
SWI XDDEUtils_ReadPrefix ; read context
BVS %FT01
CMP r0,#0
LDMEQFD sp!, {r0,pc}
LDMEQFD sp!, {r0, pc}
MOV r0,r1
SWI XDDEUtils_Prefix
01
LDMVCFD sp!, {r0,lr,pc}
ADDVS sp,sp,#4
LDMFD sp!, {lr,pc}
STRVS r0, [sp, #0]
LDMFD sp!, {r0, lr}
LDMFD sp!, {pc}
change_dir
STMFD sp!, {r0-r5, lr}
......@@ -960,23 +964,23 @@ change_dir
BVS %FT01
TEQ r0,#0
LDMEQFD sp!, {r0-r5,pc}
MOV r0,#5
MOV r0,#OSFile_ReadInfo
SWI XOS_File
TST r0,#2
TST r0, #object_directory ; also catches image files
BEQ %FT02
MOV r0,r1
SWI XDDEUtils_Prefix
01
LDMVCFD sp!, {r0-r5,lr,pc}
ADDVS sp,sp,#4
LDMFD sp!, {r1-r5,lr,pc}
STRVS r0, [sp, #0]
LDMFD sp!, {r0-r5, lr}
LDMFD sp!, {pc}
02
MOV r0,#19
MOV r0,#OSFile_MakeError
MOV r2,#&100 ; Directory 'wibble' not found
SWI XOS_File
ADD sp,sp,#4 ; skip r0
LDMFD sp!, {r1-r5,lr,pc}
LDMFD sp!, {r1-r5, lr}
LDMFD sp!, {pc}
]
copy_or_rename
......@@ -995,8 +999,8 @@ copy_or_rename1b
LDR r8, [r8]
CMP r8, #0
BEQ copy_or_rename2
MOV lr, #0
LDR lr, [lr, #zp_wimpdomain]
LDR lr, wimp_domain
LDR lr, [lr]
LDR r11, [r8, #o_wimpdomain]
CMP r11, lr
BNE copy_or_rename1b
......@@ -1306,20 +1310,20 @@ throwback_add_prefix
BL file_handler_external_entry
STMFD sp!, {r0, r3, r4}
MOV lr, r0
CMP lr, #reason_infodetails
CMP lr, #Throwback_ReasonInfoDetails
MOVEQ r0, #msg_throwback_infoforfile
CMP lr, #reason_processing
CMP lr, #Throwback_ReasonProcessing
MOVEQ r0, #msg_throwback_processingfile
CMP lr, #reason_errordetails
CMP lr, #Throwback_ReasonErrorDetails
MOVEQ r0, #msg_throwback_errorsin
BL stringonlymsg
LDRVC r0, [sp], #4
ADDVS sp, sp, #4
LDMFD sp!, {r3, r4}
BVS throwback_add_prefix1
CMP r0, #reason_processing
CMP r0, #Throwback_ReasonProcessing
LDMEQFD sp!, {pc}
CMP r0, #reason_infodetails
CMP r0, #Throwback_ReasonInfoDetails
MOVEQ r0, #msg_throwback_infodetails
MOVNE r0, #msg_throwback_errordetails
MOV r1, r5
......@@ -1328,8 +1332,10 @@ throwback_add_prefix1
LDMFD sp!, {lr}
B xferv
; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; DDEUtils_ThrowbackSend
; ----------------------
; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
doswi_throwbacksend
STMFD sp!, {r0-r4, r9, lr}
BL checkactivetasks
......
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