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.

55 lines
1020 B

  1. #include <nt.h>
  2. #include <ntrtl.h>
  3. #include "psxmsg.h"
  4. #include <signal.h>
  5. #include <errno.h>
  6. #include <sys/wait.h>
  7. #include <unistd.h>
  8. #include <fcntl.h>
  9. #include "tsttmp.h" // defines DbgPrint as printf
  10. #define MEM_CTL 0xb0000000
  11. int main(int argc, char *argv[])
  12. {
  13. call0();
  14. _exit(0);
  15. return 1;
  16. }
  17. call0()
  18. {
  19. LONG x,i,j;
  20. ULONG begin,end;
  21. ULONG ibegin,iend;
  22. VOID PdxNullPosixApi();
  23. volatile PULONG MemCtl;
  24. MemCtl = (PULONG) MEM_CTL;
  25. #ifdef SIMULATOR
  26. for(i=0;i<10;i++) {
  27. begin = rnuminstr();
  28. ibegin = DbgQueryIoCounter();
  29. PdxNullPosixApi();
  30. iend = DbgQueryIoCounter();
  31. end = rnuminstr();
  32. DbgPrint("Call Time 0x%lx dec %ld IO %ld\n", end - begin,end-begin, iend-ibegin);
  33. }
  34. #else
  35. for(j=0;j<5;j++) {
  36. DbgPrint("Starting 10000 Calls...");
  37. x = *MemCtl;
  38. for(i=0;i<10000;i++) {
  39. PdxNullPosixApi();
  40. }
  41. x = *MemCtl;
  42. DbgPrint("Complete\n");
  43. }
  44. #endif // SIMULATOR
  45. }