Skip to content

Commit

Permalink
Update the features_cpu.h docs
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseTG committed Oct 10, 2023
1 parent deec422 commit 87ea39a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 46 deletions.
28 changes: 0 additions & 28 deletions libretro-common/features/features_cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,6 @@ static int ra_clock_gettime(int clk_ik, struct timespec *t)

#include <string.h>

/**
* cpu_features_get_perf_counter:
*
* Gets performance counter.
*
* @return Performance counter.
**/
retro_perf_tick_t cpu_features_get_perf_counter(void)
{
retro_perf_tick_t time_ticks = 0;
Expand Down Expand Up @@ -218,13 +211,6 @@ retro_perf_tick_t cpu_features_get_perf_counter(void)
return time_ticks;
}

/**
* cpu_features_get_time_usec:
*
* Gets time in microseconds.
*
* @return Time in microseconds.
**/
retro_time_t cpu_features_get_time_usec(void)
{
#if defined(_WIN32)
Expand Down Expand Up @@ -503,13 +489,6 @@ static void cpulist_read_from(CpuList* list, const char* filename)

#endif

/**
* cpu_features_get_core_amount:
*
* Gets the amount of available CPU cores.
*
* @return Amount of CPU cores available.
**/
unsigned cpu_features_get_core_amount(void)
{
#if defined(_WIN32) && !defined(_XBOX)
Expand Down Expand Up @@ -609,13 +588,6 @@ unsigned cpu_features_get_core_amount(void)
#define VENDOR_INTEL_c 0x6c65746e
#define VENDOR_INTEL_d 0x49656e69

/**
* cpu_features_get:
*
* Gets CPU features..
*
* @return Bitmask of all CPU features available.
**/
uint64_t cpu_features_get(void)
{
uint64_t cpu = 0;
Expand Down
56 changes: 38 additions & 18 deletions libretro-common/include/features/features_cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,42 +32,62 @@
RETRO_BEGIN_DECLS

/**
* cpu_features_get_perf_counter:
* Gets the time in ticks since some unspecified epoch.
* The notion of a "tick" varies per platform.
*
* Gets performance counter.
* The epoch may change between devices or across reboots.
*
* @return Performance counter.
**/
* Suitable for use as a default implementation of \c retro_perf_callback::get_perf_counter,
* (or as a fallback by the core),
* although a frontend may provide its own implementation.
*
* @return The current time, in ticks.
* @see retro_perf_callback::get_perf_counter
*/
retro_perf_tick_t cpu_features_get_perf_counter(void);

/**
* cpu_features_get_time_usec:
* Gets the time in microseconds since some unspecified epoch.
*
* The epoch may change between devices or across reboots.
*
* Gets time in microseconds, from an undefined epoch.
* The epoch may change between computers or across reboots.
* Suitable for use as a default implementation of \c retro_perf_callback::get_time_usec,
* (or as a fallback by the core),
* although a frontend may provide its own implementation.
*
* @return Time in microseconds
**/
* @return The current time, in microseconds.
* @see retro_perf_callback::get_time_usec
*/
retro_time_t cpu_features_get_time_usec(void);

/**
* cpu_features_get:
* Returns the available features (mostly SIMD extensions)
* supported by this CPU.
*
* Gets CPU features.
* Suitable for use as a default implementation of \c retro_perf_callback::get_time_usec,
* (or as a fallback by the core),
* although a frontend may provide its own implementation.
*
* @return Bitmask of all CPU features available.
**/
* @see RETRO_SIMD
* @see retro_perf_callback::get_cpu_features
*/
uint64_t cpu_features_get(void);

/**
* cpu_features_get_core_amount:
*
* Gets the amount of available CPU cores.
*
* @return Amount of CPU cores available.
**/
* @return The number of CPU cores available,
* or 1 if the number of cores could not be determined.
*/
unsigned cpu_features_get_core_amount(void);

/**
* Returns the name of the CPU model.
*
* @param[out] name Pointer to a buffer to store the name.
* Will be \c NULL-terminated.
* If \c NULL, this value will not be modified.
* @param len The amount of space available in \c name.
*/
void cpu_features_get_model_name(char *name, int len);

RETRO_END_DECLS
Expand Down

0 comments on commit 87ea39a

Please sign in to comment.