Commit 05bf4c26 authored by Stewart Brodie's avatar Stewart Brodie
Browse files

32-bit compatibility.

Detail:
  Module is 32-bit compatible
  Documentation updated to note that entry point is now called in SVC32.
Admin:
  Tested briefly on Ursula build.

Version 0.34. Tagged as 'Free-0_34'
parent 74320a1d
......@@ -5,7 +5,7 @@ Free_Register
Entry:
r0 - Filing system number
r1 - Address of routine to call to get free space info (see below)
r1 - r12 on entry to the above routine.
r2 - r12 on entry to the above routine.
Exit:
Registers preserved.
......@@ -20,6 +20,8 @@ Free_Deregister
This removes the filing system from the list of known filing systems.
In 32-bit systems, the processor will be in SVC32 on entry.
FS_Entry reason codes: (On entry to routine pointed to by r1 in above SWI)
......
;
; 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.33"
Module_Version SETA 33
Module_MinorVersion SETS ""
Module_Date SETS "25 Aug 1999"
Module_FullVersion SETS "0.33"
GBLS Module_MajorVersion
GBLA Module_Version
GBLS Module_MinorVersion
GBLS Module_Date
GBLS Module_FullVersion
Module_MajorVersion SETS "0.34"
Module_Version SETA 34
Module_MinorVersion SETS ""
Module_Date SETS "25 May 2000"
Module_FullVersion SETS "0.34"
END
/* (0.33)
/* (0.34)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 0.33
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 25 Aug 1999
#define Module_MajorVersion_CMHG 0.34
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 25 May 2000
#define Module_MajorVersion "0.33"
#define Module_Version 33
#define Module_MinorVersion ""
#define Module_Date "25 Aug 1999"
#define Module_MajorVersion "0.34"
#define Module_Version 34
#define Module_MinorVersion ""
#define Module_Date "25 May 2000"
#define Module_FullVersion "0.33"
#define Module_FullVersion "0.34"
......@@ -50,21 +50,15 @@ adfs_GetName
ADD r4,r1,#22
[ Version >= 4 ; Cope with unnamed discs
LDRB r14,[r4]
CMP r14,#" "
MOVLE r14,#":"
STRLEB r14,[r2],#1
MOVLE r4,r3
]
MOV r0,r2
[ Version >= 4
MOV r3,#10 ; Max length
BL copy_r0r4r3_space ; Copy name to buffer
|
BL copy_r0r4_null ; Copy name to buffer
]
MOV r0,#11 ; Name is 10 chars + terminator.
......
......@@ -34,18 +34,32 @@ MySWIBase * Module_SWISystemBase + FreeSWI * Module_SWIChunkSize
|
DCD 0
]
[ :LNOT: No32bitCode
DCD Free_Flags - Module_BaseAddr
]
; ----------------------------------------------------------------------------------------------------------------------
Title DCB "Free",0
Helpstr DCB "Free",9,9,"$Module_MajorVersion ($Module_Date)"
[ Module_MinorVersion <> ""
= " $Module_MinorVersion"
]
DCB 0
ALIGN
Title ;DCB "Free",0
Free_SWInames
DCB "Free",0 ; prefix
DCB "Register",0
DCB "DeRegister",0
DCB 0
ALIGN
Taskid DCB "TASK"
ALIGN
[ :LNOT: No32bitCode
Free_Flags DCD ModuleFlag_32bit
]
; ----------------------------------------------------------------------------------------------------------------------
; Handle *Desktop_Free - only enter modules if after a Service_StartWimp
Desktop_Free_Code
......@@ -321,7 +335,7 @@ Service
[ debugmsg
TEQNE r1, #Service_ResourceFSStarting
]
MOVNES pc, lr
MOVNE pc, lr
ServiceUrsula
......@@ -393,7 +407,7 @@ svc_reset Entry "r0-r3"
MOV r2,r12
SWI XOS_Claim
EXITS
EXIT
[ debugmsg
; ----------------------------------------------------------------------------------------------------------------------
......@@ -405,7 +419,7 @@ svc_resourcefsstarting Entry "r0"
MOV LR, PC ; LR -> return address
MOV PC, R2 ; R2 -> code to call (R3 = workspace ptr)
EXITS
EXIT
]
; ----------------------------------------------------------------------------------------------------------------------
......@@ -437,7 +451,7 @@ svc_memorymoved Entry "r0-r1"
B %BT01
02
EXITS
EXIT
; ----------------------------------------------------------------------------------------------------------------------
; RMKill'ing the module
......@@ -468,26 +482,20 @@ Die Entry "r7-r11"
TEQ r0, #0
SWINE XMessageTrans_CloseFile
[ Version < 10
; Release all workspace (dealt with by OS_Module)
MOV r2, r12
MOV r0, #ModHandReason_Free
SWI XOS_Module
]
[ debugmsg
; Deregister ResourceFS files
ADR r0, resourcefiles
SWI XResourceFS_DeregisterFiles
]
EXITS ; don't refuse to die
CLRV
EXIT ; don't refuse to die
; ----------------------------------------------------------------------------------------------------------------------
; On UpCall 3, mark all related windows as needing update.
UpCall_handler ROUT
TEQ r0, #UpCall_ModifyingFile
MOVNES pc, lr
MOVNE pc, lr
Push "LR"
......@@ -506,7 +514,7 @@ UpCall_handler ROUT
TEQNE r9, r14
TEQNE r9, #upfsargs_EnsureSize
Pull "PC",NE,^
Pull "PC",NE
; Reason code's right - save the registers and start looking..
Push "r0-r11"
......@@ -597,7 +605,7 @@ UpCall_handler ROUT
BNE %BT03
05
MOV sp, r10
Pull "r0-r11,PC",,^
Pull "r0-r11,PC"
; ----------------------------------------------------------------------------------------------------------------------
......
......@@ -157,14 +157,12 @@ NETFS_GetSpace
STR r0,[R14,#4]
[ Version >= 6 ; Free space cannot be more than disc size.
LDR r1,[r14]
LDR r2,[r14,#8] ; Used space
SUB r1,r1,r2 ; r1 = free disc space
CMP r0,r1 ; if greater
STRCS r1,[R14,#4] ; store disc size as free space.
CLRV
]
Pull "r1-r6,PC"
;-------------------------------------------------------------------
......
......@@ -48,21 +48,15 @@ PCCardFS_GetName
ADD r4,r1,#22
[ Version >= 4 ; Cope with unnamed discs
LDRB r14,[r4]
CMP r14,#" "
MOVLE r14,#":"
STRLEB r14,[r2],#1
MOVLE r4,r3
]
MOV r0,r2
[ Version >= 4
MOV r3,#10 ; Max length
BL copy_r0r4r3_space ; Copy name to buffer
|
BL copy_r0r4_null ; Copy name to buffer
]
MOV r0,#11 ; Name is 10 chars + terminator.
......
......@@ -47,12 +47,8 @@ RamFS_GetName
ADD r4,r1,#22
MOV r0,r2
[ Version >= 4
MOV r3,#10
BL copy_r0r4r3_space ; Copy name to buffer
|
BL copy_r0r4_null ; Copy name to buffer
]
MOV r0,#11 ; Name is 10 chars + terminator.
......
......@@ -50,21 +50,15 @@ SCSIFS_GetName
ADD r4,r1,#22
[ Version >= 4 ; Cope with unnamed discs
LDRB r14,[r4]
CMP r14,#" "
MOVLE r14,#":"
STRLEB r14,[r2],#1
MOVLE r4,r3
]
MOV r0,r2
[ Version >= 4
MOV r3,#10
BL copy_r0r4r3_space ; Copy name to buffer
|
BL copy_r0r4_null ; Copy name to buffer
]
MOV r0,#11 ; Name is 10 chars + terminator.
......
......@@ -15,41 +15,32 @@
; s.SWIS
Free_SWIdecode
Push "LR"
Push "R0-R2,R9,LR"
MVN R14,#I_bit
TSTP R14,PC ; re-enable interrupts
;
LDR r12,[R12] ; wsptr --> workspace
CMP R11,#maxnewswi
ADDCC R14,R11,#(swijptable-swijporg-4)/4 ; bodge factor
ADDCC PC,PC,R14,ASL #2 ; go!
swijporg
CMP R11,#1
BGT badswi
WritePSRc SVC_mode,R10,,R9 ; re-enable interrupts
BNE SWIFree_Register
BL RemoveEntry
swireturn
STRVS r0, [sp]
ORRVS r9, r9, #V_bit
RestPSR r9
Pull "R0-R2,R9,PC"
badswi
ADD sp, sp, #4
ADR R0,ErrorBlock_BadSWI
Push "R1"
ADRL R1, Title
BL LookupError
Pull "R1, PC"
swijptable
B SWIFree_Register
B SWIFree_DeRegister
endswijptable
maxnewswi * (endswijptable-swijptable)/4
Pull "R1-R2,R9,PC"
ErrorBlock_BadSWI
DCD 0
DCB "BadSWI", 0
ALIGN
Free_SWInames
DCB "Free",0 ; prefix
DCB "Register",0
DCB "DeRegister",0
DCB 0
ALIGN
;;Free_Register
;;In:
;; R0 = FS number
......@@ -62,23 +53,10 @@ Free_SWInames
SWIFree_Register ROUT
Push "r0-r2"
MOV r1,r0
LDR r0,[sp,#1*4]
LDR r0,[sp,#2*4]
BL AddEntry
STRVS r0,[sp]
Pull "r0-r2,PC"
SWIFree_DeRegister
Push "r0-r2"
BL RemoveEntry
STRVS r0,[SP]
Pull "r0-r2,PC"
B swireturn
LNK s.Tail
......
......@@ -36,11 +36,11 @@ ErrorNoWimp
CloseWimp
Push "r0,lr"
EntryS "r0"
LDR r0, mytaskhandle ; Get task handle
LDR r1, taskidentifier
SWI XWimp_CloseDown
Pull "r0,pc",,^
EXITS
; ----------------------------------------------------------------------------------------------------------------------
template_filename
......@@ -56,10 +56,8 @@ ADFSFree DCB "Alias$ADFS_Free"
FreeString DCB "ShowFree -FS ADFS %*0"
DCB 0
ALIGN
[ Version >= 5
MessagesList DCD Message_Quit
DCD 0
]
; ----------------------------------------------------------------------------------------------------------------------
; Start up the wimp task for Free
......@@ -77,7 +75,7 @@ Start
LDR r14, mytaskhandle ; abort if not responding to desktop starting stuff
CMP r14, #-1
SWINE XMessageTrans_ErrorLookup
SWINE OS_GenerateError
SWIVS OS_GenerateError
ADRL sp, stacktop ; STACK IS NOW VALID!
......@@ -86,20 +84,11 @@ Start
SWIVS OS_GenerateError
MOV r2,r0
[ Version >= 5
MOV r0,#300 ; We know about wimp 3.00 and have a messages list
|
LDR r3, =278 ; latest known Wimp version number
MOV r0, r3 ; latest known Wimp version number
]
LDR r0, =310 ; We know about wimp 3.10 and have a messages list
LDR r1, taskidentifier
[ Version >= 5
ADR r3, MessagesList
]
SWI XWimp_Initialise
[ Version >= 5
LDR r3, =278 ; Wimp version number that we want.
]
LDR r3, =310 ; Wimp version number that we want.
CMP r0,r3 ; needs Wimp with Wimp_PollWord, draggable iconbar icons
; and Iconize and close window messages.
BCC ErrorOldWimp
......@@ -140,19 +129,6 @@ Start
MOV r0,#0
STR r0,poll_word
[ Version < 9
; Set ASFS alias.
ADR R0, ADFSFree
ADR R1, FreeString
MOV R2, #?FreeString
MOV R3, #0
MOV R4, #VarType_String
SWI XOS_SetVarVal
]
; ----------------------------------------------------------------------------------------------------------------------
; Wimp polling routine
repollwimp
......@@ -212,7 +188,7 @@ open_window
; ----------------------------------------------------------------------------------------------------------------------
close_window_from_block
Push "r1-r5,LR"
EntryS "r1-r5"
ADR r1,dataarea
LDR r2,[r5,#window_handle]
......@@ -220,7 +196,7 @@ close_window_from_block
B int_close_window
close_window
Push "r1-r5,LR"
ALTENTRY
int_close_window
SWI Wimp_DeleteWindow ; 14 Jul 92 OSS Used to be Close
......@@ -228,7 +204,7 @@ int_close_window
01
LDR r0,[r0,#next_ptr]
CMP r0,#0
Pull "r1-r5,PC",EQ
EXIT EQ
LDR r2,[r0,#window_handle]
LDR r14,[r1]
......@@ -248,18 +224,18 @@ int_close_window
LDR r2,[r0,#window_discname]
MOV r0,#7
SWI XOS_Module
Pull "r1-r5,PC",VS
EXIT VS
Debug xx,"Freed space"
MOV r0,#7
MOV r2,r5
SWI XOS_Module
Pull "r1-r5,PC",VS
EXIT
Debug xx,"Freed block."
Pull "r1-r5,PC",,^
EXITS
; ----------------------------------------------------------------------------------------------------------------------
; This is called when the poll word is non-zero, it scans the window list to find out which windows
......@@ -433,17 +409,6 @@ just_update ; Window has changed, update it.
LDR r3,[r5,#window_device]
BL CallEntry
; fix bug MED-04392. Instead of treating an error from this as fatal, we ignore
; it and try the 32-bit version of the call instead. That way those clients who
; return an error from unknown reason codes will still work, and real errors will
; just have to be returned twice to be believed
; Push "r0",VS
; BLVS close_window_from_block
; Pull "r0",VS
; Pull "PC",VS
; if there was an error, R0 will NOT be zero.
CMP r0,#0 ; if successful R0 zeroed as well as filling in the block
......@@ -453,8 +418,7 @@ just_update ; Window has changed, update it.
BL CallEntry ; [r2] = Size, Free , Used
Push "r0",VS
BLVS close_window_from_block
Pull "r0",VS
Pull "PC",VS
Pull "r0,PC",VS
;move the data returned into the new layout
......
......@@ -103,7 +103,6 @@ free_list
B %BT01
; ----------------------------------------------------------------------------------------------------------------------
[ Version >= 4
copy_r0r4r3_space
......@@ -116,14 +115,11 @@ copy_r0r4r3_space
SUBS r3 , r3,#1
CMPNE r14, #0
BNE %BT01
[ Version >= 6
CMP r3,#0
STREQB r3,[r0],#1
]
SUB r0, r0, #1
Pull "r3,r4,PC"
]
; ----------------------------------------------------------------------------------------------------------------------
......
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