Author: tkreuzer
Date: Sun Sep 21 09:40:17 2008
New Revision: 36380
URL:
http://svn.reactos.org/svn/reactos?rev=36380&view=rev
Log:
Implement some functions that are forwarded to HAL on x86 build, but not on x64. Modify
spec file (use preprocessor macro). Now scsiport can be loaded and freeldr doesn't
complain about missing imports.
Added:
branches/ros-amd64-bringup/reactos/drivers/storage/scsiport/stubs.c (with props)
Modified:
branches/ros-amd64-bringup/reactos/drivers/storage/scsiport/scsiport.rbuild
branches/ros-amd64-bringup/reactos/drivers/storage/scsiport/scsiport.spec
Modified: branches/ros-amd64-bringup/reactos/drivers/storage/scsiport/scsiport.rbuild
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/drive…
==============================================================================
--- branches/ros-amd64-bringup/reactos/drivers/storage/scsiport/scsiport.rbuild
[iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/drivers/storage/scsiport/scsiport.rbuild
[iso-8859-1] Sun Sep 21 09:40:17 2008
@@ -10,4 +10,7 @@
<file>scsiport.c</file>
<file>scsiport.rc</file>
<file>scsiport.spec</file>
+ <if property="ARCH" value="amd64">
+ <file>stubs.c</file>
+ </if>
</module>
Modified: branches/ros-amd64-bringup/reactos/drivers/storage/scsiport/scsiport.spec
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/drive…
==============================================================================
--- branches/ros-amd64-bringup/reactos/drivers/storage/scsiport/scsiport.spec [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/drivers/storage/scsiport/scsiport.spec [iso-8859-1]
Sun Sep 21 09:40:17 2008
@@ -1,7 +1,13 @@
+#ifdef _M_AMD64
+#define MAYBEFWD(x)
+#else
+#define MAYBEFWD(x) x
+#endif
+
@ cdecl ScsiDebugPrint()
@ stdcall ScsiPortCompleteRequest(ptr long long long long)
@ stdcall ScsiPortConvertPhysicalAddressToUlong(long long)
-@ stdcall ScsiPortConvertUlongToPhysicalAddress(long)
NTOSKRNL.RtlConvertUlongToLargeInteger
+@ stdcall ScsiPortConvertUlongToPhysicalAddress(long)
MAYBEFWD(NTOSKRNL.RtlConvertUlongToLargeInteger)
@ stdcall ScsiPortFlushDma(ptr)
@ stdcall ScsiPortFreeDeviceBase(ptr ptr)
@ stdcall ScsiPortGetBusData(ptr long long long ptr long)
@@ -16,30 +22,30 @@
@ stdcall ScsiPortLogError(ptr ptr long long long long long)
@ stdcall ScsiPortMoveMemory(ptr ptr long)
@ cdecl ScsiPortNotification()
-@ stdcall ScsiPortReadPortBufferUchar(ptr ptr long) HAL.READ_PORT_BUFFER_UCHAR
-@ stdcall ScsiPortReadPortBufferUshort(ptr ptr long) HAL.READ_PORT_BUFFER_USHORT
-@ stdcall ScsiPortReadPortBufferUlong(ptr ptr long) HAL.READ_PORT_BUFFER_ULONG
-@ stdcall ScsiPortReadPortUchar(ptr) HAL.READ_PORT_UCHAR
-@ stdcall ScsiPortReadPortUshort(ptr) HAL.READ_PORT_USHORT
-@ stdcall ScsiPortReadPortUlong(ptr) HAL.READ_PORT_ULONG
-@ stdcall ScsiPortReadRegisterBufferUchar(ptr ptr long)
NTOSKRNL.READ_REGISTER_BUFFER_UCHAR
-@ stdcall ScsiPortReadRegisterBufferUshort(ptr ptr long)
NTOSKRNL.READ_REGISTER_BUFFER_USHORT
-@ stdcall ScsiPortReadRegisterBufferUlong(ptr ptr long)
NTOSKRNL.READ_REGISTER_BUFFER_ULONG
-@ stdcall ScsiPortReadRegisterUchar(ptr) NTOSKRNL.READ_REGISTER_UCHAR
-@ stdcall ScsiPortReadRegisterUshort(ptr) NTOSKRNL.READ_REGISTER_USHORT
-@ stdcall ScsiPortReadRegisterUlong(ptr) NTOSKRNL.READ_REGISTER_ULONG
+@ stdcall ScsiPortReadPortBufferUchar(ptr ptr long) MAYBEFWD(HAL.READ_PORT_BUFFER_UCHAR)
+@ stdcall ScsiPortReadPortBufferUshort(ptr ptr long)
MAYBEFWD(HAL.READ_PORT_BUFFER_USHORT)
+@ stdcall ScsiPortReadPortBufferUlong(ptr ptr long) MAYBEFWD(HAL.READ_PORT_BUFFER_ULONG)
+@ stdcall ScsiPortReadPortUchar(ptr) MAYBEFWD(HAL.READ_PORT_UCHAR)
+@ stdcall ScsiPortReadPortUshort(ptr) MAYBEFWD(HAL.READ_PORT_USHORT)
+@ stdcall ScsiPortReadPortUlong(ptr) MAYBEFWD(HAL.READ_PORT_ULONG)
+@ stdcall ScsiPortReadRegisterBufferUchar(ptr ptr long)
MAYBEFWD(NTOSKRNL.READ_REGISTER_BUFFER_UCHAR)
+@ stdcall ScsiPortReadRegisterBufferUshort(ptr ptr long)
MAYBEFWD(NTOSKRNL.READ_REGISTER_BUFFER_USHORT)
+@ stdcall ScsiPortReadRegisterBufferUlong(ptr ptr long)
MAYBEFWD(NTOSKRNL.READ_REGISTER_BUFFER_ULONG)
+@ stdcall ScsiPortReadRegisterUchar(ptr) MAYBEFWD(NTOSKRNL.READ_REGISTER_UCHAR)
+@ stdcall ScsiPortReadRegisterUshort(ptr) MAYBEFWD(NTOSKRNL.READ_REGISTER_USHORT)
+@ stdcall ScsiPortReadRegisterUlong(ptr) MAYBEFWD(NTOSKRNL.READ_REGISTER_ULONG)
@ stdcall ScsiPortSetBusDataByOffset(ptr long long long ptr long long)
@ stdcall ScsiPortStallExecution(long) HAL.KeStallExecutionProcessor
@ stdcall ScsiPortValidateRange(ptr long long long long long long)
-@ stdcall ScsiPortWritePortBufferUchar(ptr ptr long) HAL.WRITE_PORT_BUFFER_UCHAR
-@ stdcall ScsiPortWritePortBufferUshort(ptr ptr long) HAL.WRITE_PORT_BUFFER_USHORT
-@ stdcall ScsiPortWritePortBufferUlong(ptr ptr long) HAL.WRITE_PORT_BUFFER_ULONG
-@ stdcall ScsiPortWritePortUchar(ptr long) HAL.WRITE_PORT_UCHAR
-@ stdcall ScsiPortWritePortUshort(ptr long) HAL.WRITE_PORT_USHORT
-@ stdcall ScsiPortWritePortUlong(ptr long) HAL.WRITE_PORT_ULONG
-@ stdcall ScsiPortWriteRegisterBufferUchar(ptr ptr long)
NTOSKRNL.WRITE_REGISTER_BUFFER_UCHAR
-@ stdcall ScsiPortWriteRegisterBufferUshort(ptr ptr long)
NTOSKRNL.WRITE_REGISTER_BUFFER_USHORT
-@ stdcall ScsiPortWriteRegisterBufferUlong(ptr ptr long)
NTOSKRNL.WRITE_REGISTER_BUFFER_ULONG
-@ stdcall ScsiPortWriteRegisterUchar(ptr long) NTOSKRNL.WRITE_REGISTER_UCHAR
-@ stdcall ScsiPortWriteRegisterUshort(ptr long) NTOSKRNL.WRITE_REGISTER_USHORT
-@ stdcall ScsiPortWriteRegisterUlong(ptr long) NTOSKRNL.WRITE_REGISTER_ULONG
+@ stdcall ScsiPortWritePortBufferUchar(ptr ptr long)
MAYBEFWD(HAL.WRITE_PORT_BUFFER_UCHAR)
+@ stdcall ScsiPortWritePortBufferUshort(ptr ptr long)
MAYBEFWD(HAL.WRITE_PORT_BUFFER_USHORT)
+@ stdcall ScsiPortWritePortBufferUlong(ptr ptr long)
MAYBEFWD(HAL.WRITE_PORT_BUFFER_ULONG)
+@ stdcall ScsiPortWritePortUchar(ptr long) MAYBEFWD(HAL.WRITE_PORT_UCHAR)
+@ stdcall ScsiPortWritePortUshort(ptr long) MAYBEFWD(HAL.WRITE_PORT_USHORT)
+@ stdcall ScsiPortWritePortUlong(ptr long) MAYBEFWD(HAL.WRITE_PORT_ULONG)
+@ stdcall ScsiPortWriteRegisterBufferUchar(ptr ptr long)
MAYBEFWD(NTOSKRNL.WRITE_REGISTER_BUFFER_UCHAR)
+@ stdcall ScsiPortWriteRegisterBufferUshort(ptr ptr long)
MAYBEFWD(NTOSKRNL.WRITE_REGISTER_BUFFER_USHORT)
+@ stdcall ScsiPortWriteRegisterBufferUlong(ptr ptr long)
MAYBEFWD(NTOSKRNL.WRITE_REGISTER_BUFFER_ULONG)
+@ stdcall ScsiPortWriteRegisterUchar(ptr long) MAYBEFWD(NTOSKRNL.WRITE_REGISTER_UCHAR)
+@ stdcall ScsiPortWriteRegisterUshort(ptr long) MAYBEFWD(NTOSKRNL.WRITE_REGISTER_USHORT)
+@ stdcall ScsiPortWriteRegisterUlong(ptr long) MAYBEFWD(NTOSKRNL.WRITE_REGISTER_ULONG)
Added: branches/ros-amd64-bringup/reactos/drivers/storage/scsiport/stubs.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/drive…
==============================================================================
--- branches/ros-amd64-bringup/reactos/drivers/storage/scsiport/stubs.c (added)
+++ branches/ros-amd64-bringup/reactos/drivers/storage/scsiport/stubs.c [iso-8859-1] Sun
Sep 21 09:40:17 2008
@@ -1,0 +1,250 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS Storage Stack
+ * FILE: drivers/storage/scsiport/stubs.c
+ * PURPOSE: SCSI port driver
+ * PROGRAMMER: Timo Kreuzer (timo.kreuzer(a)reactos.org)
+ */
+
+/* INCLUDES *****************************************************************/
+
+#include <ntddk.h>
+#include <srb.h>
+
+#define NDEBUG
+#include <debug.h>
+
+#ifdef _MSC_VER
+ #define DDKAPI
+#endif
+
+SCSI_PHYSICAL_ADDRESS
+DDKAPI
+ScsiPortConvertUlongToPhysicalAddress(
+ IN ULONG UlongAddress)
+{
+ return RtlConvertUlongToLargeInteger(UlongAddress);
+}
+
+VOID
+DDKAPI
+ScsiPortReadPortBufferUchar(
+ IN PUCHAR Port,
+ IN PUCHAR Buffer,
+ IN ULONG Count)
+{
+ READ_PORT_BUFFER_UCHAR(Port, Buffer, Count);
+}
+
+VOID
+DDKAPI
+ScsiPortReadPortBufferUshort(
+ IN PUSHORT Port,
+ IN PUSHORT Buffer,
+ IN ULONG Count)
+{
+ READ_PORT_BUFFER_USHORT(Port, Buffer, Count);
+}
+
+VOID
+DDKAPI
+ScsiPortReadPortBufferUlong(
+ IN PULONG Port,
+ IN PULONG Buffer,
+ IN ULONG Count)
+{
+ READ_PORT_BUFFER_ULONG(Port, Buffer, Count);
+}
+
+UCHAR
+DDKAPI
+ScsiPortReadPortUchar(
+ IN PUCHAR Port)
+{
+ return READ_PORT_UCHAR(Port);
+}
+
+USHORT
+DDKAPI
+ScsiPortReadPortUshort(
+ IN PUSHORT Port)
+{
+ return READ_PORT_USHORT(Port);
+}
+
+ULONG
+DDKAPI
+ScsiPortReadPortUlong(
+ IN PULONG Port)
+{
+ return READ_PORT_ULONG(Port);
+}
+
+VOID
+DDKAPI
+ScsiPortReadRegisterBufferUchar(
+ IN PUCHAR Register,
+ IN PUCHAR Buffer,
+ IN ULONG Count)
+{
+ READ_REGISTER_BUFFER_UCHAR(Register, Buffer, Count);
+}
+
+VOID
+DDKAPI
+ScsiPortReadRegisterBufferUshort(
+ IN PUSHORT Register,
+ IN PUSHORT Buffer,
+ IN ULONG Count)
+{
+ READ_REGISTER_BUFFER_USHORT(Register, Buffer, Count);
+}
+
+VOID
+DDKAPI
+ScsiPortReadRegisterBufferUlong(
+ IN PULONG Register,
+ IN PULONG Buffer,
+ IN ULONG Count)
+{
+ READ_REGISTER_BUFFER_ULONG(Register, Buffer, Count);
+}
+
+UCHAR
+DDKAPI
+ScsiPortReadRegisterUchar(
+ IN PUCHAR Register)
+{
+ return READ_REGISTER_UCHAR(Register);
+}
+
+USHORT
+DDKAPI
+ScsiPortReadRegisterUshort(
+ IN PUSHORT Register)
+{
+ return READ_REGISTER_USHORT(Register);
+}
+
+ULONG
+DDKAPI
+ScsiPortReadRegisterUlong(
+ IN PULONG Register)
+{
+ return READ_REGISTER_ULONG(Register);
+}
+
+VOID
+DDKAPI
+ScsiPortWritePortBufferUchar(
+ IN PUCHAR Port,
+ IN PUCHAR Buffer,
+ IN ULONG Count)
+{
+ WRITE_PORT_BUFFER_UCHAR(Port, Buffer, Count);
+}
+
+VOID
+DDKAPI
+ScsiPortWritePortBufferUshort(
+ IN PUSHORT Port,
+ IN PUSHORT Buffer,
+ IN ULONG Count)
+{
+ WRITE_PORT_BUFFER_USHORT(Port, Buffer, Count);
+}
+
+VOID
+DDKAPI
+ScsiPortWritePortBufferUlong(
+ IN PULONG Port,
+ IN PULONG Buffer,
+ IN ULONG Count)
+{
+ WRITE_PORT_BUFFER_ULONG(Port, Buffer, Count);
+}
+
+VOID
+DDKAPI
+ScsiPortWritePortUchar(
+ IN PUCHAR Port,
+ IN UCHAR Value)
+{
+ WRITE_PORT_UCHAR(Port, Value);
+}
+
+VOID
+DDKAPI
+ScsiPortWritePortUshort(
+ IN PUSHORT Port,
+ IN USHORT Value)
+{
+ WRITE_PORT_USHORT(Port, Value);
+}
+
+VOID
+DDKAPI
+ScsiPortWritePortUlong(
+ IN PULONG Port,
+ IN ULONG Value)
+{
+ WRITE_PORT_ULONG(Port, Value);
+}
+
+VOID
+DDKAPI
+ScsiPortWriteRegisterBufferUchar(
+ IN PUCHAR Register,
+ IN PUCHAR Buffer,
+ IN ULONG Count)
+{
+ WRITE_REGISTER_BUFFER_UCHAR(Register, Buffer, Count);
+}
+
+VOID
+DDKAPI
+ScsiPortWriteRegisterBufferUshort(
+ IN PUSHORT Register,
+ IN PUSHORT Buffer,
+ IN ULONG Count)
+{
+ WRITE_REGISTER_BUFFER_USHORT(Register, Buffer, Count);
+}
+
+VOID
+DDKAPI
+ScsiPortWriteRegisterBufferUlong(
+ IN PULONG Register,
+ IN PULONG Buffer,
+ IN ULONG Count)
+{
+ WRITE_REGISTER_BUFFER_ULONG(Register, Buffer, Count);
+}
+
+VOID
+DDKAPI
+ScsiPortWriteRegisterUchar(
+ IN PUCHAR Register,
+ IN ULONG Value)
+{
+ WRITE_REGISTER_UCHAR(Register, Value);
+}
+
+VOID
+DDKAPI
+ScsiPortWriteRegisterUshort(
+ IN PUSHORT Register,
+ IN USHORT Value)
+{
+ WRITE_REGISTER_USHORT(Register, Value);
+}
+
+VOID
+DDKAPI
+ScsiPortWriteRegisterUlong(
+ IN PULONG Register,
+ IN ULONG Value)
+{
+ WRITE_REGISTER_ULONG(Register, Value);
+}
+
Propchange: branches/ros-amd64-bringup/reactos/drivers/storage/scsiport/stubs.c
------------------------------------------------------------------------------
svn:eol-style = native