Reduced number of global int2f/11 entries into int2f.asm to one.

git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@895 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Bart Oldeman 2004-04-21 17:40:12 +00:00
parent 8d1eda45f9
commit ea23d33c2c
5 changed files with 60 additions and 89 deletions

View File

@ -88,8 +88,7 @@ extern int ASMPASCAL
/* /// End of additions for SHARE. - Ron Cemer */ /* /// End of additions for SHARE. - Ron Cemer */
extern int ASMCFUNC STATIC int remote_lock_unlock(sft FAR *sftp, /* SFT for file */
remote_lock_unlock(sft FAR *sftp, /* SFT for file */
unsigned long ofs, /* offset into file */ unsigned long ofs, /* offset into file */
unsigned long len, /* length (in bytes) of region to lock or unlock */ unsigned long len, /* length (in bytes) of region to lock or unlock */
int unlock); /* one to unlock; zero to lock */ int unlock); /* one to unlock; zero to lock */
@ -908,7 +907,8 @@ COUNT DosGetExtFree(BYTE FAR * DriveString, struct xfreespace FAR * xfsp)
if (cdsp->cdsFlags & CDSNETWDRV) if (cdsp->cdsFlags & CDSNETWDRV)
{ {
remote_getfree(cdsp, rg); if (remote_getfree(cdsp, rg) != SUCCESS)
return DE_INVLDDRV;
xfsp->xfs_clussize = rg[0]; xfsp->xfs_clussize = rg[0];
xfsp->xfs_totalclusters = rg[1]; xfsp->xfs_totalclusters = rg[1];
@ -1467,3 +1467,19 @@ COUNT DosTruename(const char FAR *src, char FAR *dest)
return rc; return rc;
} }
STATIC int remote_lock_unlock(sft FAR *sftp, /* SFT for file */
unsigned long ofs, /* offset into file */
unsigned long len, /* length (in bytes) of region to lock or unlock */
int unlock)
/* one to unlock; zero to lock */
{
struct
{
unsigned long ofs, len;
int unlock;
} param_block;
param_block.ofs = ofs;
param_block.len = len;
param_block.unlock = unlock;
return (int)network_redirector_mx(REM_LOCK, sftp, &param_block);
}

View File

@ -273,17 +273,6 @@ SHARE_LOCK_UNLOCK:
; sumtimes return data *ptr is the push stack word ; sumtimes return data *ptr is the push stack word
; ;
global _remote_printredir
_remote_printredir:
push bp
mov bp,sp
push si
push di
mov ax, 1125h
mov dx, [bp+4]
push word [bp+6]
jmp short int2f_call
remote_lseek: ; arg is a pointer to the long seek value remote_lseek: ; arg is a pointer to the long seek value
mov bx, cx mov bx, cx
mov dx, [bx] mov dx, [bx]
@ -296,6 +285,17 @@ remote_getfattr:
jc no_clear_ax jc no_clear_ax
jmp short no_neg_ax jmp short no_neg_ax
remote_lock_unlock:
mov dx, cx ; parameter block (dx) in arg
mov bx, cx
mov bl, [bx + 8] ; unlock or not
mov cx, 1
int 0x2f
mov ah, 0
jc lock_error
mov al, 0
lock_error: jmp no_clear_ax
;long ASMPASCAL network_redirector_mx(unsigned cmd, void far *s, void *arg) ;long ASMPASCAL network_redirector_mx(unsigned cmd, void far *s, void *arg)
global NETWORK_REDIRECTOR_MX global NETWORK_REDIRECTOR_MX
NETWORK_REDIRECTOR_MX: NETWORK_REDIRECTOR_MX:
@ -317,13 +317,22 @@ call_int2f:
je remote_rw je remote_rw
cmp al, 09h cmp al, 09h
je remote_rw je remote_rw
cmp al, 0ch cmp al, 0ah
je remote_getfree je remote_lock_unlock
cmp al, 21h
je remote_lseek
cmp al, 22h
je remote_process_end
cmp al, 23h cmp al, 23h
je qremote_fn je qremote_fn
cmp al, 25h
je remote_lseek
push cx ; arg push cx ; arg
cmp al, 0ch
je remote_getfree
cmp al, 1eh
je remote_print_doredir
cmp al, 1fh
je remote_print_doredir
int2f_call: int2f_call:
xor cx, cx ; set to succeed; clear carry and CX xor cx, cx ; set to succeed; clear carry and CX
@ -342,32 +351,18 @@ no_neg_ax:
pop bp pop bp
ret ret
global _remote_doredirect remote_print_doredir: ; di points to an lregs structure
_remote_doredirect: mov es,[di+0xe]
mov al, 1eh mov bx,[di+2]
jmp short print_doredir mov cx,[di+4]
mov dx,[di+6]
mov si,[di+8]
lds di,[di+0xa]
global _remote_printset
_remote_printset:
mov al, 1fh
print_doredir:
push bp
mov bp,sp
push si
push di
push ds
mov ah, 11h
mov si,[bp+14]
les di,[bp+10]
mov dx,[bp+8]
mov cx,[bp+6]
mov bx,[bp+4]
mov ds, [bp+18]
push word [bp+16] ; very fakey, HaHa ;)
clc ; set to succeed clc ; set to succeed
int 2fh int 2fh
pop bx pop bx ; restore stack and ds=ss
push ss
pop ds pop ds
jc no_clear_ax jc no_clear_ax
xor cx, cx xor cx, cx
@ -375,9 +370,8 @@ print_doredir:
remote_getfree: remote_getfree:
clc ; set to succeed clc ; set to succeed
push cx ; pointer arg
int 2fh int 2fh
pop di pop di ; retrieve pushed pointer arg
jc no_clear_ax jc no_clear_ax
mov [di],ax mov [di],ax
mov [di+2],bx mov [di+2],bx
@ -409,39 +403,12 @@ qremote_fn:
xor cx, cx xor cx, cx
jmp short clear_ax jmp short clear_ax
global _remote_process_end remote_process_end: ; Terminate process
_remote_process_end: ; Terminate process
mov ds, [_cu_psp] mov ds, [_cu_psp]
mov ax, 1122h int 2fh
call call_int2f
push ss push ss
pop ds pop ds
ret jmp short no_neg_ax
;STATIC int ASMCFUNC remote_lock_unlock(sft FAR *sftp, /* SFT for file */
; unsigned long ofs, /* offset into file */
; unsigned long len, /* length (in bytes) of region to lock or unlock */
; int unlock)
; one to unlock; zero to lock
global _remote_lock_unlock
_remote_lock_unlock:
push bp
mov bp, sp
push di
les di, [bp + 4] ; sftp
lea dx, [bp + 8] ; parameter block on the stack!
mov bl, [bp + 16] ; unlock
mov ax, 0x110a
mov cx, 1
int 0x2f
mov ah, 0
jc lock_error
mov al, 0
lock_error:
neg al
pop di
pop bp
ret
; extern UWORD ASMCFUNC call_nls(UWORD subfct, struct nlsInfoBlock *nlsinfo, ; extern UWORD ASMCFUNC call_nls(UWORD subfct, struct nlsInfoBlock *nlsinfo,
; UWORD bp, UWORD cp, UWORD cntry, UWORD bufsize, UWORD FAR *buf, UWORD *id); ; UWORD bp, UWORD cp, UWORD cntry, UWORD bufsize, UWORD FAR *buf, UWORD *id);

View File

@ -1326,8 +1326,7 @@ dispatch:
break; break;
default: default:
rc = remote_printset(lr.BX, lr.CX, lr.DX, (FP_ES_DI), rc = (int)network_redirector_mx(REM_PRINTSET, &lr, (void *)Int21AX);
lr.SI, (MK_FP(lr.DS, Int21AX)));
if (rc != SUCCESS) if (rc != SUCCESS)
goto error_exit; goto error_exit;
lr.AX = SUCCESS; lr.AX = SUCCESS;
@ -1359,14 +1358,7 @@ dispatch:
} }
else else
{ {
/* rc = (int)network_redirector_mx(REM_DOREDIRECT, &lr, (void *)Int21AX);
void int_2f_111e_call(iregs FAR *r);
int_2f_111e_call(r);
break;*/
rc = remote_doredirect(lr.BX, lr.CX, lr.DX,
(FP_ES_DI), lr.SI,
(MK_FP(lr.DS, Int21AX)));
/* the remote function manipulates *r directly !, /* the remote function manipulates *r directly !,
so we should not copy lr to r here */ so we should not copy lr to r here */
if (rc != SUCCESS) if (rc != SUCCESS)

View File

@ -60,3 +60,4 @@ int network_redirector(unsigned cmd)
{ {
return network_redirector_fp(cmd, NULL); return network_redirector_fp(cmd, NULL);
} }

View File

@ -382,15 +382,10 @@ COUNT truename(const char FAR * src, char * dest, COUNT t);
int network_redirector(unsigned cmd); int network_redirector(unsigned cmd);
int network_redirector_fp(unsigned cmd, void far *s); int network_redirector_fp(unsigned cmd, void far *s);
long ASMPASCAL network_redirector_mx(unsigned cmd, void far *s, void *arg); long ASMPASCAL network_redirector_mx(unsigned cmd, void far *s, void *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,
UWORD i, VOID FAR * data);
COUNT ASMCFUNC remote_process_end(VOID);
#define remote_getfree(s,d) (int)network_redirector_mx(REM_GETSPACE, s, d) #define remote_getfree(s,d) (int)network_redirector_mx(REM_GETSPACE, s, d)
#define remote_lseek(s,new_pos) network_redirector_mx(REM_LSEEK, s, &new_pos) #define remote_lseek(s,new_pos) network_redirector_mx(REM_LSEEK, s, &new_pos)
#define remote_setfattr(attr) (int)network_redirector_mx(REM_SETATTR, NULL, (void *)attr) #define remote_setfattr(attr) (int)network_redirector_mx(REM_SETATTR, NULL, (void *)attr)
COUNT ASMCFUNC remote_printredir(UCOUNT dx, UCOUNT ax); #define remote_printredir(dx,ax) (int)network_redirector_mx(REM_PRINTREDIR, MK_FP(0,dx),(void *)ax)
#define QRemote_Fn(d,s) (int)network_redirector_mx(REM_FILENAME, d, &s) #define QRemote_Fn(d,s) (int)network_redirector_mx(REM_FILENAME, d, &s)
UWORD get_machine_name(BYTE FAR * netname); UWORD get_machine_name(BYTE FAR * netname);