Fix compilation after rename and switch to cpp.

This commit is contained in:
Fredrik Holmqvist
2012-07-14 22:19:31 +02:00
parent 775afec4cc
commit cad6c2c536
7 changed files with 48 additions and 49 deletions
@@ -3,8 +3,8 @@
* Copyright 2006, Jérôme Duval. All rights reserved. * Copyright 2006, Jérôme Duval. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#ifndef __ACPI_PRIV_H__ #ifndef _ACPI_PRIVATE_H
#define __ACPI_PRIV_H__ #define _ACPI_PRIVATE_H
#include <sys/cdefs.h> #include <sys/cdefs.h>
@@ -227,4 +227,4 @@ status_t get_table(const char* signature, uint32 instance, void** tableHeader);
__END_DECLS __END_DECLS
#endif /* __ACPI_PRIV_H__ */ #endif /* _ACPI_PRIVATE_H */
@@ -20,11 +20,13 @@
#include <safemode.h> #include <safemode.h>
extern "C" {
#include "acpi.h" #include "acpi.h"
#include "accommon.h" #include "accommon.h"
#include "acdisasm.h" #include "acdisasm.h"
#include "acnamesp.h" #include "acnamesp.h"
#include "acpi_priv.h" }
#include "ACPIPrivate.h"
//#define TRACE_ACPI_BUS //#define TRACE_ACPI_BUS
#ifdef TRACE_ACPI_BUS #ifdef TRACE_ACPI_BUS
@@ -384,7 +386,7 @@ status_t
install_fixed_event_handler(uint32 event, interrupt_handler* handler, install_fixed_event_handler(uint32 event, interrupt_handler* handler,
void *data) void *data)
{ {
return AcpiInstallFixedEventHandler(event, (void*)handler, data) == AE_OK return AcpiInstallFixedEventHandler(event, (ACPI_EVENT_HANDLER)handler, data) == AE_OK
? B_OK : B_ERROR; ? B_OK : B_ERROR;
} }
@@ -392,7 +394,7 @@ install_fixed_event_handler(uint32 event, interrupt_handler* handler,
status_t status_t
remove_fixed_event_handler(uint32 event, interrupt_handler* handler) remove_fixed_event_handler(uint32 event, interrupt_handler* handler)
{ {
return AcpiRemoveFixedEventHandler(event, (void*)handler) == AE_OK return AcpiRemoveFixedEventHandler(event, (ACPI_EVENT_HANDLER)handler) == AE_OK
? B_OK : B_ERROR; ? B_OK : B_ERROR;
} }
@@ -441,7 +443,7 @@ get_device(const char* hid, uint32 index, char* result, size_t resultLength)
char *buffer = NULL; char *buffer = NULL;
TRACE("get_device %s, index %ld\n", hid, index); TRACE("get_device %s, index %ld\n", hid, index);
status = AcpiGetDevices((ACPI_STRING)hid, (void*)&get_device_by_hid_callback, status = AcpiGetDevices((ACPI_STRING)hid, (ACPI_WALK_CALLBACK)&get_device_by_hid_callback,
counter, (void**)&buffer); counter, (void**)&buffer);
if (status != AE_OK || buffer == NULL) if (status != AE_OK || buffer == NULL)
return B_ENTRY_NOT_FOUND; return B_ENTRY_NOT_FOUND;
@@ -523,7 +525,7 @@ get_object(const char* path, acpi_object_type** _returnValue)
status = AcpiEvaluateObject(handle, NULL, NULL, &buffer); status = AcpiEvaluateObject(handle, NULL, NULL, &buffer);
*_returnValue = buffer.Pointer; *_returnValue = (acpi_object_type*)buffer.Pointer;
return status == AE_OK ? B_OK : B_ERROR; return status == AE_OK ? B_OK : B_ERROR;
} }
@@ -545,7 +547,7 @@ get_object_typed(const char* path, acpi_object_type** _returnValue,
status = AcpiEvaluateObjectTyped(handle, NULL, NULL, &buffer, objectType); status = AcpiEvaluateObjectTyped(handle, NULL, NULL, &buffer, objectType);
*_returnValue = buffer.Pointer; *_returnValue = (acpi_object_type*)buffer.Pointer;
return status == AE_OK ? B_OK : B_ERROR; return status == AE_OK ? B_OK : B_ERROR;
} }
@@ -642,7 +644,7 @@ prepare_sleep_state(uint8 state, void (*wakeFunc)(void), size_t size)
status_t status; status_t status;
// Note: The supplied code must already be locked into memory. // Note: The supplied code must already be locked into memory.
status = get_memory_map(wakeFunc, size, &wakeVector, 1); status = get_memory_map((const void*)wakeFunc, size, &wakeVector, 1);
if (status != B_OK) if (status != B_OK)
return status; return status;
@@ -9,8 +9,10 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "acpi_priv.h" #include "ACPIPrivate.h"
extern "C" {
#include "acpi.h" #include "acpi.h"
}
static status_t static status_t
@@ -77,8 +79,6 @@ acpi_device_init_driver(device_node *node, void **cookie)
{ {
ACPI_HANDLE handle; ACPI_HANDLE handle;
const char *path; const char *path;
acpi_device_cookie *device;
status_t status = B_OK;
uint32 type; uint32 type;
if (gDeviceManager->get_attr_uint32(node, ACPI_DEVICE_TYPE_ITEM, &type, false) != B_OK) if (gDeviceManager->get_attr_uint32(node, ACPI_DEVICE_TYPE_ITEM, &type, false) != B_OK)
@@ -86,7 +86,7 @@ acpi_device_init_driver(device_node *node, void **cookie)
if (gDeviceManager->get_attr_string(node, ACPI_DEVICE_PATH_ITEM, &path, false) != B_OK) if (gDeviceManager->get_attr_string(node, ACPI_DEVICE_PATH_ITEM, &path, false) != B_OK)
return B_ERROR; return B_ERROR;
device = malloc(sizeof(*device)); acpi_device_cookie *device = (acpi_device_cookie*)malloc(sizeof(*device));
if (device == NULL) if (device == NULL)
return B_NO_MEMORY; return B_NO_MEMORY;
@@ -102,19 +102,16 @@ acpi_device_init_driver(device_node *node, void **cookie)
device->type = type; device->type = type;
device->node = node; device->node = node;
snprintf(device->name, sizeof(device->name), "acpi_device %s", snprintf(device->name, sizeof(device->name), "acpi_device %s", path);
path);
*cookie = device; *cookie = device;
return B_OK;
return status;
} }
static void static void
acpi_device_uninit_driver(void *cookie) acpi_device_uninit_driver(void *cookie)
{ {
acpi_device_cookie *device = cookie; acpi_device_cookie *device = (acpi_device_cookie*)cookie;
free(device->path); free(device->path);
free(device); free(device);
@@ -28,7 +28,7 @@
*/ */
#include "acpi_embedded_controller.h" #include "EmbeddedController.h"
#include <kernel.h> #include <kernel.h>
#include <stdio.h> #include <stdio.h>
@@ -44,7 +44,7 @@ extern "C" {
# include "accommon.h" # include "accommon.h"
# include "acnamesp.h" # include "acnamesp.h"
# include "actypes.h" # include "actypes.h"
# include "acpi_priv.h" # include "ACPIPrivate.h"
} }
@@ -9,7 +9,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "acpi_priv.h" #include "ACPIPrivate.h"
#include <dpc.h> #include <dpc.h>
#include <PCI.h> #include <PCI.h>
@@ -126,7 +126,7 @@ acpi_enumerate_child_devices(device_node* node, const char* root)
static status_t static status_t
acpi_module_register_child_devices(void* cookie) acpi_module_register_child_devices(void* cookie)
{ {
device_node* node = cookie; device_node* node = (device_node*)cookie;
status_t status = gDeviceManager->publish_device(node, "acpi/namespace", status_t status = gDeviceManager->publish_device(node, "acpi/namespace",
ACPI_NS_DUMP_DEVICE_MODULE_NAME); ACPI_NS_DUMP_DEVICE_MODULE_NAME);
@@ -9,7 +9,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "acpi_priv.h" #include "ACPIPrivate.h"
#include <util/kernel_cpp.h> #include <util/kernel_cpp.h>
#include <util/ring_buffer.h> #include <util/ring_buffer.h>