ktestdrv.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. /*++
  2. Copyright (c) 2013 Minoca Corp.
  3. This file is licensed under the terms of the GNU General Public License
  4. version 3. Alternative licensing terms are available. Contact
  5. info@minocacorp.com for details. See the LICENSE file at the root of this
  6. project for complete licensing information.
  7. Module Name:
  8. ktestdrv.h
  9. Abstract:
  10. This header contains definitions shared between the kernel test driver
  11. and the app.
  12. Author:
  13. Evan Green 5-Nov-2013
  14. --*/
  15. //
  16. // ------------------------------------------------------------------- Includes
  17. //
  18. #include <minoca/devinfo/test.h>
  19. //
  20. // ---------------------------------------------------------------- Definitions
  21. //
  22. //
  23. // Define the name of the test device that is created.
  24. //
  25. #define KTEST_DEVICE_NAME "KTestDevice"
  26. //
  27. // Define the number of extra parameters that are included in each test.
  28. //
  29. #define KTEST_PARAMETER_COUNT 4
  30. //
  31. // Define the number of result parameters included in each test.
  32. //
  33. #define KTEST_RESULT_COUNT 4
  34. //
  35. // ------------------------------------------------------ Data Type Definitions
  36. //
  37. typedef enum _KTEST_TYPE {
  38. KTestAll,
  39. KTestPagedPoolStress,
  40. KTestNonPagedPoolStress,
  41. KTestWorkStress,
  42. KTestThreadStress,
  43. KTestDescriptorStress,
  44. KTestPagedBlockStress,
  45. KTestNonPagedBlockStress,
  46. KTestCount
  47. } KTEST_TYPE, *PKTEST_TYPE;
  48. typedef enum _KTEST_REQUEST {
  49. KTestRequestInvalid,
  50. KTestRequestUnload,
  51. KTestRequestStartTest,
  52. KTestRequestCancelTest,
  53. KTestRequestPoll,
  54. } KTEST_REQUEST, *PKTEST_REQUEST;
  55. /*++
  56. Structure Description:
  57. This structure defines a set of kernel test parameters.
  58. Members:
  59. TestType - Stores the type of test to fire up.
  60. Iterations - Stores the number of iterations of the test to perform.
  61. Threads - Stores the number of threads to spin up.
  62. Parameters - Stores an array of test-specific parameters.
  63. --*/
  64. typedef struct _KTEST_PARAMETERS {
  65. KTEST_TYPE TestType;
  66. INTN Iterations;
  67. UINTN Threads;
  68. UINTN Parameters[KTEST_PARAMETER_COUNT];
  69. } KTEST_PARAMETERS, *PKTEST_PARAMETERS;
  70. /*++
  71. Structure Description:
  72. This structure defines the results for a kernel test.
  73. Members:
  74. Iterations - Stores the number of iterations of the test to perform.
  75. Threads - Stores the number of threads to spin up.
  76. Parameters - Stores an array of test-specific parameters.
  77. Status - Stores a status code associated with one of the failures.
  78. --*/
  79. typedef struct _KTEST_RESULTS {
  80. UINTN Failures;
  81. UINTN Results[KTEST_RESULT_COUNT];
  82. KSTATUS Status;
  83. } KTEST_RESULTS, *PKTEST_RESULTS;
  84. /*++
  85. Structure Description:
  86. This structure defines the parameters for a start test command.
  87. Members:
  88. Iterations - Stores the number of iterations of the test to perform.
  89. Threads - Stores the number of threads to spin up.
  90. Parameters - Stores the array of test-specific parameters.
  91. Status - Stores the resulting status code from the driver.
  92. Handle - Stores the handle for the test invocation on success.
  93. --*/
  94. typedef struct _KTEST_START_TEST {
  95. KTEST_PARAMETERS Parameters;
  96. KSTATUS Status;
  97. INT Handle;
  98. } KTEST_START_TEST, *PKTEST_START_TEST;
  99. /*++
  100. Structure Description:
  101. This structure defines the parameters for a cancel test command.
  102. Members:
  103. Handle - Stores the handle of the test to cancel.
  104. Status - Stores the result of the operation.
  105. --*/
  106. typedef struct _KTEST_CANCEL_TEST {
  107. INT Handle;
  108. KSTATUS Status;
  109. } KTEST_CANCEL_TEST, *PKTEST_CANCEL_TEST;
  110. /*++
  111. Structure Description:
  112. This structure defines the parameters for a poll command.
  113. Members:
  114. Handle - Stores the handle of the test to cancel.
  115. Status - Stores the result of the operation.
  116. Progress - Stores the test progress so far.
  117. Total - Stores the value the progress indicator is climbing towards.
  118. TestFinished - Stores a boolean returned from the kernel indicating if the
  119. test just finished.
  120. Parameters - Stores the test parameters used by the test, with any default
  121. values filled in.
  122. Results - Stores the current test results.
  123. --*/
  124. typedef struct _KTEST_POLL {
  125. INT Handle;
  126. KSTATUS Status;
  127. UINTN Progress;
  128. UINTN Total;
  129. BOOL TestFinished;
  130. KTEST_PARAMETERS Parameters;
  131. KTEST_RESULTS Results;
  132. } KTEST_POLL, *PKTEST_POLL;
  133. //
  134. // -------------------------------------------------------------------- Globals
  135. //
  136. //
  137. // -------------------------------------------------------- Function Prototypes
  138. //