xref: /freebsd/usr.bin/top/loadavg.h (revision 732a02b4e77866604a120a275c082bb6221bd2ff)
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  *	$FreeBSD$
15  */
16 
17 #ifndef LOADAVG_H
18 #define LOADAVG_H
19 
20 #include <sys/param.h>
21 
22 typedef long pctcpu;
23 #define pctdouble(p) ((double)(p) / FSCALE)
24 
25 typedef fixpt_t load_avg;
26 #define loaddouble(la) ((double)(la) / FSCALE)
27 #endif /* LOADAVG_H */
28