Root/
Source at commit 355 created 13 years 11 months ago. By meklort, Fixed the rebase + bind code, now works properly. Removed a few ugly hacks. KernelPatcher now loads properly (no more reboots). | |
---|---|
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 |