Commit 95372462 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Makefile recreated from fragments

Fixed up a couple of trivial warnings with the stricter checking.
Removed OmniS_FastMultiply64 and rewrote the function in C, this allows the compiler to spot and use UMULL on architectures supporting that instruction.
Tested in a RAM build against a WinXP SP3 server with a drive > 4GB.

Version 2.39. Tagged as 'LanManFS-2_39'
parent 18a0315a
......@@ -13,5 +13,4 @@
| limitations under the License.
|
Dir <Obey$Dir>
wimpslot 4000k
amu_machine rm.LanManFSD OPTIONS=-DCHECK_ARMBOOT_EXISTS ROMSPRITES=FALSE
amu_machine debug OPTIONS=-DCHECK_ARMBOOT_EXISTS ROMSPRITES=FALSE
| 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.
|
Dir <Obey$Dir>
wimpslot 8192k
rename i.instlib/c i.instlib
amu_machine instrument THROWBACK=-throwback ROMSPRITES=FALSE
| 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.
|
Dir <Obey$Dir>
wimpslot 8192k
amu_machine preprocess THROWBACK=-throwback ROMSPRITES=FALSE
......@@ -13,5 +13,4 @@
| limitations under the License.
|
Dir <Obey$Dir>
wimpslot 4000k
amu_machine all OPTIONS=-DCHECK_ARMBOOT_EXISTS ROMSPRITES=FALSE
amu_machine standalone OPTIONS=-DCHECK_ARMBOOT_EXISTS THROWBACK=-throwback ROMSPRITES=FALSE
| Copyright 2000 Pace Micro Technology plc
|
| 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.
|
Dir <Obey$Dir>
wimpslot 4000k
amu_machine all OPTIONS="-DNO_NETBEUI -DCHECK_ARMBOOT_EXISTS" ROMSPRITES=TRUE
......@@ -13,5 +13,4 @@
| limitations under the License.
|
Dir <Obey$Dir>
wimpslot 5000k
amu_machine rom ROMSPRITES=TRUE
......@@ -14,161 +14,25 @@
#
# Makefile for LanManFS
#
# Paths
#
EXP_HDR = <export$dir>
#
# Component specific options:
#
COMPONENT = LanManFS
TARGET = LanManFS
ROM_MODULE = aof.${TARGET}
RAM_MODULE = rm.${TARGET}
DBG_MODULE = rm.${TARGET}D
#
# Generic options:
#
include StdTools
DFLAGS = -DCOMPAT_INET4 -DLONGNAMES ${OPTIONS}
AFLAGS = -depend !Depend ${THROWBACK} -Stamp -quit -predefine "ROMSPRITES SETL {${ROMSPRITES}}"
CFLAGS = -depend !Depend ${THROWBACK} -c -Wpcs -ff -zps1 -zM ${INCLUDES},. ${DFLAGS}
CMHGFLAGS = -depend !Depend ${THROWBACK} -p ${OPTIONS}
INCLUDES = -ITCPIPLibs:,C:
#
# Libraries
#
include ModuleLibs
MAINOBJS = LanMan.o Omni.o Logon.o CoreFn.o Printers.o NameCache.o \
Xlate.o buflib.o Transact.o \
LLC.o NetBIOS.o SMB.o Attr.o RPC.o NBIP.o Stats.o
NONCOBJS = LanMan_MH.o Errors.o Interface.o
OBJS = ${MAINOBJS} ${NONCOBJS}
ROM_OBJS = ${NONCOBJS} ${MAINOBJS:%.o=or.%}
DBG_OBJS = ${NONCOBJS} ${MAINOBJS:%.o=od.%}
OBJSI = ${NONCOBJS} ${MAINOBJS:%.o=i.%}
OBJSINST = ${NONCOBJS} ${MAINOBJS:%.o=inst.%}
LanMan_MH.h: LanMan_MH.o
${CMHG} ${CMHGFLAGS} cmhg.$* -d $@
#
# Rule patterns
#
.SUFFIXES: .o .od .or .s .c .i .h .cmhg .inst
.c.o:; ${CC} ${CFLAGS} -o $@ $<
.c.or:; ${CC} ${CFLAGS} -DROM -o $@ $<
.c.od:; ${CC} ${CFLAGS} -DDEBUG -DDEBUGLIB -DTRACE -Dprintf=module_printf -o $@ $<
.c.i:; $(CC) $(CFLAGS) -c -C -E $< >> $@
.i.inst:; $(CC) $(CFLAGS) -C++ -o $@ $<
.cmhg.o:; ${CMHG} ${CMHGFLAGS} -o $@ $< -d $*.h
.cmhg.h:; ${CMHG} ${CMHGFLAGS} -o $@ -d $<
.s.o:; ${AS} ${AFLAGS} $< $@
#
# Build target
#
all: ${RAM_MODULE}
@echo ${COMPONENT}: all complete
install: ${RAM_MODULE} dirs
${CP} ${RAM_MODULE} ${INSTDIR}.${COMPONENT} ${CPFLAGS}
@echo ${COMPONENT}: all complete
dirs:
${MKDIR} ${INSTDIR}
o.LanMan o.LLC o.Logon o.NBIP o.Omni: LanMan_MH.h
or.LanMan or.LLC or.Logon or.NBIP or.Omni: LanMan_MH.h
od.LanMan od.LLC od.Logon od.NBIP od.Omni: LanMan_MH.h
i.LanMan i.LLC i.Logon i.NBIP i.Omni: LanMan_MH.h
#
# RISC OS ROM build rules:
#
rom: ${ROM_MODULE}
@echo ${COMPONENT}: rom module built
resources:
@echo ${COMPONENT}: no resource files to copy
preprocess: ${OBJSI} i.dirs
@echo ${COMPONENT}: preprocess build complete
instrument: ${OBJSINST} inst.instlib i.dirs o.dirs
$(LD) -rmf -o $@ $(OBJSINST) inst.instlib $(STUBS)
${MODSQZ} $@
@echo ${COMPONENT}: instrument build complete
o.dirs:
${MKDIR} o
${MKDIR} od
${MKDIR} or
create o.dirs
i.dirs:
${MKDIR} i
${MKDIR} inst
export:
@echo ${COMPONENT}: export complete
install_rom: ${ROM_MODULE}
${CP} ${ROM_MODULE} ${INSTDIR}.${COMPONENT} ${CPFLAGS}
@echo ${COMPONENT}: rom module installed
clean:
${WIPE} o ${WFLAGS}
${WIPE} od ${WFLAGS}
${WIPE} or ${WFLAGS}
${WIPE} i ${WFLAGS}
${WIPE} inst ${WFLAGS}
${WIPE} map ${WFLAGS}
${WIPE} linked ${WFLAGS}
${WIPE} aof ${WFLAGS}
${WIPE} rm ${WFLAGS}
${RM} h.LanMan_MH
${RM} NameCache
@echo ${COMPONENT}: cleaned
#
# Target
#
${RAM_MODULE}: ${OBJS} o.dirs
${MKDIR} rm
${LD} -o $@ -rmf ${OBJS} ${NET4LIBS} ${CLIB} ${ASMUTILS}
${MODSQZ} $@
Access $@ RW/R
${DBG_MODULE}: ${DBG_OBJS} o.dirs
${MKDIR} rm
${LD} -o $@ -rmf ${DBG_OBJS} ${DEBUGLIB} ${NET4LIBS} ${CLIB} ${ASMUTILS}
${MODSQZ} $@
#
# ROM Target
#
${ROM_MODULE}: ${ROM_OBJS} ${NET4LIBS} o.dirs
${MKDIR} aof
${LD} -o $@ -aof ${ROM_OBJS} ${ROMCSTUBS} ${NET4LIBS} ${ASMUTILS}
#
# Final link for the ROM Image (using given base address)
#
rom_link:
${MKDIR} linked
${LD} -o linked.${COMPONENT} -rmf -base ${ADDRESS} ${ROM_MODULE} ${ABSSYM}
${CP} linked.${COMPONENT} ${LINKDIR}.${COMPONENT} ${CPFLAGS}
@echo ${COMPONENT}: rom_link complete
COMPONENT = LanManFS
OBJS = Xlate Transact Stats SMB RPC Printers Omni NetBIOS NBIP \
NameCache Logon LLC LanMan CoreFn buflib Attr \
Errors Interface
CINCLUDES = -ITCPIPLibs:,C:
HDRS =
CMHGFILE = Lanman_MH
CMHGDEPENDS = LanMan LLC Logon NBIP Omni
LIBS = ${NET4LIBS} ${ASMUTILS}
RES_OBJ =
CUSTOMRES = custom
CDEFINES = -DCOMPAT_INET4 -DLONGNAMES ${OPTIONS}
CFLAGS = -Wp
CDFLAGS = -DDEBUG -DDEBUGLIB -DTRACE -Dprintf=module_printf
ASFLAGS = -pd "ROMSPRITES SETL {${ROMSPRITES}}"
ROMCDEFINES = -DROM
CMHGDEFINES = ${OPTIONS}
include CModule
# Dynamic dependencies:
/* (2.38)
/* (2.39)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 2.38
#define Module_MajorVersion_CMHG 2.39
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 11 Nov 2012
#define Module_Date_CMHG 30 Sep 2013
#define Module_MajorVersion "2.38"
#define Module_Version 238
#define Module_MajorVersion "2.39"
#define Module_Version 239
#define Module_MinorVersion ""
#define Module_Date "11 Nov 2012"
#define Module_Date "30 Sep 2013"
#define Module_ApplicationDate "11-Nov-12"
#define Module_ApplicationDate "30-Sep-13"
#define Module_ComponentName "LanManFS"
#define Module_ComponentPath "castle/RiscOS/Sources/Networking/Omni/Protocols/LanManFS"
#define Module_FullVersion "2.38"
#define Module_HelpVersion "2.38 (11 Nov 2012)"
#define Module_LibraryVersionInfo "2:38"
#define Module_FullVersion "2.39"
#define Module_HelpVersion "2.39 (30 Sep 2013)"
#define Module_LibraryVersionInfo "2:39"
......@@ -282,49 +282,6 @@ static err_t Func_ReadDir ( int reason, char *path_name, char *buffer,
return res;
}
#if 0 /* Never called */
static err_t Func_ReadFreeSpace ( int sixtyfourbit, char *name, int *R )
{
_kernel_swi_regs r;
_kernel_oserror *err;
if (sixtyfourbit)
{
fspc_64 dsr[3];
r.r[0] = 4;
r.r[2] = (int) &dsr;
r.r[3] = (int) name;
err = Omni_FreeOp_SWI(&r);
if (err != NULL)
return ENOTPRESENT;
R[0] = dsr[1].lo;
R[1] = dsr[1].hi;
R[2] = 0x7FFFFFFF;
R[3] = dsr[0].lo;
R[4] = dsr[0].hi;
}
else
{
struct disk_size_response dsr;
r.r[0] = 2;
r.r[2] = (int) &dsr;
r.r[3] = (int) name;
err = Omni_FreeOp_SWI(&r);
if (err != NULL)
return ENOTPRESENT;
R[0] = dsr.freeblks;
R[1] = 0x7FFFFFFF;
R[2] = dsr.totalblks;
}
return OK;
}
#endif
/* Func ============================================================= */
_kernel_oserror *fsentry_func ( int *R )
......
......@@ -206,16 +206,14 @@ static void LM_Undeclare ( void )
static void LM_GracefulClosedown(void)
{
/*if (LM_Vars.initialised == LMInitState_FullyInited)*/ {
stopcallbacks();
SMB_Shutdown(); /* Dismounts all SMB mounts first as */
Omni_Shutdown(); /* Omni_Shutdown zeros the Mounts lists */
OmniS_ResourceShutdown();
Prn_Shutdown(); /* Free print jobs */
NB_Shutdown(); /* Also calls LLC_Shutdown */
Buf_Shutdown(); /* Tell MBufManager we're done */
LM_Vars.initialised = LMInitState_PreInit;
}
stopcallbacks();
SMB_Shutdown(); /* Dismounts all SMB mounts first as */
Omni_Shutdown(); /* Omni_Shutdown zeros the Mounts lists */
OmniS_ResourceShutdown();
Prn_Shutdown(); /* Free print jobs */
NB_Shutdown(); /* Also calls LLC_Shutdown */
Buf_Shutdown(); /* Tell MBufManager we're done */
LM_Vars.initialised = LMInitState_PreInit;
}
_kernel_oserror * LM_Finalise (int fatal, int podule, void *pw)
......@@ -371,10 +369,6 @@ static _kernel_oserror *Cmd_Free ( const char *args )
}
}
#ifdef TRACE
module_printf(NULL);
#endif
return e;
}
......
......@@ -1225,7 +1225,7 @@ static void RemoveCallbacks(void)
/* -------------------------------- */
int NBIP_CallbackFn_handler(void)
static int NBIP_CallbackFn_handler(void)
{
fd_set read_set;
struct timeval tv;
......
......@@ -581,23 +581,23 @@ static err_t Omni_FreeSpace ( int mount_id,
/* Omni_FreeSpace64() ------------------------------*/
/* Does XXXX_OmniOp 4 */
static err_t Omni_FreeSpace64 ( int mount_id, int *success,
fspc_64 *freespace_out, fspc_64 *usedspace_out, fspc_64 *totspace_out )
QWORD *freespace_out, QWORD *usedspace_out, QWORD *totspace_out )
{
struct disk_size_response DSR;
err_t res;
uint used;
res = Omni_DetermineFreeSpace ( mount_id, &DSR );
if ( res != OK )
return res;
/* OmniS_FastMultiply64 does a 32x32 bit multiply and stores the 64-bit
* result in the supplied pointer (1st param)
*/
OmniS_FastMultiply64(freespace_out, DSR.freeblks, DSR.blksize);
OmniS_FastMultiply64(totspace_out, DSR.totalblks, DSR.blksize);
OmniS_FastMultiply64(usedspace_out, DSR.totalblks - DSR.freeblks, DSR.blksize);
/* DWORD*DWORD => QWORD result */
*freespace_out = (QWORD)DSR.freeblks * DSR.blksize;
*totspace_out = (QWORD)DSR.totalblks * DSR.blksize;
used = DSR.totalblks - DSR.freeblks;
*usedspace_out = (QWORD)used * DSR.blksize;
*success = 0;
return OK;
}
......@@ -1268,9 +1268,9 @@ _kernel_oserror *Omni_FreeOp_SWI (_kernel_swi_regs *R )
return Xlt_Error ( Omni_FreeSpace64 ( m_id,
(int *)&(R->r[0]), /* zero it on success */
(fspc_64 *)(R->r[2]+8) /* freespace_out */,
(fspc_64 *)(R->r[2]+16) /* usedspace_out */,
(fspc_64 *)(R->r[2]) /* totspace_out */ ) );
(QWORD *)(R->r[2]+8) /* freespace_out */,
(QWORD *)(R->r[2]+16) /* usedspace_out */,
(QWORD *)(R->r[2]+0) /* totspace_out */ ) );
}
default:
......
......@@ -738,6 +738,7 @@ static err_t Xlt_NameXlateCallbackX2 ( BYTE *entry, int format, bool *taken, voi
char *dptr = 1 + strrchr(dst->matchbuf, '\\');
err_t res = OK;
(void) format; /* Unused */
*taken = true;
if (dst->dstcpy[0] != '*') {
......@@ -1084,6 +1085,8 @@ err_t Xlt_ExpandSearchEntryX2 ( BYTE *entry, char *path_base,
DOS_ATTRIBS da;
RISCOS_ATTRIBS ra_name;
(void) path_base; /* Unused */
if ( entry == NULL )
return EBADPARAM;
......
......@@ -69,7 +69,6 @@ extern void OmniS_Suicide (char *modname);
extern void OmniS_ResourceInit (void);
extern void OmniS_ResourceShutdown (void);
extern void OmniS_ResFSStarting(int R2, int R3);
extern void OmniS_FastMultiply64(void *result, int arg1, int arg2);
/* OmniClient SWI definitions --------------- */
#define Omni_base 0x4A200
......
......@@ -33,6 +33,7 @@ typedef unsigned char BYTE;
typedef unsigned short int WORD;
typedef unsigned int LONG;
typedef unsigned int DWORD;
typedef unsigned long long QWORD;
typedef int err_t;
#include "sys/types.h"
......@@ -150,8 +151,3 @@ typedef struct
uint execaddr;
uint flags;
} RISCOS_ATTRIBS;
typedef struct
{
uint lo, hi;
} fspc_64;
......@@ -26,8 +26,8 @@
GET Hdr:ListOpts
GET Hdr:Macros
GET Hdr:System
GET Hdr:Machine.<Machine>
GET Hdr:APCS.<APCS>
GET Hdr:ModHand
GET Hdr:ResourceFS
; ---------------------------
......@@ -169,10 +169,9 @@ fsentry_branchtable
B fsentry_func
B fsentry_gbpb
; Suicide callback --------------------------------------------------
AREA |C$$code|, CODE, READONLY
; Suicide callback --------------------------------------------------
; This is used when we get a service call to terminate the module.
; For some reason, we can't terminate there and then, so it has to
......@@ -189,7 +188,7 @@ OmniS_Suicide ; (char *modulename)
suicide_cb
Push "r0-r1, r14"
MOV r0, #4 ; kill named module
MOV r0, #ModHandReason_Delete
MOV r1, r12
SWI XOS_Module
Pull "r0-r1, pc"
......@@ -218,32 +217,6 @@ Free_ServiceRoutine ; On entry R0 = reason code 0-3
DCB "Nothing libellous or obscene", 0 ; Contractual obligation
ALIGN
; Collect callbacks routine ------------------------------
; Long multiplier ----------------------------------------
; Taken from Acorn Assembler manual.
; extern void OmniS_FastMultiply64(fspc_64 *, unsigned, unsigned);
EXPORT OmniS_FastMultiply64
OmniS_FastMultiply64
FunctionEntry
MOVS lr, a2, LSR #16
BIC a2, a2, lr, LSL #16
MOV ip, a3, LSR #16
BIC a3, a3, ip, LSL #16
MUL a4, a2, a3
MUL a3, lr, a3
MUL a2, ip, a2
MULNE lr, ip, lr
ADDS a2, a2, a3
ADDCS lr, lr, #&10000
ADDS a4, a4, a2, LSL #16
ADC lr, lr, a2, LSR #16
STMIA a1, {a4, lr}
Return
; Resources ----------------------------------------------
; This is Acorn's sorry excuse for the lack of a resource compiler.
......
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