1 | /*␊ |
2 | * Copyright (c) 2009 Evan Lojewski. All rights reserved.␊ |
3 | *␊ |
4 | */␊ |
5 | ␊ |
6 | /*␊ |
7 | * Copyright (c) 2010 cparm <armelcadetpetit@gmail.com>. All rights reserved.␊ |
8 | *␊ |
9 | */␊ |
10 | ␊ |
11 | #include "libsaio.h"␊ |
12 | #include "modules.h"␊ |
13 | #include "boot.h"␊ |
14 | #include "bootstruct.h"␊ |
15 | #include "pci_root.h"␊ |
16 | #include "acpi_patcher.h"␊ |
17 | ␊ |
18 | ␊ |
19 | void AcpiPatcher_setupEfiConfigurationTable_hook(void* arg1, void* arg2, void* arg3, void* arg4, void* arg5, void* arg6)␊ |
20 | {␊ |
21 | ␉int *ret = (int *)arg1;␊ |
22 | ␉␊ |
23 | ␉bool enabled = true;␊ |
24 | ␉getBoolForKey(kAcpiPatcher, &enabled, &bootInfo->bootConfig);␊ |
25 | ␉if (enabled == false) ␊ |
26 | ␉{␊ |
27 | ␉␉␊ |
28 | ␉␉*ret = 0;␊ |
29 | ␉␉return;␊ |
30 | ␉␉␊ |
31 | ␉␉␊ |
32 | ␉}␊ |
33 | ␉␉␊ |
34 | ␉// Setup ACPI (mackerintel's patch)␊ |
35 | ␉*ret = setupAcpi();␊ |
36 | ␊ |
37 | }␊ |
38 | ␊ |
39 | void AcpiPatcher_start()␊ |
40 | {␉␊ |
41 | ␉␉␉␊ |
42 | register_hook_callback("setupEfiConfigurationTable", &AcpiPatcher_setupEfiConfigurationTable_hook);␊ |
43 | ␉␊ |
44 | }␊ |
45 | |