Author: tkreuzer
Date: Fri Jun 25 23:58:57 2010
New Revision: 47846
URL:
http://svn.reactos.org/svn/reactos?rev=47846&view=rev
Log:
[UNIATA]
Remove all the byteswap "optimisations" and use portable RTL byteswap functions
Removed:
branches/ros-amd64-bringup/reactos/drivers/storage/ide/uniata/ros_glue/ros_glue_asm.s
Modified:
branches/ros-amd64-bringup/reactos/drivers/storage/ide/uniata/inc/misc.h
branches/ros-amd64-bringup/reactos/drivers/storage/ide/uniata/tools.h
branches/ros-amd64-bringup/reactos/drivers/storage/ide/uniata/uniata.rbuild
Modified: branches/ros-amd64-bringup/reactos/drivers/storage/ide/uniata/inc/misc.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/drive…
==============================================================================
--- branches/ros-amd64-bringup/reactos/drivers/storage/ide/uniata/inc/misc.h [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/drivers/storage/ide/uniata/inc/misc.h [iso-8859-1]
Fri Jun 25 23:58:57 2010
@@ -1,132 +1,10 @@
#ifndef __CROSSNT_MISC__H__
#define __CROSSNT_MISC__H__
-#if defined(_M_X86_)
-extern "C"
-void
-__fastcall
-_MOV_DD_SWP(
- void* a, // ECX
- void* b // EDX
- );
-
-#define MOV_DD_SWP(a,b) _MOV_DD_SWP(&(a),&(b))
-
-/********************/
-
-extern "C"
-void
-__fastcall
-_MOV_DW_SWP(
- void* a, // ECX
- void* b // EDX
- );
-
-#define MOV_DW_SWP(a,b) _MOV_DW_SWP(&(a),&(b))
-
-/********************/
-
-typedef void
-(__fastcall *ptrREVERSE_DD)(
- void* a // ECX
- );
-extern "C" ptrREVERSE_DD _REVERSE_DD;
-
-void
-__fastcall
-_REVERSE_DD_i486(
- void* a // ECX
- );
-
-void
-__fastcall
-_REVERSE_DD_i386(
- void* a // ECX
- );
-#define REVERSE_DD(a,b) _REVERSE_DD(&(a),&(b))
-
-/********************/
-
-extern "C"
-void
-__fastcall
-_REVERSE_DW(
- void* a // ECX
- );
-
-#define REVERSE_DW(a) _REVERSE_DW(&(a))
-
-/********************/
-
-extern "C"
-void
-__fastcall
-_MOV_DW2DD_SWP(
- void* a, // ECX
- void* b // EDX
- );
-
-#define MOV_DW2DD_SWP(a,b) _MOV_DW2DD_SWP(&(a),&(b))
-
-/********************/
-
-extern "C"
-void
-__fastcall
-_MOV_SWP_DW2DD(
- void* a, // ECX
- void* b // EDX
- );
-
-#define MOV_SWP_DW2DD(a,b) _MOV_SWP_DW2DD(&(a),&(b))
-
-/********************/
-
-extern "C"
-void
-__fastcall
-_MOV_MSF(
- void* a, // ECX
- void* b // EDX
- );
-#define MOV_MSF(a,b) _MOV_MSF(&(a),&(b))
-
-/********************/
-
-typedef void
-(__fastcall *ptrMOV_MSF_SWP)(
- void* a, // ECX
- void* b // EDX
- );
-extern "C" ptrMOV_MSF_SWP _MOV_MSF_SWP;
-
-extern "C"
-void
-__fastcall
-_MOV_MSF_SWP_i486(
- void* a, // ECX
- void* b // EDX
- );
-
-extern "C"
-void
-__fastcall
-_MOV_MSF_SWP_i386(
- void* a, // ECX
- void* b // EDX
- );
-#define MOV_MSF_SWP(a,b) _MOV_MSF_SWP(&(a),&(b))
-
-/********************/
-
-extern "C"
-void
-__fastcall
-_XCHG_DD(
- void* a, // ECX
- void* b // EDX
- );
-#define XCHG_DD(a,b) _XCHG_DD(&(a),&(b))
-#endif
+/* The definitions look so crappy, because the code doesn't care
+ whether the source is an array or an integer */
+#define MOV_DD_SWP(a,b) ((a) = RtlUlongByteSwap(*(PULONG)&(b)))
+#define MOV_DW_SWP(a,b) ((a) = RtlUshortByteSwap(*(PULONG)&(b)))
+#define MOV_SWP_DW2DD(a,b) ((a) = RtlUshortByteSwap(*(PULONG)&(b)))
#endif // __CROSSNT_MISC__H__
Removed:
branches/ros-amd64-bringup/reactos/drivers/storage/ide/uniata/ros_glue/ros_glue_asm.s
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/drive…
==============================================================================
--- branches/ros-amd64-bringup/reactos/drivers/storage/ide/uniata/ros_glue/ros_glue_asm.s
[iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/drivers/storage/ide/uniata/ros_glue/ros_glue_asm.s
(removed)
@@ -1,30 +1,0 @@
-.intel_syntax noprefix
-
-.globl @_MOV_DD_SWP@8
-.globl @_MOV_DW_SWP@8
-.globl @_MOV_SWP_DW2DD@8
-
-.func @_MOV_DD_SWP@8, @_MOV_DD_SWP@8
-@_MOV_DD_SWP@8:
- mov eax,[edx]
- bswap eax
- mov [ecx],eax
- ret
-.endfunc
-
-.func @_MOV_DW_SWP@8, @_MOV_DW_SWP@8
-@_MOV_DW_SWP@8:
- mov ax,[edx]
- rol ax,8
- mov [ecx],ax
- ret
-.endfunc
-
-.func @_MOV_SWP_DW2DD@8, @_MOV_SWP_DW2DD@8
-@_MOV_SWP_DW2DD@8:
- xor eax,eax
- mov ax,[edx]
- rol ax,8
- mov [ecx],eax
- ret
-.endfunc
Modified: branches/ros-amd64-bringup/reactos/drivers/storage/ide/uniata/tools.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/drive…
==============================================================================
--- branches/ros-amd64-bringup/reactos/drivers/storage/ide/uniata/tools.h [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/drivers/storage/ide/uniata/tools.h [iso-8859-1] Fri
Jun 25 23:58:57 2010
@@ -94,9 +94,9 @@
}
#define DEC_TO_BCD(x) (((x / 10) << 4) + (x % 10))
-
-
-#if defined(_M_X86_) && defined(_MSC_VER)
+/*
+
+#if defined _X86_ && !defined(__GNUC__)
#define MOV_DD_SWP(a,b) \
{ \
@@ -203,7 +203,7 @@
__asm mov [ebx],eax \
}
-#elif !defined(_M_X86_) // NO X86 optimization , use generic C/C++
+#else // NO X86 optimization , use generic C/C++
#define MOV_DD_SWP(a,b) \
{ \
@@ -246,17 +246,6 @@
_to_->Byte2 = _from_->Byte1; \
_to_->Byte3 = _from_->Byte0; \
}
-
-#define MOV_SWP_DW2DD(a,b) \
-{ \
- PFOUR_BYTE _from_, _to_; \
- _from_ = ((PFOUR_BYTE)&(b)); \
- _to_ = ((PFOUR_BYTE)&(a)); \
- *((PUSHORT)_to_) = 0; \
- _to_->Byte0 = _from_->Byte1; \
- _to_->Byte1 = _from_->Byte0; \
-}
-
#define MOV_MSF(a,b) \
{ \
@@ -293,7 +282,7 @@
#define MOV_3B_SWP(a,b) MOV_MSF_SWP(a,b)
-
+*/
#ifdef DBG
Modified: branches/ros-amd64-bringup/reactos/drivers/storage/ide/uniata/uniata.rbuild
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/drive…
==============================================================================
--- branches/ros-amd64-bringup/reactos/drivers/storage/ide/uniata/uniata.rbuild
[iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/drivers/storage/ide/uniata/uniata.rbuild
[iso-8859-1] Fri Jun 25 23:58:57 2010
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../../tools/rbuild/project.dtd">
-<module name="uniata" type="kernelmodedriver"
installbase="system32/drivers" installname="uniata.sys"
allowwarnings="true">
+<module name="uniata" type="kernelmodedriver"
installbase="system32/drivers" installname="uniata.sys">
<bootstrap installbase="$(CDOUTPUT)" />
<include base="uniata">.</include>
<include base="uniata">inc</include>
@@ -23,8 +23,5 @@
<directory name="ros_glue">
<file>ros_glue.cpp</file>
- <if property="ARCH" value="i386">
- <file>ros_glue_asm.s</file>
- </if>
</directory>
</module>