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.

146 lines
2.6 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. system.c
  5. Abstract:
  6. This file contains code to dump out the virtual machine state.
  7. Author:
  8. Neil Sandlin (neilsa) 22-Nov-1995
  9. Revision History:
  10. --*/
  11. #include <precomp.h>
  12. #pragma hdrstop
  13. #include "insignia.h"
  14. #include "host_gen.h"
  15. #define BIT_ORDER1 1
  16. #include "dma.h"
  17. VOID
  18. dma(
  19. CMD_ARGLIST
  20. )
  21. /*++
  22. Routine Description:
  23. This routine dumps the virtual DMA state.
  24. Return Value
  25. None.
  26. --*/
  27. {
  28. DMA_ADAPT adapter;
  29. DMA_CNTRL *dcp;
  30. int i,j;
  31. int chan = 0;
  32. CMD_INIT();
  33. if (!ReadMemExpression("ntvdm!adaptor", &adapter, sizeof(DMA_ADAPT))) {
  34. return;
  35. }
  36. PRINTF(" Virtual DMA State\n");
  37. PRINTF(" base base cur cur\n");
  38. PRINTF("chn pg addr cnt addr cnt\n");
  39. PRINTF("--- -- ---- ---- ---- ----\n");
  40. for (i=0; i<DMA_ADAPTOR_CONTROLLERS; i++) {
  41. dcp = &adapter.controller[i];
  42. for (j=0; j<DMA_CONTROLLER_CHANNELS; j++) {
  43. PRINTF("%d %.02X %.04X %.04X %.04X %.04X", chan, adapter.pages.page[chan],
  44. *(USHORT *)dcp->base_address[j], *(USHORT *)dcp->base_count[j],
  45. *(USHORT *)dcp->current_address[j], *(USHORT *)dcp->current_count[j]);
  46. PRINTF("\n");
  47. chan++;
  48. }
  49. }
  50. PRINTF("\n");
  51. }
  52. VOID
  53. ica(
  54. CMD_ARGLIST
  55. )
  56. /*++
  57. Routine Description:
  58. This routine dumps the virtual PIC state.
  59. Return Value
  60. None.
  61. --*/
  62. {
  63. VDMVIRTUALICA VirtualIca[2];
  64. int i,j;
  65. CMD_INIT();
  66. if (!ReadMemExpression("ntvdm!VirtualIca", &VirtualIca, 2*sizeof(VDMVIRTUALICA))) {
  67. return;
  68. }
  69. PRINTF(" Virtual PIC State\n");
  70. PRINTF(" ");
  71. for (i=0; i<2; i++) {
  72. for(j=0; j<8; j++) {
  73. PRINTF("%01X", (VirtualIca[i].ica_base+j)/16);
  74. }
  75. }
  76. PRINTF("\n");
  77. PRINTF(" ");
  78. for (i=0; i<2; i++) {
  79. for(j=0; j<8; j++) {
  80. PRINTF("%01X", (VirtualIca[i].ica_base+j)&0xf);
  81. }
  82. }
  83. PRINTF("\n");
  84. PRINTF(" ----------------\n");
  85. PRINTF("Int Requests ");
  86. for (i=0; i<2; i++) {
  87. for(j=0; j<8; j++) {
  88. PRINTF("%01X", (VirtualIca[i].ica_irr >> j)&0x1);
  89. }
  90. }
  91. PRINTF("\n");
  92. PRINTF("In Service ");
  93. for (i=0; i<2; i++) {
  94. for(j=0; j<8; j++) {
  95. PRINTF("%01X", (VirtualIca[i].ica_isr >> j)&0x1);
  96. }
  97. }
  98. PRINTF("\n");
  99. PRINTF("Ints Masked ");
  100. for (i=0; i<2; i++) {
  101. for(j=0; j<8; j++) {
  102. PRINTF("%01X", (VirtualIca[i].ica_imr >> j)&0x1);
  103. }
  104. }
  105. PRINTF("\n");
  106. }