F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
Os::Darwin::Cpu Namespace Reference

Classes

class  DarwinCpu
 stub implementation of Os::CpuInterface More...
 
struct  DarwinCpuHandle
 

Functions

kern_return_t cpu_data_helper (processor_cpu_load_info_t &cpu_load_info, FwSizeType &cpu_count)
 helper around raw CPU capture API More...
 
kern_return_t cpu_by_index (FwSizeType cpu_index, FwSizeType &used, FwSizeType &total)
 Query for a single CPU's ticks information. More...
 

Function Documentation

◆ cpu_by_index()

kern_return_t Os::Darwin::Cpu::cpu_by_index ( FwSizeType  cpu_index,
FwSizeType used,
FwSizeType total 
)

Query for a single CPU's ticks information.

Queries all CPU information but only deals with a single CPU's output. This is done because the load average is tracked sample to sample and the call pattern is cpu0, cpu1, ..., cpu last, wait for sample window, cpu0, ... and thus each call should update one CPU's sample or only the last cpu will have the benefit of the sampling window.

Parameters
cpu_indexindex of current CPU being queried
usedfilled with CPU's used ticks count
totalfilled with CPU's total ticks
Returns
success/failure using kern_return_t

Definition at line 47 of file Cpu.cpp.

◆ cpu_data_helper()

kern_return_t Os::Darwin::Cpu::cpu_data_helper ( processor_cpu_load_info_t &  cpu_load_info,
FwSizeType cpu_count 
)

helper around raw CPU capture API

Calls for the CPU information from the machine, improving readability in cpu_by_index

Parameters
cpu_load_infofilled with CPU data
cpu_countfilled with CPU count
Returns
success/failure using kern_return_t

Definition at line 25 of file Cpu.cpp.