Commit c453026f authored by Stewart Brodie's avatar Stewart Brodie
Browse files

32-bit compatibility added.

Detail:
  Also fixed faulty debug code which tried to report the escape state,
    but would have always failed to do.
Admin:
  Tested Phoebe and 32 machine builds.  Tested on Risc PC.

Version 0.47. Tagged as 'DeviceFS-0_47'
parent 10767c06
;
; This file is automatically maintained by srccommit, do not edit manually.
;
GBLS Module_MajorVersion
GBLA Module_Version
GBLS Module_MinorVersion
GBLS Module_Date
GBLS Module_FullVersion
Module_MajorVersion SETS "0.46"
Module_Version SETA 46
Module_MinorVersion SETS ""
Module_Date SETS "05 Aug 1999"
Module_FullVersion SETS "0.46"
GBLS Module_MajorVersion
GBLA Module_Version
GBLS Module_MinorVersion
GBLS Module_Date
GBLS Module_FullVersion
Module_MajorVersion SETS "0.47"
Module_Version SETA 47
Module_MinorVersion SETS ""
Module_Date SETS "10 Dec 1999"
Module_FullVersion SETS "0.47"
END
/* (0.46)
/* (0.47)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 0.46
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 05 Aug 1999
#define Module_MajorVersion_CMHG 0.47
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 10 Dec 1999
#define Module_MajorVersion "0.46"
#define Module_Version 46
#define Module_MinorVersion ""
#define Module_Date "05 Aug 1999"
#define Module_MajorVersion "0.47"
#define Module_Version 47
#define Module_MinorVersion ""
#define Module_Date "10 Dec 1999"
#define Module_FullVersion "0.46"
#define Module_FullVersion "0.47"
......@@ -323,10 +323,12 @@ debug SETL false
hostvdu SETL false
debug_file SETS "<DevFSDebug>"
GBLL debugfs
debugfs SETL false
GBLL debuggbpb
debuggbpb SETL false
GBLL debugfs
GBLL debugtransmitchar
GBLL debuggbpb
debugfs SETL true :LAND: debug
debuggbpb SETL true :LAND: debug
debugtransmitchar SETL true :LAND: debug
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;
......@@ -346,6 +348,10 @@ module_start & 0
& swidespatch -module_start
& switable -module_start
& 0
& 0 ; international meessages
[ :LNOT: No32bitCode
& ModuleFlags -module_start
]
help = "DeviceFS", 9, "$Module_MajorVersion ($Module_Date)"
[ debug
......@@ -392,6 +398,10 @@ set_filetype = "Set File$Type_FCC Device", 0 ; setup variable
MakeErrorBlock DeviceFS_BadReserved
MakeErrorBlock DeviceFS_MustBeBuffered
[ :LNOT: No32bitCode
ModuleFlags DCD 1 ; 32-bit compatible
]
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
......@@ -497,7 +507,8 @@ final ENTRY
[ debug
Debug_Close
]
EXITS
CLRV
EXIT
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
......@@ -529,7 +540,7 @@ service ROUT
[ standalonemessages
TEQNE r1, #Service_ResourceFSStarting
]
MOVNES pc, lr
MOVNE pc, lr
serviceentry LDR wp, [wp] ; wp -> workspace
......@@ -540,7 +551,7 @@ serviceentry LDR wp, [wp] ; wp -> workspac
ADRL r0, resourcefsfiles
MOV lr, pc
MOV pc, r2
Pull "r0-r3,pc",,^
Pull "r0-r3,pc"
10
]
TEQ r1, #Service_FSRedeclare ; could it be a Service_FSRedeclare?
......@@ -556,7 +567,7 @@ serviceentry LDR wp, [wp] ; wp -> workspac
SWI XOS_Byte
TEQ r1, #0
Pull "r0-r2, pc",NE,^ ; if hard reset, do nothing
Pull "r0-r2, pc",NE ; if hard reset, do nothing
LDR r0, Flags
BIC r0, r0, #f_ResetMask
......@@ -564,7 +575,7 @@ serviceentry LDR wp, [wp] ; wp -> workspac
BL SetupThreshold
Pull "r0-r2, pc",,^
Pull "r0-r2, pc"
GBLS conditionalgetbodge
[ standalonemessages
......@@ -612,7 +623,7 @@ swidespatch ROUT
[ international
B MakeErrorWithModuleName
|
ORRS pc, lr, #V_bit
RETURNVS
]
MakeErrorBlock DeviceFS_BadSWI
......@@ -756,6 +767,7 @@ Register ENTRY "r0-pr"
MOV r2, #3
STRB r2, [r1] ; [r1] = 3, read time in 5 byte format
SWI XOS_Word ; via OsWORD
BVS %FT05
LDMVCIA sp, {r0-r7} ; what did we have on entry?
......@@ -765,7 +777,7 @@ Register ENTRY "r0-pr"
MOVVC r0, pr ; r0 -> parent record (device handle)
BLVC RegisterObj ; register the list of devices
BVC %FT15
05
Push "r0"
MOVS r0, pr
BLNE Deregister ; if it errored then attempt to remove records
......@@ -775,8 +787,8 @@ Register ENTRY "r0-pr"
15
STR r0, [sp]
PullEnv
BICVCS pc, lr, #V_bit
ORRS pc, lr, #V_bit
RETURNVC VC ; conditional ensures optimal 32-bit code
RETURNVS VS ; conditional ensures optimal 32-bit code
; internal error
......@@ -854,15 +866,15 @@ Deregister ENTRY "r0-dr"
MOV pr, r3
PullEnv
BICS pc, lr, #V_bit ; yippee it all worked ok so return no errors
RETURNVC ; yippee it all worked ok so return no errors
; external error
10
STR r0, [sp]
PullEnv
BICVCS pc, lr, #V_bit
ORRS pc, lr, #V_bit
RETURNVC VC ; conditional ensures optimal 32-bit code
RETURNVS VS ; conditional ensures optimal 32-bit code
; internal error
......@@ -908,7 +920,7 @@ RegisterObj ENTRY "r0-pr"
LDR r0, [r1]
TEQ r0, #0 ; have we reached the end of the block?
PullEnv EQ
BICEQS pc, lr, #V_bit ; return because it worked correctly
RETURNVC EQ ; return because it worked correctly
BL registerdev ; local register (accepts pr -> parent record)
ADDVC r1, r1, #dr_SIZE
......@@ -932,7 +944,7 @@ RegisterObj ENTRY "r0-pr"
10
STR r0, [sp]
PullEnv
ORRS pc, lr, #V_bit
RETURNVS
; internal error
......@@ -1146,7 +1158,7 @@ registerdev ENTRY "r0-r7, fr, dr"
Debug registerdev, "finished registering the device"
PullEnv
BICS pc, lr, #V_bit ; it has worked so return with all preserved + V clear.
RETURNVC ; it has worked so return with all preserved + V clear.
; free temporary block and device block, then report external error
......@@ -1171,8 +1183,8 @@ registerdev ENTRY "r0-r7, fr, dr"
98
STRVS r0, [sp]
PullEnv
BICVCS pc, lr, #V_bit
ORRS pc, lr, #V_bit
RETURNVC VC ; conditional ensures optimal 32-bit code
RETURNVS VS ; conditional ensures optimal 32-bit code
; just report internal error
......@@ -1207,7 +1219,7 @@ DeregisterObj ENTRY "r0-pr"
LDR r0, [pr, #parent_ValidationWord]
ADRL r2, Register
TEQ r0, r2 ; is the parent record handle valid?
CMP r0, r2 ; is the parent record handle valid?
ADRNEL r0, ErrorBlock_DeviceFS_BadHandle
BNE %FT99 ; if not report internal error
BLVC deregisterdev ; if validation did not fail then remove object
......@@ -1215,8 +1227,8 @@ DeregisterObj ENTRY "r0-pr"
STR r0, [sp] ; stash error pointer if it went wrong
PullEnv
BICVCS pc, lr, #V_bit
ORRS pc, lr, #V_bit
RETURNVC VC ; conditional ensures optimal 32-bit code
RETURNVS VS ; conditional ensures optimal 32-bit code
; report internal error
......@@ -1360,12 +1372,12 @@ deregisterdev ENTRY "r0, r2-r5, pr"
Debug deregister, "UpCall issued to refresh directory viewers"
PullEnv
BICS pc, lr, #V_bit ; it worked so ensure that V clear.
RETURNVC ; it worked so ensure that V clear.
20
STR r0, [sp]
PullEnv
ORRS pc, lr, #V_bit
RETURNVS
30
STR r0, [sp]
......@@ -1401,18 +1413,25 @@ deregisterdev ENTRY "r0, r2-r5, pr"
CallDevice ROUT
BIC lr, lr, #V_bit ; ensure V clear in return address
Push "r1, r8-wp, lr"
SavePSR lr
TEQ r1, #0 ; is it a broadcast?
BNE %20
BIC lr, lr, #V_bit ; ensure V clear for return
Push "lr"
LDR r1, ParentsAt ; -> parents list
10
TEQ r1, #0 ; does a valid record exist?
Pull "r1, r8-wp, pc", EQ, ^
BNE %FT15
Pull "lr"
RestPSR lr
Pull "r1, r8-wp, pc" ; broadcasts never return errors
15
BL CallDevice ; oopsy doopsy re-enter to call device
ADDVS sp, sp, #4 ; trash stacked PSR
BVS %90
LDR r1, [r1, #parent_Next] ; assuming it worked get the next parent pointer
......@@ -1506,12 +1525,11 @@ Threshold ENTRY "r0-r3"
MOV r1, r2 ; setup threshold value to be used
SWI XBuffer_Threshold
STRVC r1, [sp, #CallerR2]
EXITS VC ; if it worked write return value and exit
STR r0, [sp] ; return external error
STRVC r1, [sp, #CallerR2] ; if it worked write return value and exit
STRVS r0, [sp] ; return external error
PullEnv
ORRS pc, lr, #V_bit
RETURNVC VC ; conditional ensures optimal 32-bit code
RETURNVS VS ; conditional ensures optimal 32-bit code
90
STR r0, [sp]
......@@ -1535,7 +1553,7 @@ Threshold ENTRY "r0-r3"
SetupThreshold ENTRY "r0-r3"
LDR r3, Flags
TST r3, #f_UpCallV ; do I currently own the UpCallV?
EXITS NE ; yes, so don't claim again
EXIT NE ; yes, so don't claim again
MOV r0, #UpCallV
ADR r1, UpCall ; -> routine
......@@ -1563,7 +1581,7 @@ SetupThreshold ENTRY "r0-r3"
RemoveThreshold ENTRY "r0-r3"
LDR r3, Flags
TST r3, #f_UpCallV ; do I currently have an claim on UpCallV
EXITS EQ ; and then return
EXIT EQ ; and then return
MOV r0, #UpCallV
ADR r1, UpCall ; -> routine to remove
......@@ -1593,7 +1611,7 @@ UpCall ROUT
TEQ r0, #UpCall_BufferFilling
TEQNE r0, #UpCall_BufferEmptying
MOVNES pc, lr ; quick check to see if mine
MOVNE pc, lr ; quick check to see if mine
Push "r0-r4,pr"
......@@ -1641,8 +1659,8 @@ UpCall ROUT
10
]
Pull "r0-r4,pr, lr" ; balance stack (pull extra one to claim vector)
BICVCS pc, lr, #V_bit ; only errors are external
ORRS pc, lr, #V_bit
RETURNVC VC ; conditional ensures optimal 32-bit code
RETURNVS VS ; conditional ensures optimal 32-bit code
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
......@@ -1666,6 +1684,10 @@ UpCall ROUT
ReceivedChar ENTRY "r0-r3, fr, r9"
SavePSR lr
BIC lr, lr, #C_bit ; clear C bit from saved PSR
Push "lr"
MOV fr, r1 ; -> file record
LDR r1, [fr, #file_BufferHandle]
......@@ -1685,8 +1707,9 @@ ReceivedChar ENTRY "r0-r3, fr, r9"
SWI XOS_GenerateEvent
BVS %90 ; if it goes sprong then return an error
10
PullEnv
BICS pc, lr, #C_bit ; make sure C clear on exit
Pull "lr"
RestPSR lr ; make sure C clear on exit
EXIT
; buffered stream
......@@ -1701,15 +1724,14 @@ ReceivedChar ENTRY "r0-r3, fr, r9"
SWI XOS_CallAVector ; attempt to insert into the vector
BVS %90 ; return any errors from the SWI
]
PullEnv
BICCCS pc, lr, #C_bit
ORRS pc, lr, #C_bit ; reflect the C bit correctly
Pull "lr"
ORRCS lr, lr, #C_bit ; guaranteed C_bit is clear
RestPSR lr ; reflect the C bit correctly
EXIT
90
STR r0, [sp]
PullEnv
ORRS pc, lr, #V_bit
STR r0, [sp, #4]! ; trash stacked PSR
EXIT ; V must be set to get to here
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
......@@ -1736,6 +1758,10 @@ ReceivedChar ENTRY "r0-r3, fr, r9"
TransmitChar ENTRY "r1-r3, fr, r9"
SavePSR lr
BIC lr, lr, #C_bit :OR: V_bit ; clear C and V from return PSR
Push "lr"
MOVS fr, r1 ; -> file record
MOVEQ r0, #-1
BEQ %30 ; return closing stream
......@@ -1773,14 +1799,16 @@ TransmitChar ENTRY "r1-r3, fr, r9"
30
Debug transmitchar, "character", r0
PullEnv
Pull "lr"
CMP r0, #&100
BICCCS pc, lr, #C_bit+ V_bit ; if valid (<256) then clear C and V
BCC %FT40 ; if valid (<256) then clear C and V
ORR lr, lr, #C_bit
CMP r0, #-1 ; is it a buffer empty?
BICEQS pc, lr, #V_bit ; yes, so return V flag
ORRS pc, lr, #V_bit
ORRNE lr, lr, #V_bit ; no, so set V
40
RestPSR lr
EXIT
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
......@@ -1799,7 +1827,7 @@ TransmitChar ENTRY "r1-r3, fr, r9"
; case-insensitive ASCII order.
;
InsertDeviceIntoList ENTRY "r0-r3"
InsertDeviceIntoList EntryS "r0-r3"
Debug sorting, "about to sort devices"
......@@ -1849,7 +1877,7 @@ CopyString LDRB r2, [r0], #1
STRB r2, [r1], #1
TEQ r2, #0
BNE CopyString
MOVS pc, lr
RETURN
; copy string with no null termination, ie. don't write null, r0 -> r1. breaks r2
;
......@@ -1858,7 +1886,7 @@ CopyNoTerm LDRB r2, [r0], #1
TEQ r2, #0
STRNEB r2, [r1], #1
BNE CopyNoTerm
MOVS pc, lr
RETURN
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;
......@@ -1902,7 +1930,7 @@ OpenMessages ENTRY "r0-r3"
LDR r3, Flags
TST r3, #f_WeHaveMessages ; do we have an open messages block?
EXITS NE ; yes, so don't bother again
EXIT NE ; yes, so don't bother again
ADR r0, MessagesWorkspace
ADRL r1, resource_file ; -> path to be opened
......@@ -1911,7 +1939,7 @@ OpenMessages ENTRY "r0-r3"
LDRVC r3, Flags
ORRVC r3, r3, #f_WeHaveMessages
STRVC r3, Flags ; assuming it worked mark as having messages
EXITS ; returning VC, VS from XSWI!
EXIT ; returning VC, VS from XSWI!
; Attempt to close the messages file.
......@@ -1919,14 +1947,14 @@ OpenMessages ENTRY "r0-r3"
CloseMessages ENTRY "r0"
LDR r0, Flags
TST r0, #f_WeHaveMessages ; do we have any messages?
EXITS EQ ; and return if not!
EXIT EQ ; and return if not!
ADR r0, MessagesWorkspace
SWI XMessageTrans_CloseFile ; yes, so close the file
LDRVC r0, Flags
BICVC r0, r0, #f_WeHaveMessages
STRVC r0, Flags ; mark as we don't have them
EXITS
EXIT
; Generate an error based on the error token given. Does not assume that
......@@ -1944,29 +1972,28 @@ MakeErrorWithModuleName ALTENTRY
MakeError ALTENTRY
MOV r4, #0
MakeErrorEntry
LDR r1, Flags
TST r1, #f_WeHaveMessages ; has the messages file been closed?
BLEQ OpenMessages
BL OpenMessages
LDR r1, Flags
TST r1, #f_WeHaveMessages
PullEnv EQ
ORREQS pc, lr, #V_bit ; if still not open then return with V set
RETURNVS EQ ; if still not open then return with V set
ADR r1, MessagesWorkspace ; -> message control block
[ true
ADR r2, error_buffer
MOV r3, #?error_buffer
|
MOV r2, #0
MOV r2, #0 ; no substitution + use internal buffers
MOV r3, #0
]
MOV r5, #0
MOV r6, #0
MOV r7, #0 ; no substitution + use internal buffers
MOV r7, #0
SWI XMessageTrans_ErrorLookup
BL CloseMessages ; attempt to close the doofer
SETV
EXIT ; return, r0 -> block, V set
......
......@@ -23,7 +23,7 @@ $label DoError $cc
[ international
$label B$cc MakeError
|
$label ORR$cc.S pc, lr, #VFlag
$label RETURNVS
]
MEND
......
This diff is collapsed.
......@@ -179,7 +179,7 @@ DecodeSpecial ROUT
SWI XOS_Module ; free second temporary block
Pull "r0-r5, r7-r8, dr, pr, lr"
BICS pc, lr, #V_bit ; ensure that V clear
RETURNVC ; ensure that V clear
85
Push "r0"
MOV r0, #ModHandReason_Free
......@@ -198,7 +198,7 @@ DecodeSpecial ROUT
SWINE XOS_Module ; free transing block
Pull "r0-r5, r7-r8, dr, pr, lr"
ORRS pc, lr, #V_bit
RETURNVS
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
......@@ -317,7 +317,7 @@ ScanSpecial ROUT
BNE %30 ; loop back reseting the rewind pointer
50
Pull "r0-r1, r3-r8, lr"
BICS pc, lr, #V_bit ; ensure that V clear on exit (ie. it worked, r2 =size)
RETURNVC ; ensure that V clear on exit (ie. it worked, r2 =size)
60
LDRB r7, [r0], #1
TEQ r7, #0
......@@ -355,7 +355,7 @@ ScanSpecial ROUT
90
ADD sp, sp, #4
Pull "r1, r3-r8, lr"
ORRS pc, lr, #V_bit ; ensure that overflow set on exit
RETURNVS ; ensure that overflow set on exit
; internal error
......@@ -452,7 +452,7 @@ handle_escape ROUT
BEQ %20 ; yes, so load the escape command and try again.
90
Pull "lr"
BICS pc, lr, #V_bit ; ensure V clear on exit
RETURNVC ; ensure V clear on exit
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
......
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