Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.4 KiB

  1. /*
  2. * xmsdisp.c - SVC dispatch module for XMS
  3. *
  4. * Modification History:
  5. *
  6. * Sudeepb 15-May-1991 Created
  7. *
  8. * williamh 25-Sept-1992 Added UMB support
  9. */
  10. #include <xms.h>
  11. #include <xmsexp.h>
  12. #include <stdio.h>
  13. #include <softpc.h>
  14. #include <xmssvc.h>
  15. PFNSVC apfnXMSSvc [] = {
  16. xmsA20, // XMS_A20
  17. xmsMoveBlock, // XMS_MOVEBLOCK
  18. xmsAllocBlock, // XMS_ALLOCBLOCK
  19. xmsFreeBlock, // XMS_FREEBLOCK
  20. xmsSysPageSize, // XMS_SYSTEMPAGESIZE
  21. xmsQueryExtMem, // XMS_EXTMEM
  22. xmsInitUMB, // XMS_INITUMB
  23. xmsRequestUMB, // XMS_REQUESTUMB
  24. xmsReleaseUMB, // XMS_RELEASEUMB
  25. xmsNotifyHookI15, // XMS_NOTIFYHOOKI15
  26. xmsQueryFreeExtMem, // XMS_QUERYEXTMEM
  27. xmsReallocBlock // XMS_REALLOCBLOCK
  28. };
  29. /* XMSDispatch - Dispatch SVC call to right handler.
  30. *
  31. * Entry - iSvc (SVC byte following SVCop)
  32. *
  33. * Exit - None
  34. *
  35. * Note - Some mechanism has to be worked out to let the emulator know
  36. * about DOSKRNL code segment and size. Using these it will figure
  37. * out whether SVCop (hlt for the moment) has to be passed to
  38. * DEM or to be handled as normal invalid opcode.
  39. */
  40. BOOL XMSDispatch (ULONG iSvc)
  41. {
  42. #if DBG
  43. if (iSvc >= XMS_LASTSVC){
  44. printf("XMS:Unimplemented SVC index %x\n",iSvc);
  45. setCF(1);
  46. return FALSE;
  47. }
  48. #endif
  49. (apfnXMSSvc [iSvc])();
  50. return TRUE;
  51. }