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

32-bit compatibility added.

  Removed obsolete header files.
  Removed obsolete assembler.
  Fixed flag preservation in remaining assembler.
Detail:
  See above.
Admin:
  Built RAM build.

Version 2.09. Tagged as 'LanManFS-2_09'
parent 3718f3fa
hdr/** gitlab-language=armasm linguist-language=armasm linguist-detectable=true
s/** gitlab-language=armasm linguist-language=armasm linguist-detectable=true
c/** gitlab-language=c linguist-language=c linguist-detectable=true
h/** gitlab-language=c linguist-language=c linguist-detectable=true
......
......@@ -40,6 +40,7 @@ RM = remove
MODSQZ = modsqz
WIPE = -wipe
CD = dir
RESGEN = resgen
CPFLAGS = ~cfr~v
......@@ -64,27 +65,28 @@ INETLIB = TCPIPLibs:o.inetlibzm
SOCKLIB = TCPIPLibs:o.socklibzm
UNIXLIB = TCPIPLibs:o.unixlibzm
DEBUGLIB = C:DebugLib.o.DebugLibZM
ASMUTILS = C:AsmUtils.o.AsmUtilsZM
OBJS = LanMan.o Omni.o Logon.o CoreFn.o Printers.o NameCache.o \
Xlate.o Interface.o RMInfo.o buflib.o Transact.o \
Xlate.o Interface.o buflib.o Transact.o \
LLC.o NetBIOS.o SMB.o Errors.o Attr.o RPC.o NBIP.o Stats.o LanMan_MH.o
ROM_OBJS = or.LanMan or.Omni or.Logon or.CoreFn or.Printers or.NameCache \
or.Xlate or.buflib Interface.o RMInfo.o Errors.o or.Transact \
or.Xlate or.buflib Interface.o Errors.o or.Transact \
or.LLC or.NetBIOS or.SMB or.Attr or.RPC or.NBIP or.Stats LanMan_MH.o
#DBG_OBJS = od.LanMan od.Omni od.Logon od.CoreFn od.Printers od.NameCache \
# od.Xlate od.buflib Interface.o RMInfo.o Errors.o o.Transact \
# od.Xlate od.buflib Interface.o Errors.o o.Transact \
# od.LLC od.NetBIOS od.SMB od.Attr od.RPC od.NBIP od.Stats LanMan_MH.o
#DBG_OBJS = od.LanMan od.Omni od.Logon od.CoreFn od.Printers od.NameCache \
# od.Xlate od.buflib Interface.o RMInfo.o Errors.o od.Transact \
# od.Xlate od.buflib Interface.o Errors.o od.Transact \
# o.LLC o.NetBIOS od.SMB o.Attr od.RPC od.NBIP od.Stats LanMan_MH.o
DBG_OBJS = od.LanMan o.Omni o.Logon o.CoreFn o.Printers o.NameCache \
o.Xlate o.buflib Interface.o RMInfo.o Errors.o o.Transact \
o.Xlate o.buflib Interface.o Errors.o o.Transact \
o.LLC o.NetBIOS od.SMB o.Attr o.RPC o.NBIP o.Stats LanMan_MH.o
......@@ -93,7 +95,7 @@ OBJSI = i.LanMan i.Omni i.Logon i.CoreFn i.Printers i.NameCache \
i.LLC i.NetBIOS i.SMB i.Attr i.RPC i.NBIP i.Stats
OBJSINST = LanMan_MH.o inst.LanMan inst.Omni inst.Logon inst.CoreFn inst.Printers \
inst.Xlate inst.buflib Interface.o RMInfo.o Errors.o inst.Transact\
inst.Xlate inst.buflib Interface.o Errors.o inst.Transact\
inst.NameCache\
inst.LLC inst.NetBIOS inst.SMB inst.Attr inst.RPC inst.NBIP inst.Stats
......@@ -131,6 +133,11 @@ dirs:
rom: ${ROM_MODULE}
@echo ${COMPONENT}: rom module built
resources:
${MKDIR} ${RESDIR}.${COMPONENT}
${CP} Sprites ${RESDIR}.${COMPONENT}.Sprites ${CPFLAGS}
@echo ${COMPONENT}: resource files copied
preprocess: ${OBJSI} i.dirs
@echo ${COMPONENT}: preprocess build complete
......@@ -175,13 +182,13 @@ clean:
#
${RAM_MODULE}: ${OBJS} o.dirs
${MKDIR} rm
${LD} -o $@ -rmf ${OBJS} ${UNIXLIB} ${INETLIB} ${SOCKLIB} ${CLIB}
${LD} -o $@ -rmf ${OBJS} ${UNIXLIB} ${INETLIB} ${SOCKLIB} ${CLIB} ${ASMUTILS}
${MODSQZ} $@
Access $@ RW/R
${DBG_MODULE}: ${DBG_OBJS} o.dirs
${MKDIR} rm
${LD} -o $@ -rmf ${DBG_OBJS} ${UNIXLIB} ${INETLIB} ${SOCKLIB} ${DEBUGLIB} ${CLIB}
${LD} -o $@ -rmf ${DBG_OBJS} ${UNIXLIB} ${INETLIB} ${SOCKLIB} ${DEBUGLIB} ${CLIB} ${ASMUTILS}
${MODSQZ} $@
#
......@@ -189,7 +196,7 @@ ${DBG_MODULE}: ${DBG_OBJS} o.dirs
#
${ROM_MODULE}: ${ROM_OBJS} ${UNIXLIB} ${INETLIB} ${SOCKLIB} o.dirs
${MKDIR} aof
${LD} -o $@ -aof ${ROM_OBJS} ${ROMCSTUBS} ${UNIXLIB} ${INETLIB} ${SOCKLIB}
${LD} -o $@ -aof ${ROM_OBJS} ${ROMCSTUBS} ${UNIXLIB} ${INETLIB} ${SOCKLIB} ${ASMUTILS}
#
# Final link for the ROM Image (using given base address)
......
/* (2.08)
/* (2.09)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 2.08
#define Module_MajorVersion_CMHG 2.09
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 09 Nov 1999
#define Module_Date_CMHG 29 Nov 1999
#define Module_MajorVersion "2.08"
#define Module_Version 208
#define Module_MajorVersion "2.09"
#define Module_Version 209
#define Module_MinorVersion ""
#define Module_Date "09 Nov 1999"
#define Module_Date "29 Nov 1999"
#define Module_FullVersion "2.08"
#define Module_FullVersion "2.09"
; Copyright 1998 Acorn Computers Ltd
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
;
; > h.RegNames
;
; Description Register name file
; Author IH
;
; *** Use the RN directive to define ARM register names
R0 RN 0
R1 RN 1
R2 RN 2
R3 RN 3
R4 RN 4
R5 RN 5
R6 RN 6
R7 RN 7
R8 RN 8
R9 RN 9
R10 RN 10
R11 RN 11
R12 RN 12
R13 RN 13
R14 RN 14
R15 RN 15
a1 RN 0
a2 RN 1
a3 RN 2
a4 RN 3
v1 RN 4
v2 RN 5
v3 RN 6
v4 RN 7
v5 RN 8
v6 RN 9
A1 RN 0
A2 RN 1
A3 RN 2
A4 RN 3
V1 RN 4
V2 RN 5
V3 RN 6
V4 RN 7
V5 RN 8
V6 RN 9
R13_usr RN 13
R14_usr RN 14
R10_fiq RN 10
R11_fiq RN 11
R12_fiq RN 12
R13_fiq RN 13
R14_fiq RN 14
R13_irq RN 13
R14_irq RN 14
R13_svc RN 13
R14_svc RN 14
r0 RN 0
r1 RN 1
r2 RN 2
r3 RN 3
r4 RN 4
r5 RN 5
r6 RN 6
r7 RN 7
r8 RN 8
r9 RN 9
r10 RN 10
r11 RN 11
r12 RN 12
r13 RN 13
r14 RN 14
r15 RN 15
sl RN 10
SL RN 10
fp RN 11
FP RN 11
work RN 12
ip RN 12
IP RN 12
sp RN 13
SP RN 13
sp_irq RN R13_irq
sp_svc RN R13_svc
link RN 14
LINK RN 14
lr RN 14
LR RN 14
link_usr RN R14_usr
link_fiq RN R14_fiq
link_irq RN R14_irq
link_svc RN R14_svc
pc RN 15
PC RN 15
; *** Define PC register & mode flags
N_bit * 1 :SHL: 31
Z_bit * 1 :SHL: 30
C_bit * 1 :SHL: 29
V_bit * 1 :SHL: 28
I_bit * 1 :SHL: 27
F_bit * 1 :SHL: 26
USR_mode * 0
FIQ_mode * 1
IRQ_mode * 2
SVC_mode * 3
; *** Use the FN directive to define floating point register names
F0 FN 0
F1 FN 1
F2 FN 2
F3 FN 3
F4 FN 4
F5 FN 5
F6 FN 6
F7 FN 7
END
; Copyright 1998 Acorn Computers Ltd
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
;
; > &.Hdr.ResourceFS
;
SWIClass SETS "ResourceFS"
^ &41B40
AddSWI RegisterFiles ; &41B40
AddSWI DeregisterFiles ; &41B41
MACRO
$Start ResourceFile $InFile, $OutFile
$Start DCD %FT60 - . ; Offset from here to the next file
DCD :FLOAD:"$InFile" ; Load address of file
DCD :FEXEC:"$InFile" ; Exec address of file
DCD :FSIZE:"$InFile" ; The length of the file
DCD 3 ; Access bits (always WR/)
DCB "$OutFile",0 ; The ResourceFS filename
ALIGN
DCD %FT40-%FT20+4 ; The file length plus four
20
BIN $InFile ; The file itself
40
ALIGN
60
MEND
END
; Copyright 1998 Acorn Computers Ltd
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
;
; > hdr.SwiNames
;
; Description AAsm header file for defining OS SWI call names
; Author Nick Smith
; Version 1.00
; Date 21st November 1991
; Program Public Domain
;
;
; SWI names are exported in two forms :
; 1) with OS_ 'OS_DoThingToOtherThing' as N
; 2) with XOS_ 'XOS_DoThingToOtherThing' as N + Auto_Error_SWI_bit
;
Auto_Error_SWI_bit_number * 17
Auto_Error_SWI_bit * 1 :SHL: Auto_Error_SWI_bit_number
;
; The following macro defines the SWI names using the '*' directive and the
; '#' directive to increment the SWI number
;
GBLS SWIClass
MACRO
AddSWI $SWIName,$value
[ "$value" = ""
$SWIClass._$SWIName # 1
|
$SWIClass._$SWIName * $value
]
X$SWIClass._$SWIName * $SWIClass._$SWIName + Auto_Error_SWI_bit
MEND
;
; Now for the SWI name table - using the '^' directive to build a table
; of SWI numbers
;
SWIClass SETS "OS"
^ 0 ; Base for RISC OS SWIs
AddSWI WriteC ; &00
AddSWI WriteS ; &01
AddSWI Write0 ; &02
AddSWI NewLine ; &03
AddSWI ReadC ; &04
AddSWI CLI ; &05
AddSWI Byte ; &06
AddSWI Word ; &07
AddSWI File ; &08
AddSWI Args ; &09
AddSWI BGet ; &0A
AddSWI BPut ; &0B
AddSWI GBPB ; &0C
AddSWI Find ; &0D
AddSWI ReadLine ; &0E
AddSWI Control ; &0F
AddSWI GetEnv ; &10
AddSWI Exit ; &11
AddSWI SetEnv ; &12
AddSWI IntOn ; &13
AddSWI IntOff ; &14
AddSWI CallBack ; &15
AddSWI EnterOS ; &16
AddSWI BreakPt ; &17
AddSWI BreakCtrl ; &18
AddSWI UnusedSWI ; &19
AddSWI UpdateMEMC ; &1A
AddSWI SetCallBack ; &1B
AddSWI Mouse ; &1C
AddSWI Heap ; &1D
AddSWI Module ; &1E
AddSWI Claim ; &1F
AddSWI Release ; &20
AddSWI ReadUnsigned ; &21
AddSWI GenerateEvent ; &22
AddSWI ReadVarVal ; &23
AddSWI SetVarVal ; &24
AddSWI GSInit ; &25
AddSWI GSRead ; &26
AddSWI GSTrans ; &27
AddSWI BinaryToDecimal ; &28
AddSWI FSControl ; &29
AddSWI ChangeDynamicArea ; &2A
AddSWI GenerateError ; &2B
AddSWI ReadEscapeState ; &2C
AddSWI EvaluateExpression ; &2D
AddSWI SpriteOp ; &2E
AddSWI ReadPalette ; &2F
AddSWI ServiceCall ; &30
AddSWI ReadVduVariables ; &31
AddSWI ReadPoint ; &32
AddSWI UpCall ; &33
AddSWI CallAVector ; &34
AddSWI ReadModeVariable ; &35
AddSWI RemoveCursors ; &36
AddSWI RestoreCursors ; &37
AddSWI SWINumberToString ; &38
AddSWI SWINumberFromString ; &39
AddSWI ValidateAddress ; &3A
AddSWI CallAfter ; &3B
AddSWI CallEvery ; &3C
AddSWI RemoveTickerEvent ; &3D
AddSWI InstallKeyHandler ; &3E
AddSWI CheckModeValid ; &3F
AddSWI ChangeEnvironment ; &40
AddSWI ClaimScreenMemory ; &41
AddSWI ReadMonotonicTime ; &42
AddSWI SubstituteArgs ; &43
AddSWI PrettyPrint ; &44
AddSWI Plot ; &45
AddSWI WriteN ; &46
AddSWI AddToVector ; &47
AddSWI WriteEnv ; &48
AddSWI ReadArgs ; &49
AddSWI ReadRAMFsLimits ; &4A
AddSWI ClaimDeviceVector ; &4B
AddSWI ReleaseDeviceVector ; &4C
AddSWI DelinkApplication ; &4D
AddSWI RelinkApplication ; &4E
AddSWI HeapSort ; &4F
AddSWI ExitAndDie ; &50
AddSWI ReadMemMapInfo ; &51
AddSWI ReadMemMapEntries ; &52
AddSWI SetMemMapEntries ; &53
AddSWI AddCallBack ; &54
AddSWI ReadDefaultHandler ; &55
AddSWI SetECFOrigin ; &56
AddSWI SerialOp ; &57
AddSWI ReadSysInfo ; &58
AddSWI Confirm ; &59
AddSWI ChangedBox ; &5A
AddSWI CRC ; &5B
AddSWI ReadDynamicArea ; &5C
AddSWI PrintChar ; &5D
AddSWI ChangeRedirection ; &5E
AddSWI RemoveCallBack ; &5F
AddSWI FindMemMapEntries ; &60
AddSWI ReadDefaultVector ; &61
^ &C0
AddSWI ConvertStandardDateAndTime ; &C0
AddSWI ConvertDateAndTime ; &C1
^ &D0
AddSWI ConvertHex1 ; &D0
AddSWI ConvertHex2 ; &D1
AddSWI ConvertHex4 ; &D2
AddSWI ConvertHex6 ; &D3
AddSWI ConvertHex8 ; &D4
AddSWI ConvertCardinal1 ; &D5
AddSWI ConvertCardinal2 ; &D6
AddSWI ConvertCardinal3 ; &D7
AddSWI ConvertCardinal4 ; &D8
AddSWI ConvertInteger1 ; &D9
AddSWI ConvertInteger2 ; &DA
AddSWI ConvertInteger3 ; &DB
AddSWI ConvertInteger4 ; &DC
AddSWI ConvertBinary1 ; &DD
AddSWI ConvertBinary2 ; &DE
AddSWI ConvertBinary3 ; &DF
AddSWI ConvertBinary4 ; &E0
AddSWI ConvertSpacedCardinal1 ; &E1
AddSWI ConvertSpacedCardinal2 ; &E2
AddSWI ConvertSpacedCardinal3 ; &E3
AddSWI ConvertSpacedCardinal4 ; &E4
AddSWI ConvertSpacedInteger1 ; &E5
AddSWI ConvertSpacedInteger2 ; &E6
AddSWI ConvertSpacedInteger3 ; &E7
AddSWI ConvertSpacedInteger4 ; &E8
AddSWI ConvertFixedNetStation ; &E9
AddSWI ConvertNetStation ; &EA
AddSWI ConvertFixedFileSize ; &EB
AddSWI ConvertFileSize ; &EC
AddSWI WriteI, &100
END
......@@ -24,9 +24,12 @@
; 26-01-96 Add CollectCallbacks
; **************************************************
GET Hdr.RegNames
GET Hdr.SwiNames
GET Hdr.ResourceFS
GET Hdr:ListOpts
GET Hdr:Macros
GET Hdr:System
GET Hdr:Machine.<Machine>
GET Hdr:APCS.<APCS>
GET Hdr:ResourceFS
; ---------------------------
......@@ -134,15 +137,24 @@ fsentry_common ; os_error *fsentry_common( Parameter_Block * )
MOVNE r0, R8
; Mess about with the flag bits in R8
[ :LNOT: No32bitCode
; If we're allowed to use 32-bit code, it all falls out really nicely
MOVNE R8, #V_bit ; R8 == 0 if Z, V set if !Z
|
MOV R8, pc
BIC R8, R8, #C_bit + V_bit
ORRNE R8, R8, #V_bit ; V = err != 0
]
TST r1, r1 ; C = r1 == 0
ORREQ R8, R8, #C_bit
; Move the flag bits into psr
[ :LNOT: No32bitCode
MSR CPSR_f, r8
|
TEQP R8, #0
MOV R0,R0 ; added 980127:RCE
NOP
]
LDMFD SP!, {R8}
......@@ -170,11 +182,11 @@ fsentry_branchtable
EXPORT OmniS_Suicide
OmniS_Suicide ; (char *modulename)
STMFD SP!, {r14}
FunctionEntry
MOV r1, r0 ; save module_title address (called as r12)
ADR r0, suicide_cb
SWI XOS_AddCallBack
LDMFD SP!, {pc}
Return
suicide_cb
STMFD SP!, {r0-r1, r14}
......@@ -192,51 +204,31 @@ suicide_cb
; in the Z bit. For this reason the routine calls our 'FreeOp'
; SWI.
; Free module only worried about V and Z, doesn't mind C and N being
; corrupted. Removed all the unnecessary flag todging and non-32-bit
; friendly code: V is already set correctly, the TEQ sets the Z as
; required. Yes, the return value is already stacked. (sbrodie: 19/11/99)
EXPORT Free_ServiceRoutine
Free_ServiceRoutine ; On entry R0 = reason code 0-3
STMFD SP!, {R1, R4}
SWI XLanMan_FreeOp
MOV R4, PC
BIC R4, R4, #V_bit + C_bit + Z_bit
ORRVS R4, R4, #V_bit ; V set & R0->error block if error
CMP R1, #0 ; Set Z if R1 was 0 on exit
ORREQ R4, R4, #Z_bit
TEQP R4, #0 ; Set flags to PC
MOV R0,R0 ; added 980127:RCE
LDMFD SP!, {R1, R4}
LDMIA R13!, {PC} ; As it says in book
TEQ R1,#0 ; set Z if R1 was 0 on exit, preserve V
LDMFD SP!, {R1, R4, PC} ; As it says in book
DCB "Nothing libellous or obscene", 0 ; Contractual obligation
ALIGN
; Collect callbacks routine ------------------------------
EXPORT CollectCallbacks ; (void)
CollectCallbacks
STMFD SP!, {LR}
TSTP PC,#&FC ;Set User mode.
MOV R0, R0
MOV R0,#0
MOV R1,#1
SWI OS_Byte ; Does callbacks on exit
SWI OS_EnterOS ;Set SVC mode.
MOV R0, R0
LDMFD SP!, {PC}^
; Long multiplier ----------------------------------------
; Taken from Acorn Assembler manual.
; extern void OmniS_FastMultiply64(fspc_64 *, unsigned, unsigned);
EXPORT OmniS_FastMultiply64
OmniS_FastMultiply64
FunctionEntry
STMFD sp!, {lr}
MOVS lr, a2, LSR #16
BIC a2, a2, lr, LSL #16
......@@ -251,7 +243,7 @@ OmniS_FastMultiply64
ADDS a4, a4, a2, LSL #16
ADC lr, lr, a2, LSR #16
STMIA a1, {a4, lr}
LDMFD sp!, {pc}^
Return
......@@ -266,28 +258,28 @@ OmniS_FastMultiply64
; Register & Deregister routines for our ResourceFS block
OmniS_ResourceInit ; (void)
STMFD sp!, {r14}
FunctionEntry
ADR r0, Resource_Base
SWI XResourceFS_RegisterFiles
MOVVC r0, #0
LDMFD sp!, {pc}
Return
OmniS_ResourceShutdown ; (void)
STMFD sp!, {r14}
FunctionEntry
ADR r0, Resource_Base
SWI XResourceFS_DeregisterFiles
MOVVC r0, #0
LDMFD sp!, {pc}
Return
OmniS_ResFSStarting ; (int R2, int R3 )
; Dunno what this does!!
STMFD sp!, {r14}
FunctionEntry
MOV r2, r0
MOV r3, r1
ADR r0, Resource_Base
MOV r14, pc
MOV pc, r2
LDMFD sp!, {pc}^
Return
; Data block<