F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
SystemResources.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title Baremetal/SystemResources.cpp
3 // \author mstarch
4 // \brief cpp file for SystemResources component implementation class
5 //
6 // \copyright
7 // Copyright 2021, by the California Institute of Technology.
8 // ALL RIGHTS RESERVED. United States Government Sponsorship
9 // acknowledged.
10 //
11 // ======================================================================
12 
13 #include <Os/SystemResources.hpp>
14 
15 namespace Os {
16 
18  // Assumes 1 CPU
19  cpuCount = 1;
20  return SYSTEM_RESOURCES_OK;
21 }
22 
24  // Always 100 percent
25  cpu_ticks.used = 1;
26  cpu_ticks.total = 1;
27  return SYSTEM_RESOURCES_OK;
28 }
29 
30 
32  // Always 100 percent
33  memory_util.total = 1;
34  memory_util.used = 1;
35  return SYSTEM_RESOURCES_OK;
36 }
37 } // namespace Os
SystemResourcesStatus getCpuTicks(CpuTicks &ticks, U32 cpu_index=0)
Get the CPU tick information for a given CPU.
SystemResourcesStatus getMemUtil(MemUtil &memory_util)
Get system memory usage.
SystemResourcesStatus getCpuCount(U32 &cpu_count)
Request the count of the CPUs detected by the system.
@ SYSTEM_RESOURCES_OK
Call was successful.
Definition: File.cpp:6
FwSizeType total
Filled with total CPU ticks.
FwSizeType used
Filled with non-idle (system, user) CPU ticks.
FwSizeType used
Filled with used bytes of volatile memory (permanent, paged-in)
FwSizeType total
Filled with total non-volatile memory.