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 "bootstruct.h"␊ |
9 | #include "pci_root.h"␊ |
10 | #include "acpi_codec.h"␊ |
11 | ␊ |
12 | #define kEnableAcpi␉"EnableAcpiModule"␊ |
13 | ␊ |
14 | void is_ACPI_Codec_Registred_Hook(void* arg1, void* arg2, void* arg3, void* arg4, void* arg5, void* arg6);␊ |
15 | void ACPICodec_start(void);␊ |
16 | ␊ |
17 | void is_ACPI_Codec_Registred_Hook(void* arg1, void* arg2, void* arg3, void* arg4, void* arg5, void* arg6){}␊ |
18 | ␊ |
19 | void ACPICodec_start(void)␊ |
20 | {␉␊ |
21 | ␉bool enable = true;␊ |
22 | ␉getBoolForKey(kEnableAcpi, &enable, DEFAULT_BOOT_CONFIG) ;␊ |
23 | ␉␊ |
24 | ␉enable = (execute_hook("isACPIRegistred", NULL, NULL, NULL, NULL, NULL, NULL) != EFI_SUCCESS); ␊ |
25 | ␊ |
26 | ␉if (enable)␊ |
27 | ␉{␉␉␊ |
28 | ␉␉replace_system_function("_setup_acpi",&setupAcpi);␊ |
29 | ␊ |
30 | register_hook_callback("isACPIRegistred", &is_ACPI_Codec_Registred_Hook);␊ |
31 | ␊ |
32 | ␉}␊ |
33 | } |