summaryrefslogtreecommitdiffstats
path: root/private/mvdm/xms.486/xmsdisp.c
diff options
context:
space:
mode:
authorAdam <you@example.com>2020-05-17 05:51:50 +0200
committerAdam <you@example.com>2020-05-17 05:51:50 +0200
commite611b132f9b8abe35b362e5870b74bce94a1e58e (patch)
treea5781d2ec0e085eeca33cf350cf878f2efea6fe5 /private/mvdm/xms.486/xmsdisp.c
downloadNT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip
Diffstat (limited to 'private/mvdm/xms.486/xmsdisp.c')
-rw-r--r--private/mvdm/xms.486/xmsdisp.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/private/mvdm/xms.486/xmsdisp.c b/private/mvdm/xms.486/xmsdisp.c
new file mode 100644
index 000000000..c044159ad
--- /dev/null
+++ b/private/mvdm/xms.486/xmsdisp.c
@@ -0,0 +1,59 @@
+/*
+ * xmsdisp.c - SVC dispatch module for XMS
+ *
+ * Modification History:
+ *
+ * Sudeepb 15-May-1991 Created
+ *
+ * williamh 25-Sept-1992 Added UMB support
+ */
+
+#include <xms.h>
+#include <xmsexp.h>
+#include <stdio.h>
+#include <softpc.h>
+#include <xmssvc.h>
+
+PFNSVC apfnXMSSvc [] = {
+ xmsA20, // XMS_A20
+ xmsMoveBlock, // XMS_MOVEBLOCK
+ xmsAllocBlock, // XMS_ALLOCBLOCK
+ xmsFreeBlock, // XMS_FREEBLOCK
+ xmsSysPageSize, // XMS_SYSTEMPAGESIZE
+ xmsQueryExtMem, // XMS_EXTMEM
+ xmsInitUMB, // XMS_INITUMB
+ xmsRequestUMB, // XMS_REQUESTUMB
+ xmsReleaseUMB, // XMS_RELEASEUMB
+ xmsNotifyHookI15, // XMS_NOTIFYHOOKI15
+ xmsQueryFreeExtMem, // XMS_QUERYEXTMEM
+ xmsReallocBlock // XMS_REALLOCBLOCK
+};
+
+/* XMSDispatch - Dispatch SVC call to right handler.
+ *
+ * Entry - iSvc (SVC byte following SVCop)
+ *
+ * Exit - None
+ *
+ * Note - Some mechanism has to be worked out to let the emulator know
+ * about DOSKRNL code segment and size. Using these it will figure
+ * out whether SVCop (hlt for the moment) has to be passed to
+ * DEM or to be handled as normal invalid opcode.
+ */
+
+BOOL XMSDispatch (ULONG iSvc)
+{
+
+#if DBG
+
+ if (iSvc >= XMS_LASTSVC){
+ printf("XMS:Unimplemented SVC index %x\n",iSvc);
+ setCF(1);
+ return FALSE;
+ }
+
+#endif
+
+ (apfnXMSSvc [iSvc])();
+ return TRUE;
+}