From: Bart O. <bar...@us...> - 2004-04-21 02:02:04
|
Update of /cvsroot/freedos/kernel/kernel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16044 Modified Files: dosfns.c int2f.asm network.c proto.h Log Message: Re-merge parts of network_redirector_rw with network_redirector_open, and let it return a long instead of using a *err pointer. Call the resulting function NETWORK_REDIRECTOR_MX (multiplex) Index: network.c =================================================================== RCS file: /cvsroot/freedos/kernel/kernel/network.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- network.c 21 Apr 2004 00:53:45 -0000 1.20 +++ network.c 21 Apr 2004 02:01:56 -0000 1.21 @@ -53,7 +53,7 @@ int network_redirector_fp(unsigned cmd, void far *s) { - return network_redirector_open(cmd, s, 0); + return (int)network_redirector_mx(cmd, s, 0); } int network_redirector(unsigned cmd) Index: dosfns.c =================================================================== RCS file: /cvsroot/freedos/kernel/kernel/dosfns.c,v retrieving revision 1.64 retrieving revision 1.65 diff -u -d -r1.64 -r1.65 --- dosfns.c 21 Apr 2004 00:53:45 -0000 1.64 +++ dosfns.c 21 Apr 2004 02:01:47 -0000 1.65 @@ -225,18 +225,17 @@ */ if (s->sft_flags & SFT_FSHARED) { - UCOUNT XferCount; + long XferCount; VOID FAR *save_dta; - int err; save_dta = dta; lpCurSft = s; current_filepos = s->sft_posit; /* needed for MSCDEX */ dta = bp; - XferCount = network_redirector_rw(mode == XFR_READ ? REM_READ : REM_WRITE, - s, n, &err); + XferCount = network_redirector_mx(mode == XFR_READ ? REM_READ : REM_WRITE, + s, n); dta = save_dta; - return err == SUCCESS ? (long)XferCount : err; + return XferCount; } /* Do a device transfer if device */ @@ -566,7 +565,7 @@ cmd = REM_OPEN; attrib = (BYTE)flags; } - status = network_redirector_open(cmd, sftp, attrib); + status = (int)network_redirector_mx(cmd, sftp, attrib); if (status >= SUCCESS) { if (sftp->sft_count == 0) Index: int2f.asm =================================================================== RCS file: /cvsroot/freedos/kernel/kernel/int2f.asm,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- int2f.asm 21 Apr 2004 00:53:45 -0000 1.30 +++ int2f.asm 21 Apr 2004 02:01:55 -0000 1.31 @@ -313,9 +313,9 @@ jc no_clear_ax jmp short no_neg_ax -;int ASMPASCAL network_redirector_open(unsigned cmd, void far *s, unsigned arg) - global NETWORK_REDIRECTOR_OPEN -NETWORK_REDIRECTOR_OPEN: +;long ASMPASCAL network_redirector_mx(unsigned cmd, void far *s, unsigned arg) + global NETWORK_REDIRECTOR_MX +NETWORK_REDIRECTOR_MX: pop bx ; ret address pop cx ; stack value (arg) pop dx ; off s @@ -326,9 +326,14 @@ push bp push si push di - mov di, dx ; es:di -> s cmp al, 0fh je remote_getfattr + + mov di, dx ; es:di -> s + cmp al, 08h + je remote_rw + cmp al, 09h + je remote_rw push cx ; arg int2f_call: @@ -398,6 +403,17 @@ xor cx, cx jmp short clear_ax +remote_rw: + clc ; set to succeed + int 2fh + jc int2f_carry + mov ax, cx + xor dx, dx ; dx:ax = bytes read + jmp short no_neg_ax +int2f_carry: neg ax + cwd + jmp short no_neg_ax + global _QRemote_Fn _QRemote_Fn: push bp @@ -414,27 +430,8 @@ mov ax,0xffff jc no_neg_ax xor cx, cx - jmp short clear_ax + jmp clear_ax - global _network_redirector_rw -_network_redirector_rw: - push bp - mov bp, sp - push si - push di - mov ax, [bp+4] - les di, [bp+6] - mov cx, [bp+10] - clc ; set to succeed - int 2fh - jc int2f_carry - xor ax, ax -int2f_carry: neg ax - mov di, [bp+12] - mov [di], ax - mov ax, cx - jmp no_neg_ax - global _remote_process_end _remote_process_end: ; Terminate process mov ds, [_cu_psp] Index: proto.h =================================================================== RCS file: /cvsroot/freedos/kernel/kernel/proto.h,v retrieving revision 1.64 retrieving revision 1.65 diff -u -d -r1.64 -r1.65 --- proto.h 21 Apr 2004 00:53:45 -0000 1.64 +++ proto.h 21 Apr 2004 02:01:56 -0000 1.65 @@ -381,9 +381,7 @@ /* network.c */ int network_redirector(unsigned cmd); int network_redirector_fp(unsigned cmd, void far *s); -int ASMPASCAL network_redirector_open(unsigned cmd, void far *s, unsigned arg); -unsigned ASMCFUNC network_redirector_rw(unsigned cmd, void far *s, - unsigned n, int *err); +long ASMPASCAL network_redirector_mx(unsigned cmd, void far *s, unsigned arg); COUNT ASMCFUNC remote_doredirect(UWORD b, UCOUNT n, UWORD d, VOID FAR * s, UWORD i, VOID FAR * data); COUNT ASMCFUNC remote_printset(UWORD b, UCOUNT n, UWORD d, VOID FAR * s, |