Root/
Source at commit HEAD created 12 years 4 months ago. By cosmo1t, moved from googlecode to here | |
---|---|
1 | /* Do what you want with this. ␊ |
2 | This work originates from the ideas of Turbo and the ␊ |
3 | frustrations of cosmo1t the dell owner.␊ |
4 | *␊ |
5 | */␊ |
6 | ␊ |
7 | ␊ |
8 | #include <IOKit/IOService.h>␊ |
9 | #include <IOKit/IOLib.h>␊ |
10 | #include <i386/proc_reg.h>␊ |
11 | ␊ |
12 | ␊ |
13 | ␊ |
14 | //reg define␊ |
15 | #define MSR_IA32_TSC 0x00000010␊ |
16 | ␊ |
17 | ␊ |
18 | ␊ |
19 | //extern fucntion defined in mp.c from xnu␊ |
20 | extern "C" void mp_rendezvous_no_intrs(␊ |
21 | ␉␉␉␉␉␉␉␉␉␉void (*action_func)(void *),␊ |
22 | ␉␉␉␉␉␉␉␉␉␉void *arg);␊ |
23 | extern "C" void mp_broadcast(␊ |
24 | ␉␉␉ void (*action_func)(void *),␊ |
25 | ␉␉␉␉␉␉␉ void *arg);␊ |
26 | ␊ |
27 | extern "C" void rtc_clock_napped(uint64_t base, uint64_t tsc_base);␊ |
28 | ␊ |
29 | /* You can get rid of this if you want, it was used for debugging purposes testing the IOCpuNumber matching**/␊ |
30 | //IOLock * lock;␊ |
31 | //int countCalled;␊ |
32 | ␊ |
33 | class org_voodoo_driver_VoodooTSCSync : public IOService␊ |
34 | ␊ |
35 | {␊ |
36 | ␉␊ |
37 | ␉OSDeclareDefaultStructors(org_voodoo_driver_VoodooTSCSync)␊ |
38 | private:␊ |
39 | ␉void doTSC(void);␊ |
40 | public:␊ |
41 | ␉␊ |
42 | ␊ |
43 | virtual bool init(OSDictionary *dictionary = 0);␊ |
44 | virtual bool start(IOService *provider);␊ |
45 | virtual void stop(IOService *provider);␊ |
46 | virtual IOReturn setPowerState(unsigned long powerStateOrdinal, IOService *whatDevice);␊ |
47 | };␊ |
48 |