Convert getvec into a C function.

git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@929 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Bart Oldeman 2004-05-10 20:49:43 +00:00
parent 7a16abbfb2
commit e68f66db37
7 changed files with 29 additions and 10 deletions

View File

@ -22,9 +22,9 @@
#AFLAGS = /Mx /Dmem$(MODEL)=1
#LIBFLAGS = /c
OBJS = floppy.obj getvec.obj rdpcclk.obj wrpcclk.obj wratclk.obj
OBJS = floppy.obj rdpcclk.obj wrpcclk.obj wratclk.obj
LIBOBJS= +floppy +getvec +rdpcclk +wrpcclk +wratclk
LIBOBJS= +floppy +rdpcclk +wrpcclk +wratclk

View File

@ -28,7 +28,6 @@
*/*/docs/readme.txt
*/*/docs/sys.txt
*/*/drivers/floppy.asm
*/*/drivers/getvec.asm
*/*/drivers/makefile
*/*/drivers/rdpcclk.asm
*/*/drivers/wratclk.asm

View File

@ -375,12 +375,11 @@ VOID ASMCFUNC FAR restore_stack(VOID);
ULONG ASMPASCAL ReadPCClock(VOID);
VOID ASMPASCAL WriteATClock(BYTE *, BYTE, BYTE, BYTE);
VOID ASMPASCAL WritePCClock(ULONG);
intvec ASMPASCAL getvec(UWORD);
intvec getvec(unsigned char);
#ifdef __WATCOMC__
#pragma aux (pascal) ReadPCClock modify exact [ax cx dx]
#pragma aux (pascal) WriteATClock modify exact [ax bx cx dx]
#pragma aux (pascal) WritePCClock modify exact [ax cx dx]
#pragma aux (pascal) getvec modify exact [ax bx dx es]
#endif
/* */

View File

@ -101,7 +101,10 @@ extern BYTE DosLoadedInHMA;
void MoveKernel(unsigned NewKernelSegment);
void setvec(unsigned char intno, intvec vector);
#define getvec(n) (*(intvec FAR *)MK_FP(0,4 * (n)))
#ifndef __WATCOMC__
#define getvec init_getvec
#endif
intvec getvec(unsigned char intno);
#define GLOBAL extern
#define NAMEMAX MAX_CDSPATH /* Maximum path for CDS */

View File

@ -71,7 +71,7 @@ VOID ASMCFUNC int21_syscall(iregs FAR * irp)
{
/* Set Interrupt Vector */
case 0x25:
setvec(irp->AL, MK_FP(irp->DS, irp->DX));
setvec(irp->AL, (intvec)MK_FP(irp->DS, irp->DX));
break;
/* DosVars - get/set dos variables */

View File

@ -208,7 +208,16 @@ STATIC void PSPInit(void)
}
#ifndef __WATCOMC__
/* for WATCOMC we can use the one in task.c */
/* for WATCOMC we can use the ones in task.c */
intvec getvec(unsigned char intno)
{
intvec iv;
disable();
iv = *(intvec FAR *)MK_FP(0,4 * (intno));
enable();
return iv;
}
void setvec(unsigned char intno, intvec vector)
{
disable();

View File

@ -65,6 +65,15 @@ static BYTE *RcsId =
+ 1 byte: '\0'
-- 1999/04/21 ska */
intvec getvec(unsigned char intno)
{
intvec iv;
disable();
iv = *(intvec FAR *)MK_FP(0,4 * (intno));
enable();
return iv;
}
void setvec(unsigned char intno, intvec vector)
{
disable();
@ -488,7 +497,7 @@ COUNT DosComLoader(BYTE FAR * namep, exec_blk * exp, COUNT mode, COUNT fd)
psp FAR *p;
/* point to the PSP so we can build it */
setvec(0x22, MK_FP(user_r->CS, user_r->IP));
setvec(0x22, (intvec)MK_FP(user_r->CS, user_r->IP));
child_psp(mem, cu_psp, mem + asize);
fcbcode = patchPSP(mem - 1, env, exp, namep);
@ -739,7 +748,7 @@ COUNT DosExeLoader(BYTE FAR * namep, exec_blk * exp, COUNT mode, COUNT fd)
UWORD fcbcode;
/* point to the PSP so we can build it */
setvec(0x22, MK_FP(user_r->CS, user_r->IP));
setvec(0x22, (intvec)MK_FP(user_r->CS, user_r->IP));
child_psp(mem, cu_psp, mem + asize);
fcbcode = patchPSP(mem - 1, env, exp, namep);