Chameleon

Chameleon Svn Source Tree

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

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"
10extern void scan_cpu(PlatformInfo_t *);
11
12#define bit(n)(1UL << (n))
13#define bitmask(h,l)((bit(h)|(bit(h)-1)) & ~(bit(l)-1))
14#define bitfield(x,h,l)(((x) & bitmask(h,l)) >> l)
15
16#define MSR_FSB_FREQ0x000000cd
17#define MSR_IA32_PLATFORM_ID0x00000017
18#defineIA32_PERF_STATUS0x198
19#define MSR_FLEX_RATIO0x194
20#defineMSR_PLATFORM_INFO0xCE
21#define K8_FIDVID_STATUS0xC0010042
22#define K10_COFVID_STATUS0xC0010071
23
24#define DEFAULT_FSB100000 /* for now, hardcoding 100MHz for old CPUs */
25
26// DFE: This constant comes from older xnu:
27#define CLKNUM1193182/* formerly 1193167 */
28
29// DFE: These two constants come from Linux except CLOCK_TICK_RATE replaced with CLKNUM
30#define CALIBRATE_TIME_MSEC30/* 30 msecs */
31#define CALIBRATE_LATCH((CLKNUM * CALIBRATE_TIME_MSEC + 1000/2)/1000)
32
33#endif /* !__LIBSAIO_CPU_H */
34

Archive Download this file

Revision: 177