Chameleon

Chameleon Svn Source Tree

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

  • Property svn:executable set to *
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
15void ACPICodec_setupEfiConfigurationTable_hook(void* arg1, void* arg2, void* arg3, void* arg4, void* arg5, void* arg6)
16{
17EFI_STATUS *ret = (EFI_STATUS *)arg1;
18
19// Setup ACPI (mackerintel's patch)
20*ret = setupAcpi();
21
22}
23
24void is_ACPI_Codec_Registred_Hook(void* arg1, void* arg2, void* arg3, void* arg4, void* arg5, void* arg6){}
25
26void ACPICodec_start()
27{
28bool enable = true;
29getBoolForKey(kEnableAcpi, &enable, &bootInfo->bootConfig) ;
30
31/*
32 * This method is not perfect (symbols collisions between two modules with that provide the same service is still possible,
33 * (as well as two module with a different service but there is more chance of collisions if dthey do the same thing)
34 * even if one of them have been disabled by this method and have no hook registred), will be deprecated soon.
35 *
36 * Possible solutions:
37 *
38 * 1 - check the symbols list each time a symbols is loaded to avoid double symbol (slow, may be buggy)
39 *
40 * 2 - categorize all symbols by callers (hard to implement)
41 *
42 * 3 - ????, will work great at least for modules with the same service
43 *
44 *
45 *
46 */
47 enable = (execute_hook("isACPIRegistred", NULL, NULL, NULL, NULL, NULL, NULL) != EFI_SUCCESS);
48
49if (enable) {
50register_hook_callback("setupEfiConfigurationTable", &ACPICodec_setupEfiConfigurationTable_hook);
51 register_hook_callback("isACPIRegistred", &is_ACPI_Codec_Registred_Hook);
52
53}
54}

Archive Download this file

Revision: 1119