Chameleon

Chameleon Svn Source Tree

Root/branches/meklort/i386/libsaio/platform.c

Source at commit 521 created 13 years 7 months ago.
By meklort, Modules, Modules everywhere
1/*
2 * platform.c
3 *
4 * AsereBLN: cleanup
5 */
6
7#include "libsaio.h"
8#include "boot.h"
9#include "bootstruct.h"
10#include "pci.h"
11#include "platform.h"
12#include "cpu.h"
13#include "modules.h"
14
15#ifndef DEBUG_PLATFORM
16#define DEBUG_PLATFORM 0
17#endif
18
19#if DEBUG_PLATFORM
20#define DBG(x...)printf(x)
21#else
22#define DBG(x...)
23#endif
24
25PlatformInfo_t Platform;
26pci_dt_t * dram_controller_dev = NULL;
27
28/** Return if a CPU feature specified by feature is activated (true) or not (false) */
29bool platformCPUFeature(uint32_t feature)
30{
31if (Platform.CPU.Features & feature) {
32return true;
33} else {
34return false;
35}
36}
37
38/** scan mem for memory autodection purpose */
39void scan_mem() {
40 static bool done = false;
41 if (done) return;
42
43bool useAutodetection = true;
44 getBoolForKey(kUseMemDetect, &useAutodetection, &bootInfo->bootConfig);
45
46
47 if (useAutodetection) {
48execute_hook("ScanMemory", NULL, NULL, NULL, NULL);
49//getc();
50 }
51 done = true;
52}
53
54/**
55 Scan platform hardware information, called by the main entry point (common_boot() )
56 _before_ bootConfig xml parsing settings are loaded
57*/
58void scan_platform(void)
59{
60memset(&Platform, 0, sizeof(Platform));
61build_pci_dt();
62scan_cpu(&Platform);
63//scan_mem(); Rek: called after pci devs init in fake_efi now ...
64}
65

Archive Download this file

Revision: 521