跳转至

base/include/system/cpu/cfcpu_bonus.h

Declares the CPU extended information query interface. More...

Namespaces

Name
cf

Classes

Name
struct cf::CPUBonusInfoView
Extended CPU information with optional fields.

Detailed Description

Declares the CPU extended information query interface.

Author: Charliechen114514

Version: 0.1

Since: 0.1

Date: 2026-02-22

Provides access to CPU features, cache sizes, big.LITTLE architecture detection, and temperature information. Note that some fields may be unavailable on certain platforms or architectures.

Source code

#pragma once

#include "base/expected/expected.hpp"
#include "base/span/span.h"
#include <cstdint>
#include <optional>
#include <string_view>

namespace cf {

enum class CPUBonusInfoViewError {
    NoError,     
    GeneralError 
};

struct CPUBonusInfoView {
    cf::span<const std::string_view> features;

    cf::span<const uint32_t> cache_size;

    bool has_big_little = false;

    uint32_t big_core_count = 0;

    uint32_t little_core_count = 0;

    std::optional<uint16_t> temperature;
};

expected<CPUBonusInfoView, CPUBonusInfoViewError> getCPUBonusInfo(bool force_refresh = false);

} // namespace cf

Updated on 2026-03-09 at 10:14:01 +0000