Chameleon

Chameleon Svn Source Tree

Root/branches/meklort/i386/libsaio/cpu.h

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
11extern 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#defineIA32_PERF_STATUS0x198
18#define MSR_FLEX_RATIO0x194
19#defineMSR_PLATFORM_INFO0xCE
20#define K8_FIDVID_STATUS0xC0010042
21#define K10_COFVID_STATUS0xC0010071
22
23#define DEFAULT_FSB100000 /* for now, hardcoding 100MHz for old CPUs */
24
25// DFE: This constant comes from older xnu:
26#define CLKNUM1193182/* formerly 1193167 */
27
28// DFE: These two constants come from Linux except CLOCK_TICK_RATE replaced with CLKNUM
29#define CALIBRATE_TIME_MSEC30/* 30 msecs */
30#define CALIBRATE_LATCH((CLKNUM * CALIBRATE_TIME_MSEC + 1000/2)/1000)
31
32#endif /* !__LIBSAIO_CPU_H */
33

Archive Download this file

Revision: 429