xref: /freebsd/usr.bin/top/loadavg.h (revision 2e3f49888ec8851bafb22011533217487764fdb0)
1 /*
2  *  Top - a top users display for Berkeley Unix
3  *
4  *  Defines required to access load average figures.
5  *
6  *  This include file sets up everything we need to access the load average
7  *  values in the kernel in a machine independent way.  First, it sets the
8  *  typedef "load_avg" to be either double or long (depending on what is
9  *  needed), then it defines these macros appropriately:
10  *
11  *	loaddouble(la) - convert load_avg to double.
12  *	intload(i)     - convert integer to load_avg.
13  */
14 
15 #ifndef LOADAVG_H
16 #define LOADAVG_H
17 
18 #include <sys/param.h>
19 
20 typedef long pctcpu;
21 #define pctdouble(p) ((double)(p) / FSCALE)
22 
23 typedef fixpt_t load_avg;
24 #define loaddouble(la) ((double)(la) / FSCALE)
25 #endif /* LOADAVG_H */
26