]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/exmm/memory.c
wwww
[16.git] / src / lib / exmm / memory.c
old mode 100644 (file)
new mode 100755 (executable)
index 38b1225..21b213f
  //static globals --------------------------------\r
 \r
 static int  ActiveEMList[MAXEMHANDLES];\r
-static unsigned int  EMMSeg;\r
+static unsigned long EMMSeg;\r
 \r
  //forward declarations ---------------------------------\r
 
 static int  EMPresent(void);\r
 static int  EMReady(void);\r
-static unsigned int  GetEMMSeg(void);\r
+static unsigned long GetEMMSeg(void);\r
 static int  GetEMHandle(int NumPages);\r
 static int  EMMap(int Handle, int LogPg, int PhyPg);\r
 static int  FreeEMHandle(int Handle);\r
@@ -308,7 +308,7 @@ EMReady(void)
 \r
 /********************************************************************/\r
 \r
-static unsigned int\r
+static unsigned long\r
 GetEMMSeg(void)\r
 {\r
        unsigned int     EMSegment;\r
@@ -328,7 +328,31 @@ GetEMMSeg(void)
 \r
 //NotReady:\r
 //    return(NOTREADY);\r
-}               /* End of GetEMMSeg() */\r
+}               /* End of GetEMMSeg() */
+
+/********************************************************************/\r
+\r
+unsigned long\r
+GetEMMSeg0(void)\r
+{\r
+       unsigned int     EMSegment;\r
+\r
+       _asm {\r
+               mov     ah,0x41             /* get EMM page frame segment */\r
+               int     0x67\r
+               or      ah,ah\r
+               js      NotReady            /* returns 80, 81, or 84 hex on error */\r
+               mov     EMSegment,bx
+               jmp End
+               NotReady:
+               mov     EMSegment,NOTREADY
+               End:\r
+       }\r
+       return(EMSegment);              /*lint !e530 */\r
+\r
+//NotReady:\r
+//    return(NOTREADY);\r
+}               /* End of GetEMMSeg0() */\r
 \r
 /********************************************************************/\r
 \r