00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef SA_CPU
00022 #warning You should not include this file directly from your program.
00023 #endif
00024
00029 #ifndef SA_COMMON_CPU_H_
00030 #define SA_COMMON_CPU_H_
00031
00032 #define SA_VERSION_MAJOR 0
00033 #define SA_VERSION_SMALL 5
00034 #define SA_VERSION_MINOR 4
00035
00039 SA_EXPORT struct sa_cpu {
00040 #ifdef SA_CPU_ID
00041 uint16_t id;
00042 #endif
00043 #ifdef SA_CPU_USER
00044 float user;
00045 #endif
00046 #ifdef SA_CPU_NICE
00047 float nice;
00048 #endif
00049 #ifdef SA_CPU_SYSTEM
00050 float system;
00051 #endif
00052 #ifdef SA_CPU_IDLE
00053 float idle;
00054 #endif
00055 #ifdef SA_CPU_WAITING_FOR_IO
00056 float waiting_for_io;
00057 #endif
00058 #ifdef SA_CPU_HARDWARE_IRQ
00059 float hardware_irq;
00060 #endif
00061 #ifdef SA_CPU_SOFTWARE_IRQ
00062 float software_irq;
00063 #endif
00064 #ifdef SA_CPU_STOLEN
00065 float stolen;
00066 #endif
00067 #ifdef SA_CPU_INTR
00068 float intr;
00069 #endif
00070 };
00071
00072 #ifdef SA_OPEN_CPU
00073
00078 SA_EXPORT int sa_open_cpu(void);
00079 #endif
00080
00081 #ifdef SA_CLOSE_CPU
00082
00087 SA_EXPORT int sa_close_cpu(void);
00088 #endif
00089
00095 SA_EXPORT int sa_count_cpus(uint16_t* number);
00096
00104 SA_EXPORT int sa_get_cpu(uint16_t index, struct sa_cpu* dst);
00105
00114 SA_EXPORT int sa_get_cpus(struct sa_cpu* dst, uint16_t dst_size, uint16_t* written);
00115
00117 #endif