chromium/third_party/cpuinfo/src/src/api.c

#include <stdbool.h>
#include <stddef.h>

#include <cpuinfo.h>
#include <cpuinfo/internal-api.h>
#include <cpuinfo/log.h>

#ifdef __linux__
#include <linux/api.h>

#include <sys/syscall.h>
#include <unistd.h>
#if !defined(__NR_getcpu)
#include <asm-generic/unistd.h>
#endif
#endif

bool cpuinfo_is_initialized =;

struct cpuinfo_processor* cpuinfo_processors =;
struct cpuinfo_core* cpuinfo_cores =;
struct cpuinfo_cluster* cpuinfo_clusters =;
struct cpuinfo_package* cpuinfo_packages =;
struct cpuinfo_cache* cpuinfo_cache[cpuinfo_cache_level_max] =;

uint32_t cpuinfo_processors_count =;
uint32_t cpuinfo_cores_count =;
uint32_t cpuinfo_clusters_count =;
uint32_t cpuinfo_packages_count =;
uint32_t cpuinfo_cache_count[cpuinfo_cache_level_max] =;
uint32_t cpuinfo_max_cache_size =;

#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64 || CPUINFO_ARCH_RISCV32 || CPUINFO_ARCH_RISCV64
struct cpuinfo_uarch_info* cpuinfo_uarchs = NULL;
uint32_t cpuinfo_uarchs_count = 0;
#else
struct cpuinfo_uarch_info cpuinfo_global_uarch =;
#endif

#ifdef __linux__
uint32_t cpuinfo_linux_cpu_max =;
const struct cpuinfo_processor** cpuinfo_linux_cpu_to_processor_map =;
const struct cpuinfo_core** cpuinfo_linux_cpu_to_core_map =;
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64 || CPUINFO_ARCH_RISCV32 || CPUINFO_ARCH_RISCV64
const uint32_t* cpuinfo_linux_cpu_to_uarch_index_map = NULL;
#endif
#endif

const struct cpuinfo_processor* cpuinfo_get_processors(void) {}

const struct cpuinfo_core* cpuinfo_get_cores(void) {}

const struct cpuinfo_cluster* cpuinfo_get_clusters(void) {}

const struct cpuinfo_package* cpuinfo_get_packages(void) {}

const struct cpuinfo_uarch_info* cpuinfo_get_uarchs() {}

const struct cpuinfo_processor* cpuinfo_get_processor(uint32_t index) {}

const struct cpuinfo_core* cpuinfo_get_core(uint32_t index) {}

const struct cpuinfo_cluster* cpuinfo_get_cluster(uint32_t index) {}

const struct cpuinfo_package* cpuinfo_get_package(uint32_t index) {}

const struct cpuinfo_uarch_info* cpuinfo_get_uarch(uint32_t index) {}

uint32_t cpuinfo_get_processors_count(void) {}

uint32_t cpuinfo_get_cores_count(void) {}

uint32_t cpuinfo_get_clusters_count(void) {}

uint32_t cpuinfo_get_packages_count(void) {}

uint32_t cpuinfo_get_uarchs_count(void) {}

const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l1i_caches(void) {}

const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l1d_caches(void) {}

const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l2_caches(void) {}

const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l3_caches(void) {}

const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l4_caches(void) {}

const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l1i_cache(uint32_t index) {}

const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l1d_cache(uint32_t index) {}

const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l2_cache(uint32_t index) {}

const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l3_cache(uint32_t index) {}

const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l4_cache(uint32_t index) {}

uint32_t CPUINFO_ABI cpuinfo_get_l1i_caches_count(void) {}

uint32_t CPUINFO_ABI cpuinfo_get_l1d_caches_count(void) {}

uint32_t CPUINFO_ABI cpuinfo_get_l2_caches_count(void) {}

uint32_t CPUINFO_ABI cpuinfo_get_l3_caches_count(void) {}

uint32_t CPUINFO_ABI cpuinfo_get_l4_caches_count(void) {}

uint32_t CPUINFO_ABI cpuinfo_get_max_cache_size(void) {}

const struct cpuinfo_processor* CPUINFO_ABI cpuinfo_get_current_processor(void) {}

const struct cpuinfo_core* CPUINFO_ABI cpuinfo_get_current_core(void) {}

uint32_t CPUINFO_ABI cpuinfo_get_current_uarch_index(void) {}

uint32_t CPUINFO_ABI cpuinfo_get_current_uarch_index_with_default(uint32_t default_uarch_index) {}