mirror of https://github.com/FDOS/kernel.git
int2f: fix call interface around syscall_MUX14( ) (inthndlr.c)
The issues are similar to those surrounding int2F_12_hanndler( ) (see https://github.com/FDOS/kernel/issues/11).
This commit is contained in:
parent
c07577cbfb
commit
6a29f57715
|
@ -87,14 +87,6 @@ typedef struct {
|
||||||
UWORD si, di, ds, es;
|
UWORD si, di, ds, es;
|
||||||
} lregs;
|
} lregs;
|
||||||
|
|
||||||
/* Registers directly passed to syscall;
|
|
||||||
must be the same order as iregs!
|
|
||||||
Is used to define parameters. */
|
|
||||||
#define DIRECT_IREGS \
|
|
||||||
xreg a, xreg b, xreg c, xreg d, \
|
|
||||||
UWORD si, UWORD di, UWORD bp, UWORD ds, UWORD es, \
|
|
||||||
UWORD ip, UWORD cs, UWORD flags
|
|
||||||
|
|
||||||
/* Process control block for task switching */
|
/* Process control block for task switching */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
UWORD pc_ss;
|
UWORD pc_ss;
|
||||||
|
|
|
@ -149,8 +149,9 @@ Int2f?14: ;; MUX-14 -- NLSFUNC API
|
||||||
push bp ; Preserve BP later on
|
push bp ; Preserve BP later on
|
||||||
Protect386Registers
|
Protect386Registers
|
||||||
PUSH$ALL
|
PUSH$ALL
|
||||||
mov ds, [cs:_DGROUP_]
|
SwitchToInt2fStack
|
||||||
call _syscall_MUX14
|
call _syscall_MUX14
|
||||||
|
DoneInt2fStack
|
||||||
pop bp ; Discard incoming AX
|
pop bp ; Discard incoming AX
|
||||||
push ax ; Correct stack for POP$ALL
|
push ax ; Correct stack for POP$ALL
|
||||||
POP$ALL
|
POP$ALL
|
||||||
|
|
36
kernel/nls.c
36
kernel/nls.c
|
@ -667,60 +667,54 @@ VOID FAR *DosGetDBCS(void)
|
||||||
Return value: AL register to be returned
|
Return value: AL register to be returned
|
||||||
if AL == 0, Carry must be cleared, otherwise set
|
if AL == 0, Carry must be cleared, otherwise set
|
||||||
*/
|
*/
|
||||||
UWORD ASMCFUNC syscall_MUX14(DIRECT_IREGS)
|
UWORD ASMCFUNC syscall_MUX14(iregs FAR *pr)
|
||||||
{
|
{
|
||||||
struct nlsPackage FAR *nls; /* addressed NLS package */
|
struct nlsPackage FAR *nls; /* addressed NLS package */
|
||||||
|
|
||||||
UNREFERENCED_PARAMETER(flags);
|
log(("NLS: MUX14(): subfct=%x, cp=%u, cntry=%u\n", pr->AL, pr->BX, pr->DX));
|
||||||
UNREFERENCED_PARAMETER(cs);
|
|
||||||
UNREFERENCED_PARAMETER(ip);
|
|
||||||
UNREFERENCED_PARAMETER(ds);
|
|
||||||
UNREFERENCED_PARAMETER(es);
|
|
||||||
UNREFERENCED_PARAMETER(si);
|
|
||||||
|
|
||||||
log(("NLS: MUX14(): subfct=%x, cp=%u, cntry=%u\n", AL, BX, DX));
|
if ((nls = searchPackage(pr->BX, pr->DX)) == NULL)
|
||||||
|
|
||||||
if ((nls = searchPackage(BX, DX)) == NULL)
|
|
||||||
return DE_INVLDFUNC; /* no such package */
|
return DE_INVLDFUNC; /* no such package */
|
||||||
|
|
||||||
log(("NLS: MUX14(): NLS pkg found\n"));
|
log(("NLS: MUX14(): NLS pkg found\n"));
|
||||||
|
|
||||||
switch (AL)
|
switch (pr->AL)
|
||||||
{
|
{
|
||||||
case NLSFUNC_INSTALL_CHECK:
|
case NLSFUNC_INSTALL_CHECK:
|
||||||
BX = NLS_FREEDOS_NLSFUNC_ID;
|
pr->BX = NLS_FREEDOS_NLSFUNC_ID;
|
||||||
return SUCCESS; /* kernel just simulates default functions */
|
return SUCCESS; /* kernel just simulates default functions */
|
||||||
case NLSFUNC_DOS38:
|
case NLSFUNC_DOS38:
|
||||||
return nlsGetData(nls, NLS_DOS_38, MK_FP(ES, DI), 34);
|
return nlsGetData(nls, NLS_DOS_38, MK_FP(pr->ES, pr->DI), 34);
|
||||||
case NLSFUNC_GETDATA:
|
case NLSFUNC_GETDATA:
|
||||||
return nlsGetData(nls, BP, MK_FP(ES, DI), CX);
|
return nlsGetData(nls, pr->BP, MK_FP(pr->ES, pr->DI), pr->CX);
|
||||||
case NLSFUNC_DRDOS_GETDATA:
|
case NLSFUNC_DRDOS_GETDATA:
|
||||||
/* Does not pass buffer length */
|
/* Does not pass buffer length */
|
||||||
return nlsGetData(nls, CL, MK_FP(ES, DI), 512);
|
return nlsGetData(nls, pr->CL, MK_FP(pr->ES, pr->DI), 512);
|
||||||
case NLSFUNC_LOAD_PKG:
|
case NLSFUNC_LOAD_PKG:
|
||||||
return nlsLoadPackage(nls);
|
return nlsLoadPackage(nls);
|
||||||
case NLSFUNC_LOAD_PKG2:
|
case NLSFUNC_LOAD_PKG2:
|
||||||
return nlsSetPackage(nls);
|
return nlsSetPackage(nls);
|
||||||
case NLSFUNC_YESNO:
|
case NLSFUNC_YESNO:
|
||||||
return nlsYesNo(nls, CX);
|
return nlsYesNo(nls, pr->CX);
|
||||||
case NLSFUNC_UPMEM:
|
case NLSFUNC_UPMEM:
|
||||||
nlsUpMem(nls, MK_FP(ES, DI), CX);
|
nlsUpMem(nls, MK_FP(pr->ES, pr->DI), pr->CX);
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
case NLSFUNC_FILE_UPMEM:
|
case NLSFUNC_FILE_UPMEM:
|
||||||
#ifdef NLS_DEBUG
|
#ifdef NLS_DEBUG
|
||||||
{
|
{
|
||||||
unsigned j;
|
unsigned j;
|
||||||
BYTE FAR *p;
|
BYTE FAR *p;
|
||||||
log(("NLS: MUX14(FILE_UPMEM): len=%u, %04x:%04x=\"", CX, ES, DI));
|
log(("NLS: MUX14(FILE_UPMEM): len=%u, %04x:%04x=\"", pr->CX,
|
||||||
for (j = 0, p = MK_FP(ES, DI); j < CX; ++j)
|
pr->ES, pr->DI));
|
||||||
|
for (j = 0, p = MK_FP(pr->ES, pr->DI); j < pr->CX; ++j)
|
||||||
printf("%c", p[j] > 32 ? p[j] : '.');
|
printf("%c", p[j] > 32 ? p[j] : '.');
|
||||||
printf("\"\n");
|
printf("\"\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
nlsFUpMem(nls, MK_FP(ES, DI), CX);
|
nlsFUpMem(nls, MK_FP(pr->ES, pr->DI), pr->CX);
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
log(("NLS: MUX14(): Invalid function %x\n", AL));
|
log(("NLS: MUX14(): Invalid function %x\n", pr->AL));
|
||||||
return DE_INVLDFUNC; /* no such function */
|
return DE_INVLDFUNC; /* no such function */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -277,7 +277,7 @@ COUNT DosSetCountry(UWORD cntry);
|
||||||
COUNT DosGetCodepage(UWORD * actCP, UWORD * sysCP);
|
COUNT DosGetCodepage(UWORD * actCP, UWORD * sysCP);
|
||||||
COUNT DosSetCodepage(UWORD actCP, UWORD sysCP);
|
COUNT DosSetCodepage(UWORD actCP, UWORD sysCP);
|
||||||
VOID FAR *DosGetDBCS(void);
|
VOID FAR *DosGetDBCS(void);
|
||||||
UWORD ASMCFUNC syscall_MUX14(DIRECT_IREGS);
|
UWORD ASMCFUNC syscall_MUX14(iregs FAR *);
|
||||||
|
|
||||||
/* prf.c */
|
/* prf.c */
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|
Loading…
Reference in New Issue