Author: tkreuzer
Date: Thu May 21 23:47:30 2009
New Revision: 41034
URL:
http://svn.reactos.org/svn/reactos?rev=41034&view=rev
Log:
ACPI: Several 64 bit fixes, TODO: fix amd64 assembly in platform/acgcc.h
Modified:
branches/ros-amd64-bringup/reactos/drivers/bus/acpi/dispatcher/dswexec.c
branches/ros-amd64-bringup/reactos/drivers/bus/acpi/events/evevent.c
branches/ros-amd64-bringup/reactos/drivers/bus/acpi/include/acdispat.h
branches/ros-amd64-bringup/reactos/drivers/bus/acpi/include/actypes.h
branches/ros-amd64-bringup/reactos/drivers/bus/acpi/include/platform/acgcc.h
branches/ros-amd64-bringup/reactos/drivers/bus/acpi/ospm/fdo.c
branches/ros-amd64-bringup/reactos/drivers/bus/acpi/ospm/osl.c
branches/ros-amd64-bringup/reactos/drivers/bus/acpi/utils/cminit.c
Modified: branches/ros-amd64-bringup/reactos/drivers/bus/acpi/dispatcher/dswexec.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/drive…
==============================================================================
--- branches/ros-amd64-bringup/reactos/drivers/bus/acpi/dispatcher/dswexec.c [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/drivers/bus/acpi/dispatcher/dswexec.c [iso-8859-1]
Thu May 21 23:47:30 2009
@@ -47,7 +47,7 @@
acpi_ds_get_predicate_value (
ACPI_WALK_STATE *walk_state,
ACPI_PARSE_OBJECT *op,
- u32 has_result_obj)
+ NATIVE_UINT has_result_obj)
{
ACPI_STATUS status = AE_OK;
ACPI_OPERAND_OBJECT *obj_desc;
@@ -615,7 +615,7 @@
(walk_state->control_state->common.state ==
CONTROL_PREDICATE_EXECUTING) &&
(walk_state->control_state->control.predicate_op == op)) {
- status = acpi_ds_get_predicate_value (walk_state, op, (u32) result_obj);
+ status = acpi_ds_get_predicate_value (walk_state, op, (NATIVE_UINT) result_obj);
result_obj = NULL;
}
Modified: branches/ros-amd64-bringup/reactos/drivers/bus/acpi/events/evevent.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/drive…
==============================================================================
--- branches/ros-amd64-bringup/reactos/drivers/bus/acpi/events/evevent.c [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/drivers/bus/acpi/events/evevent.c [iso-8859-1] Thu
May 21 23:47:30 2009
@@ -634,7 +634,7 @@
acpi_ev_asynch_execute_gpe_method (
void *context)
{
- u32 gpe_number = (u32) context;
+ NATIVE_UINT gpe_number = (NATIVE_UINT) context;
ACPI_GPE_LEVEL_INFO gpe_info;
Modified: branches/ros-amd64-bringup/reactos/drivers/bus/acpi/include/acdispat.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/drive…
==============================================================================
--- branches/ros-amd64-bringup/reactos/drivers/bus/acpi/include/acdispat.h [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/drivers/bus/acpi/include/acdispat.h [iso-8859-1]
Thu May 21 23:47:30 2009
@@ -87,7 +87,7 @@
acpi_ds_get_predicate_value (
ACPI_WALK_STATE *walk_state,
ACPI_PARSE_OBJECT *op,
- u32 has_result_obj);
+ NATIVE_UINT has_result_obj);
ACPI_STATUS
acpi_ds_exec_begin_op (
Modified: branches/ros-amd64-bringup/reactos/drivers/bus/acpi/include/actypes.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/drive…
==============================================================================
--- branches/ros-amd64-bringup/reactos/drivers/bus/acpi/include/actypes.h [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/drivers/bus/acpi/include/actypes.h [iso-8859-1] Thu
May 21 23:47:30 2009
@@ -49,17 +49,17 @@
*/
-#ifdef _IA64
+#if defined (_IA64) || defined(_AMD64_)
/*
* 64-bit type definitions
*/
-typedef unsigned char UINT8;
-typedef unsigned char BOOLEAN;
-typedef unsigned char UCHAR;
-typedef unsigned short UINT16;
-typedef int INT32;
-typedef unsigned int UINT32;
-typedef COMPILER_DEPENDENT_UINT64 UINT64;
+//typedef unsigned char UINT8;
+//typedef unsigned char BOOLEAN;
+//typedef unsigned char UCHAR;
+//typedef unsigned short UINT16;
+//typedef int INT32;
+//typedef unsigned int UINT32;
+//typedef COMPILER_DEPENDENT_UINT64 UINT64;
typedef UINT64 NATIVE_UINT;
typedef INT64 NATIVE_INT;
Modified: branches/ros-amd64-bringup/reactos/drivers/bus/acpi/include/platform/acgcc.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/drive…
==============================================================================
--- branches/ros-amd64-bringup/reactos/drivers/bus/acpi/include/platform/acgcc.h
[iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/drivers/bus/acpi/include/platform/acgcc.h
[iso-8859-1] Thu May 21 23:47:30 2009
@@ -92,8 +92,50 @@
} while (0)
/*! [End] no source code translation !*/
+#elif defined (_AMD64_)
+
+#define COMPILER_DEPENDENT_UINT64 unsigned long long
+#define ACPI_ASM_MACROS
+#define causeinterrupt(level)
+#define BREAKPOINT3
+#define disable() __cli()
+#define enable() __sti()
+#define halt() __asm__ __volatile__ ("sti; hlt":::"memory")
+#define wbinvd()
+
+/*! [Begin] no source code translation
+ *
+ * A brief explanation as GNU inline assembly is a bit hairy
+ * %0 is the output parameter in EAX ("=a")
+ * %1 and %2 are the input parameters in ECX ("c")
+ * and an immediate value ("i") respectively
+ * All actual register references are preceded with "%%" as in
"%%edx"
+ * Immediate values in the assembly are preceded by "$" as in
"$0x1"
+ * The final asm parameter are the operation altered non-output registers.
+ */
+
+// FIXME: These are only sonly stubs to make it compile
+
+#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \
+ do { \
+ int dummy; \
+ asm("1: movl (%1),%%eax;" \
+ "movl %%eax,%%edx;" \
+ :"=a"(Acq),"=c"(dummy):"c"(GLptr),"i"(~1L):"dx");
\
+ } while(0)
+
+#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \
+ do { \
+ int dummy; \
+ asm("1: movl (%1),%%eax;" \
+ "movl %%eax,%%edx;" \
+ :"=a"(Acq),"=c"(dummy):"c"(GLptr),"i"(~3L):"dx");
\
+ } while(0)
+
+/*! [End] no source code translation !*/
#else /* DO IA32 */
+
#define COMPILER_DEPENDENT_UINT64 unsigned long long
#define ACPI_ASM_MACROS
#define causeinterrupt(level)
Modified: branches/ros-amd64-bringup/reactos/drivers/bus/acpi/ospm/fdo.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/drive…
==============================================================================
--- branches/ros-amd64-bringup/reactos/drivers/bus/acpi/ospm/fdo.c [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/drivers/bus/acpi/ospm/fdo.c [iso-8859-1] Thu May 21
23:47:30 2009
@@ -402,7 +402,7 @@
case io:
{
IO_RESOURCE *io_data = (IO_RESOURCE*) &resource->data;
- if (KdComPortInUse == (PUCHAR)io_data->min_base_address)
+ if (KdComPortInUse == UlongToPtr(io_data->min_base_address))
{
ExFreePool(Buffer.pointer);
return TRUE;
@@ -600,7 +600,7 @@
CurrentEntry = CurrentEntry->Flink;
}
- Irp->IoStatus.Information = (ULONG)Relations;
+ Irp->IoStatus.Information = (ULONG_PTR)Relations;
return Status;
}
Modified: branches/ros-amd64-bringup/reactos/drivers/bus/acpi/ospm/osl.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/drive…
==============================================================================
--- branches/ros-amd64-bringup/reactos/drivers/bus/acpi/ospm/osl.c [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/drivers/bus/acpi/ospm/osl.c [iso-8859-1] Thu May 21
23:47:30 2009
@@ -305,37 +305,37 @@
u8
acpi_os_mem_in8 (ACPI_PHYSICAL_ADDRESS phys_addr)
{
- return (*(PUCHAR)(ULONG)phys_addr);
+ return (*(PUCHAR)(ULONG_PTR)phys_addr);
}
u16
acpi_os_mem_in16 (ACPI_PHYSICAL_ADDRESS phys_addr)
{
- return (*(PUSHORT)(ULONG)phys_addr);
+ return (*(PUSHORT)(ULONG_PTR)phys_addr);
}
u32
acpi_os_mem_in32 (ACPI_PHYSICAL_ADDRESS phys_addr)
{
- return (*(PULONG)(ULONG)phys_addr);
+ return (*(PULONG)(ULONG_PTR)phys_addr);
}
void
acpi_os_mem_out8 (ACPI_PHYSICAL_ADDRESS phys_addr, u8 value)
{
- *(PUCHAR)(ULONG)phys_addr = value;
+ *(PUCHAR)(ULONG_PTR)phys_addr = value;
}
void
acpi_os_mem_out16 (ACPI_PHYSICAL_ADDRESS phys_addr, u16 value)
{
- *(PUSHORT)(ULONG)phys_addr = value;
+ *(PUSHORT)(ULONG_PTR)phys_addr = value;
}
void
acpi_os_mem_out32 (ACPI_PHYSICAL_ADDRESS phys_addr, u32 value)
{
- *(PULONG)(ULONG)phys_addr = value;
+ *(PULONG)(ULONG_PTR)phys_addr = value;
}
ACPI_STATUS
@@ -702,5 +702,5 @@
u32
acpi_os_get_thread_id (void)
{
- return (ULONG)PsGetCurrentThreadId() + 1;
-}
+ return (ULONG_PTR)PsGetCurrentThreadId() + 1;
+}
Modified: branches/ros-amd64-bringup/reactos/drivers/bus/acpi/utils/cminit.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/drive…
==============================================================================
--- branches/ros-amd64-bringup/reactos/drivers/bus/acpi/utils/cminit.c [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/drivers/bus/acpi/utils/cminit.c [iso-8859-1] Thu
May 21 23:47:30 2009
@@ -30,7 +30,7 @@
MODULE_NAME ("cminit")
-#define ACPI_OFFSET(d,o) ((u32) &(((d *)0)->o))
+#define ACPI_OFFSET(d,o) ((NATIVE_INT) &(((d *)0)->o))
#define ACPI_FADT_OFFSET(o) ACPI_OFFSET (FADT_DESCRIPTOR, o)
/*******************************************************************************