1 | /*␊ |
2 | * Copyright (c) 2010 cparm <armelcadetpetit@gmail.com>. All rights reserved.␊ |
3 | *␊ |
4 | */␊ |
5 | ␊ |
6 | #include "libsaio.h"␊ |
7 | #include "modules.h"␊ |
8 | #include "boot.h"␊ |
9 | #include "bootstruct.h"␊ |
10 | #include "pci_root.h"␊ |
11 | #include "acpi_codec.h"␊ |
12 | ␊ |
13 | #define kEnableAcpi␉"EnableAcpiModule"␊ |
14 | ␊ |
15 | void ACPICodec_setupEfiConfigurationTable_hook(void* arg1, void* arg2, void* arg3, void* arg4, void* arg5, void* arg6)␊ |
16 | {␊ |
17 | ␉EFI_STATUS *ret = (EFI_STATUS *)arg1;␉␊ |
18 | ␉ ␊ |
19 | ␉// Setup ACPI (mackerintel's patch)␊ |
20 | ␉*ret = setupAcpi();␊ |
21 | ␊ |
22 | }␊ |
23 | ␊ |
24 | void is_ACPI_Codec_Registred_Hook(void* arg1, void* arg2, void* arg3, void* arg4, void* arg5, void* arg6){}␊ |
25 | ␊ |
26 | void ACPICodec_start()␊ |
27 | {␉␊ |
28 | ␉bool enable = true;␊ |
29 | ␉getBoolForKey(kEnableAcpi, &enable, &bootInfo->bootConfig) ;␊ |
30 | ␉␊ |
31 | ␉enable = (execute_hook("isACPIRegistred", NULL, NULL, NULL, NULL, NULL, NULL) != EFI_SUCCESS); ␊ |
32 | ␊ |
33 | ␉if (enable)␊ |
34 | ␉{␉␉␊ |
35 | ␉␉register_hook_callback("setupAcpiEfi", &ACPICodec_setupEfiConfigurationTable_hook);␊ |
36 | register_hook_callback("isACPIRegistred", &is_ACPI_Codec_Registred_Hook);␊ |
37 | ␊ |
38 | ␉}␊ |
39 | } |