Chameleon

Chameleon Svn Source Tree

Root/branches/cparm/i386/modules/SMBiosGetters/SMBiosGetters.c

1/*
2 * Copyright 2011 cparm <armelcadetpetit@gmail.com>. All rights reserved.
3 */
4#include "boot.h"
5#include "bootstruct.h"
6#include "libsaio.h"
7#include "modules.h"
8#include "Platform.h"
9#include "efi.h"
10#include "mysmbios.h"
11
12void getSmbiosPatched_hook(void* arg1, void* arg2, void* arg3, void* arg4, void* arg5, void* arg6)
13{
14struct SMBEntryPoint *patched_smb = NULL;
15
16execute_hook("ScanMemory", NULL, NULL, NULL, NULL, NULL, NULL);
17setupSMBIOSTable();
18smbios_p = (EFI_PTR32)getSmbiosPatched();
19
20patched_smb = getSmbiosPatched();
21
22if (patched_smb)
23smbios_p = (EFI_PTR32)patched_smb;
24else
25verbose("Error: Could not get patched SMBIOS, fallback to original SMBIOS !!\n");
26
27}
28
29void smbios_helper_hook(void* arg1, void* arg2, void* arg3, void* arg4, void* arg5, void* arg6)
30{
31struct SMBEntryPoint *smbios_o = (struct SMBEntryPoint *)arg1;
32readSMBIOSInfo(smbios_o);
33}
34
35void getProductName_hook(void* arg1, void* arg2, void* arg3, void* arg4, void* arg5, void* arg6)
36{
37setupSmbiosConfigFile("SMBIOS.plist");
38int len = 0;
39const char *val = 0;
40
41if (getValueForKey("SMproductname", &val, &len, &bootInfo->smbiosConfig)) {
42gPlatformName = (char *)val;
43} else {
44gPlatformName = setDefaultSMBData();
45}
46
47}
48
49void SMBiosGetters_start()
50{
51
52register_hook_callback("getSmbiosPatched", &getSmbiosPatched_hook);
53register_hook_callback("smbios_helper", &smbios_helper_hook);
54register_hook_callback("getProductNamePatched", &getProductName_hook);
55}
56

Archive Download this file

Revision: 789