Windows NT 4.0 source code leak
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.

81 lines
2.4 KiB

4 years ago
  1. /*** nt4000.c - MIPS R4000-specific routine for NT debugger
  2. *
  3. * Copyright <C> 1990, Microsoft Corporation
  4. *
  5. * Purpose:
  6. * Implement routines that reference R4000-specific registers
  7. * and structures.
  8. *
  9. * Revision History:
  10. *
  11. * [-] 24-Mar-1991 Richk Created.
  12. *
  13. *************************************************************************/
  14. #ifdef KERNEL
  15. #undef R4000
  16. #define R4000 // define to R4000 when routine updated
  17. #include <ntsdp.h>
  18. void fnDumpTb4000(ULONG, ULONG);
  19. /*** fnDumpTb4000 - output tb for R4000
  20. *
  21. * Purpose:
  22. * Function of "dt<range>" command.
  23. *
  24. * Output the tb in the specified range as tb values
  25. * word values up to 1 value per line. The default
  26. * display is 16 lines for 16 64-doublewords total.
  27. *
  28. * Input:
  29. * startaddr - starting address to begin display
  30. * count - number of tb entries to be displayed
  31. *
  32. * Output:
  33. * None.
  34. *
  35. * Notes:
  36. * memory locations not accessible are output as "????????",
  37. * but no errors are returned.
  38. *
  39. *************************************************************************/
  40. void fnDumpTb4000 (ULONG startaddr, ULONG count)
  41. {
  42. NTSTATUS ntstatus;
  43. ULONG readbuffer[128];
  44. PULONG valuepointer = readbuffer;
  45. ULONG cBytesRead;
  46. ENTRYLO *lo0;
  47. ENTRYLO *lo1;
  48. ENTRYHI *hi;
  49. ntstatus = DbgKdReadControlSpace(NtsdCurrentProcessor, (PVOID)startaddr,
  50. (PVOID)readbuffer, count * 16,
  51. &cBytesRead);
  52. if (NT_SUCCESS(ntstatus)) {
  53. count = cBytesRead / 16;
  54. while (count--) {
  55. lo0 = (ENTRYLO *)valuepointer++;
  56. lo1 = (ENTRYLO *)valuepointer++;
  57. hi = (ENTRYHI *)valuepointer++;
  58. dprintf("%02ld <pfn0> %06lx <C> %01lx %c%c%c "
  59. "<pfn1> %06lx <C> %01lx %c%c%c "
  60. "<vpn> %05lx <pid> %02lx <pgmsk> %06lx\n",
  61. startaddr,
  62. lo0->PFN, lo0->C, lo0->D ? 'D' : '-',
  63. lo0->V ? 'V' : '-', lo0->G ? 'G' : '-',
  64. lo1->PFN, lo1->C, lo1->D ? 'D' : '-',
  65. lo1->V ? 'V' : '-', lo1->G ? 'G' : '-',
  66. hi->VPN2 << 1, hi->PID,
  67. *valuepointer++);
  68. startaddr++;
  69. }
  70. }
  71. }
  72. #else
  73. #pragma warning(disable:4206) // disable empty translation error
  74. #endif // KERNEL