Functions | |
enum YepStatus | yepLibrary_GetCpuCyclesAcquire (Yep64u *state) |
Initializes the processor cycle counter and starts counting the processor cycles. More... | |
enum YepStatus | yepLibrary_GetCpuCyclesRelease (Yep64u *state, Yep64u *cycles) |
Stops counting the processor cycles, releases the system resources associated with the cycle counter, and returns the number of cycles elapsed. More... | |
Initializes the processor cycle counter and starts counting the processor cycles.
In the current implementation this function can use:
[out] | state | Pointer to a variable where the state of the cycle counter will be stored. If the function fails, the value of the state variable is not changed. |
YepStatusOk | The cycle counter successfully initialized and its state is stored to the variable pointed by state parameter. |
YepStatusNullPointer | The state pointer is null. |
YepStatusUnsupportedHardware | The processor does not have cycle counter. |
YepStatusUnsupportedSoftware | The operating system does not provide access to the CPU cycle counter. |
YepStatusSystemError | An attempt to initialize cycle counter failed inside the OS kernel. |
Stops counting the processor cycles, releases the system resources associated with the cycle counter, and returns the number of cycles elapsed.
[in,out] | state | Pointer to a variable with the state of the cycle counter saved by yepLibrary_GetCpuCyclesAcquire. The cycle counter should be released only once, and the function zeroes out the state variable. |
[out] | cycles | Pointer to a variable where the number of cycles elapsed will be stored. The pointer can be the same as state pointer. |
YepStatusOk | The number of cycles elapsed is saved to the variable pointed by cycles parameter, and the system resources are successfully released. |
YepStatusNullPointer | Either the state pointer or the cycles pointer is null. |
YepStatusInvalidState | The state variable does not specify a valid state of the cycle counter. This can happen if the state variable was not initialized, or it was released previously. |
YepStatusUnsupportedHardware | The processor does not have cycle counter. |
YepStatusUnsupportedSoftware | The operating system does not provide access to the CPU cycle counter. |
YepStatusSystemError | An attempt to read the cycle counter or release the OS resources failed inside the OS kernel. |