1 | /*␊ |
2 | * platform.c␊ |
3 | *␊ |
4 | * AsereBLN: cleanup␊ |
5 | */␊ |
6 | ␊ |
7 | #include "libsaio.h"␊ |
8 | #include "bootstruct.h"␊ |
9 | #include "pci.h"␊ |
10 | #include "platform.h"␊ |
11 | #include "cpu.h"␊ |
12 | #include "mem.h"␊ |
13 | ␊ |
14 | #ifndef DEBUG_PLATFORM␊ |
15 | #define DEBUG_PLATFORM 0␊ |
16 | #endif␊ |
17 | ␊ |
18 | #if DEBUG_PLATFORM␊ |
19 | #define DBG(x...)␉printf(x)␊ |
20 | #else␊ |
21 | #define DBG(x...)␊ |
22 | #endif␊ |
23 | ␊ |
24 | PlatformInfo_t Platform;␊ |
25 | ␊ |
26 | bool platformCPUFeature(uint32_t feature)␊ |
27 | {␊ |
28 | ␉if (Platform.CPU.Features & feature) {␊ |
29 | ␉␉return true;␊ |
30 | ␉} else {␊ |
31 | ␉␉return false;␊ |
32 | ␉}␊ |
33 | }␊ |
34 | ␊ |
35 | void scan_platform(void)␊ |
36 | {␊ |
37 | ␉memset(&Platform, 0, sizeof(Platform));␊ |
38 | ␉build_pci_dt();␊ |
39 | ␉scan_cpu(&Platform);␊ |
40 | ␉scan_memory(&Platform);␊ |
41 | ␉scan_spd(&Platform);␊ |
42 | }␊ |
43 | |