Root/
Source at commit 429 created 13 years 9 months ago. By meklort, Updated module system. Hooks can now be used within modules when cetaion functions are called in chameleon. Note that onle two hooks currently exist, more need to be added. I also updated the HelloWorld module to use a hook instead of print out right away. | |
---|---|
1 | /*␊ |
2 | * Copyright 2008 Islam Ahmed Zaid. All rights reserved. <azismed@gmail.com>␊ |
3 | * AsereBLN: 2009: cleanup and bugfix␊ |
4 | */␊ |
5 | ␊ |
6 | #ifndef __LIBSAIO_CPU_H␊ |
7 | #define __LIBSAIO_CPU_H␊ |
8 | ␊ |
9 | #include "libsaio.h"␊ |
10 | ␊ |
11 | extern void scan_cpu(PlatformInfo_t *);␊ |
12 | ␊ |
13 | #define bit(n)␉␉␉(1UL << (n))␊ |
14 | #define bitmask(h,l)␉␉((bit(h)|(bit(h)-1)) & ~(bit(l)-1))␊ |
15 | #define bitfield(x,h,l)␉␉(((x) & bitmask(h,l)) >> l)␊ |
16 | ␊ |
17 | #define␉IA32_PERF_STATUS␉0x198␊ |
18 | #define MSR_FLEX_RATIO␉␉0x194␊ |
19 | #define␉MSR_PLATFORM_INFO␉0xCE␊ |
20 | #define K8_FIDVID_STATUS␉0xC0010042␊ |
21 | #define K10_COFVID_STATUS␉0xC0010071␊ |
22 | ␊ |
23 | #define DEFAULT_FSB␉␉100000 /* for now, hardcoding 100MHz for old CPUs */␊ |
24 | ␊ |
25 | // DFE: This constant comes from older xnu:␊ |
26 | #define CLKNUM␉␉␉1193182␉␉/* formerly 1193167 */␊ |
27 | ␊ |
28 | // DFE: These two constants come from Linux except CLOCK_TICK_RATE replaced with CLKNUM␊ |
29 | #define CALIBRATE_TIME_MSEC␉30␉␉/* 30 msecs */␊ |
30 | #define CALIBRATE_LATCH␉␉((CLKNUM * CALIBRATE_TIME_MSEC + 1000/2)/1000)␊ |
31 | ␊ |
32 | #endif /* !__LIBSAIO_CPU_H */␊ |
33 |