Chameleon

Chameleon Svn Source Tree

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

Source at commit 406 created 13 years 10 months ago.
By azimutz, Consolidating this position: while testing the new theme and boot-log function, i realized that when it comes to verbose boot, using the -v flag on Boot.plist (or typed at boot prompt) and using the Menu (Boot Verbose), doesn't produce the exact same output; using the Menu displays all the messages, while typing -v causes some of the first messages to disappear. So, moving this to an early stage isn't anymore a question of what is printed to screen or not! Tests also showed another diff: when using -v flag typed, the Boot Banner is cleared and messages start to print right away, while using Boot Verbose on the Menu, keeps the Banner, prints the first 2 or 3 messages right below it and the rest are only printed, when this code runs and does it's thing. Moving the code to this position fixes this glitch.
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: 406