Author: dreimer Date: Mon Jun 15 11:35:30 2015 New Revision: 68144
URL: http://svn.reactos.org/svn/reactos?rev=68144&view=rev Log: [UDFS] Fix compilation for AMD64 and ARM. - It's no good idea to use the x86 ASM optimizations on any architecture. Luckily Alter made plain C++ ones for that case, too. Thus modify the #ifdefs a bit to use em. - Fix a few directly used functions instead of the defined architecture fixed ones of em. - After some discussion with Thomas Faber the ULONG vs UINT32 problems were resolved by using the same platform defines for all three architectures. BUILDS? yes WORKS? Trololololo ^^
Modified: trunk/reactos/drivers/filesystems/udfs/Include/Sys_spec_lib.cpp trunk/reactos/drivers/filesystems/udfs/Include/ntddk_ex.h trunk/reactos/drivers/filesystems/udfs/Include/phys_lib.cpp trunk/reactos/drivers/filesystems/udfs/Include/platform.h trunk/reactos/drivers/filesystems/udfs/Include/wcache_lib.cpp trunk/reactos/drivers/filesystems/udfs/misc.cpp trunk/reactos/drivers/filesystems/udfs/namesup.cpp trunk/reactos/drivers/filesystems/udfs/udf_dbg.h trunk/reactos/drivers/filesystems/udfs/udf_info/alloc.cpp trunk/reactos/drivers/filesystems/udfs/udf_info/extent.cpp trunk/reactos/drivers/filesystems/udfs/udf_info/mount.cpp trunk/reactos/drivers/filesystems/udfs/udf_info/remap.cpp trunk/reactos/drivers/filesystems/udfs/udf_info/udf_info.cpp
Modified: trunk/reactos/drivers/filesystems/udfs/Include/Sys_spec_lib.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/In... ============================================================================== --- trunk/reactos/drivers/filesystems/udfs/Include/Sys_spec_lib.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/udfs/Include/Sys_spec_lib.cpp [iso-8859-1] Mon Jun 15 11:35:30 2015 @@ -806,8 +806,7 @@ #define UDF_UNC_STR_TAG "AppStr" #endif
-//#ifdef _X86_ -#ifdef _MSC_VER +#if defined (_X86_) && defined (_MSC_VER)
__asm push ebx __asm push esi @@ -869,8 +868,7 @@
USHORT i;
-//#ifdef _X86_ -#ifdef _MSC_VER +#if defined (_X86_) && defined (_MSC_VER)
__asm push ebx __asm push esi
Modified: trunk/reactos/drivers/filesystems/udfs/Include/ntddk_ex.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/In... ============================================================================== --- trunk/reactos/drivers/filesystems/udfs/Include/ntddk_ex.h [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/udfs/Include/ntddk_ex.h [iso-8859-1] Mon Jun 15 11:35:30 2015 @@ -184,7 +184,9 @@ IMAGE_OPTIONAL_HEADER32 OptionalHeader; } IMAGE_NT_HEADERS32, *PIMAGE_NT_HEADERS32; typedef IMAGE_NT_HEADERS32 IMAGE_NT_HEADERS; +#ifdef _X86_ typedef PIMAGE_NT_HEADERS32 PIMAGE_NT_HEADERS; +#endif
#define IMAGE_DIRECTORY_ENTRY_EXPORT 0 // Export Directory
Modified: trunk/reactos/drivers/filesystems/udfs/Include/phys_lib.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/In... ============================================================================== --- trunk/reactos/drivers/filesystems/udfs/Include/phys_lib.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/udfs/Include/phys_lib.cpp [iso-8859-1] Mon Jun 15 11:35:30 2015 @@ -224,7 +224,7 @@
// check if block valid if(Vcb->BSBM_Bitmap) { - if(UDFGetBit__((uint32*)(Vcb->BSBM_Bitmap), UDFRelocateSector(Vcb, lba0+i))) { + if(UDFGetBit((uint32*)(Vcb->BSBM_Bitmap), UDFRelocateSector(Vcb, lba0+i))) { KdPrint((" remap: known BB @ %x, mapped to %x\n", lba0+i, UDFRelocateSector(Vcb, lba0+i))); need_remap = TRUE; } @@ -907,7 +907,7 @@ if(Vcb->BSBM_Bitmap) { ULONG i; for(i=0; i<BCount; i++) { - if(UDFGetBit__((uint32*)(Vcb->BSBM_Bitmap), Lba+i)) { + if(UDFGetBit((uint32*)(Vcb->BSBM_Bitmap), Lba+i)) { KdPrint(("W: Known BB @ %#x\n", Lba)); //return STATUS_FT_WRITE_RECOVERY; // this shall not be treated as error and // we shall get IO request to BAD block @@ -1611,7 +1611,7 @@ } } if(bm) { - UDFSetBit__(bm, Lba); + UDFSetBit(bm, Lba); KdPrint(("Set BB @ %#x\n", Lba)); } #ifdef _BROWSE_UDF_ @@ -3689,7 +3689,7 @@ if(Vcb->BSBM_Bitmap) { ULONG i; for(i=0; i<BCount; i++) { - if(UDFGetBit__((uint32*)(Vcb->BSBM_Bitmap), Lba+i)) { + if(UDFGetBit((uint32*)(Vcb->BSBM_Bitmap), Lba+i)) { KdPrint(("R: Known BB @ %#x\n", Lba)); //return STATUS_FT_WRITE_RECOVERY; // this shall not be treated as error and // we shall get IO request to BAD block
Modified: trunk/reactos/drivers/filesystems/udfs/Include/platform.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/In... ============================================================================== --- trunk/reactos/drivers/filesystems/udfs/Include/platform.h [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/udfs/Include/platform.h [iso-8859-1] Mon Jun 15 11:35:30 2015 @@ -7,7 +7,6 @@ #ifndef _PLATFORM_SPECIFIC_H_ #define _PLATFORM_SPECIFIC_H_
-#if defined _X86_ typedef char int8; typedef short int16; typedef long int32; @@ -20,25 +19,4 @@
typedef uint32 lba_t;
-#elif defined _AMD64_ - -typedef __int8 int8; -typedef __int16 int16; -typedef __int32 int32; -typedef __int64 int64; - -typedef unsigned __int8 uint8; -typedef unsigned __int16 uint16; -typedef unsigned __int32 uint32; -typedef unsigned __int64 uint64; - -typedef uint32 lba_t; - - -#else // Please define appropriate types here - -#error !!!! You must define your types here for compilation to proceed !!!! - -#endif // if _X86_ - #endif // _PLATFORM_SPECIFIC_H_
Modified: trunk/reactos/drivers/filesystems/udfs/Include/wcache_lib.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/In... ============================================================================== --- trunk/reactos/drivers/filesystems/udfs/Include/wcache_lib.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/udfs/Include/wcache_lib.cpp [iso-8859-1] Mon Jun 15 11:35:30 2015 @@ -455,8 +455,7 @@ if(!BlockCount) return 0;
-//#ifdef _X86_ -#ifdef _MSC_VER +#if defined (_X86_) && defined (_MSC_VER)
__asm push ecx __asm push ebx
Modified: trunk/reactos/drivers/filesystems/udfs/misc.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/mi... ============================================================================== --- trunk/reactos/drivers/filesystems/udfs/misc.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/udfs/misc.cpp [iso-8859-1] Mon Jun 15 11:35:30 2015 @@ -280,6 +280,7 @@ for(i=0;i<PtrExceptionPointers->ExceptionRecord->NumberParameters;i++) { KdPrint((" %x\n",PtrExceptionPointers->ExceptionRecord->ExceptionInformation[i])); } +#ifdef _X86_ KdPrint(("Exception context:\n")); if(PtrExceptionPointers->ContextRecord->ContextFlags & CONTEXT_INTEGER) { KdPrint(("EAX=%8.8x ",PtrExceptionPointers->ContextRecord->Eax)); @@ -297,6 +298,7 @@ KdPrint(("EIP=%8.8x\n",PtrExceptionPointers->ContextRecord->Eip)); } // KdPrint(("Flags: %s %s ",PtrExceptionPointers->ContextRecord->Eip)); +#endif //_X86_
#endif // UDF_DBG
Modified: trunk/reactos/drivers/filesystems/udfs/namesup.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/na... ============================================================================== --- trunk/reactos/drivers/filesystems/udfs/namesup.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/udfs/namesup.cpp [iso-8859-1] Mon Jun 15 11:35:30 2015 @@ -24,8 +24,7 @@
USHORT i;
-//#ifdef _X86_ -#ifdef _MSC_VER +#if defined (_X86_) && defined (_MSC_VER)
PWCHAR retval;
Modified: trunk/reactos/drivers/filesystems/udfs/udf_dbg.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/ud... ============================================================================== --- trunk/reactos/drivers/filesystems/udfs/udf_dbg.h [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/udfs/udf_dbg.h [iso-8859-1] Mon Jun 15 11:35:30 2015 @@ -234,8 +234,7 @@ #define ValidateFileInfo(fi) {} #endif
-//#ifdef _X86_ -#ifdef _MSC_VER +#if defined (_X86_) && defined (_MSC_VER)
__inline VOID UDFTouch(IN PVOID addr) {
Modified: trunk/reactos/drivers/filesystems/udfs/udf_info/alloc.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/ud... ============================================================================== --- trunk/reactos/drivers/filesystems/udfs/udf_info/alloc.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/udfs/udf_info/alloc.cpp [iso-8859-1] Mon Jun 15 11:35:30 2015 @@ -50,8 +50,7 @@ ) { PUDFPartMap pm = Vcb->Partitions; -//#ifdef _X86_ -#ifdef _MSC_VER +#if defined (_X86_) && defined (_MSC_VER) uint32 retval; __asm { push ebx @@ -322,8 +321,7 @@ array Bitmap. Bitmap scan is limited with Lim. */
-//#if defined _X86_ -#if defined _MSC_VER +#if defined (_X86_) && defined (_MSC_VER)
__declspec (naked) uint32
Modified: trunk/reactos/drivers/filesystems/udfs/udf_info/extent.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/ud... ============================================================================== --- trunk/reactos/drivers/filesystems/udfs/udf_info/extent.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/udfs/udf_info/extent.cpp [iso-8859-1] Mon Jun 15 11:35:30 2015 @@ -146,8 +146,7 @@ if(!Extent) return 0; int64 i=0;
-//#ifdef _X86_ -#ifdef _MSC_VER +#if defined (_X86_) && defined (_MSC_VER)
__asm push ebx __asm push ecx @@ -228,8 +227,7 @@ if(!Extent) return 0; uint32 i=0;
-//#ifdef _X86_ -#ifdef _MSC_VER +#if defined (_X86_) && defined (_MSC_VER) __asm push ebx
__asm mov ebx,Extent
Modified: trunk/reactos/drivers/filesystems/udfs/udf_info/mount.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/ud... ============================================================================== --- trunk/reactos/drivers/filesystems/udfs/udf_info/mount.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/udfs/udf_info/mount.cpp [iso-8859-1] Mon Jun 15 11:35:30 2015 @@ -2932,8 +2932,7 @@ ) {
-//#ifdef _X86_ -#ifdef _MSC_VER +#if defined (_X86_) && defined (_MSC_VER)
BOOLEAN RC = FALSE;
Modified: trunk/reactos/drivers/filesystems/udfs/udf_info/remap.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/ud... ============================================================================== --- trunk/reactos/drivers/filesystems/udfs/udf_info/remap.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/udfs/udf_info/remap.cpp [iso-8859-1] Mon Jun 15 11:35:30 2015 @@ -435,7 +435,7 @@ } } if(bm) { - UDFSetBit__(bm, vItem->lba); + UDFSetBit(bm, vItem->lba); KdPrint(("Set BB @ %#x\n", vItem->lba)); } #ifdef _BROWSE_UDF_
Modified: trunk/reactos/drivers/filesystems/udfs/udf_info/udf_info.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/ud... ============================================================================== --- trunk/reactos/drivers/filesystems/udfs/udf_info/udf_info.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/udfs/udf_info/udf_info.cpp [iso-8859-1] Mon Jun 15 11:35:30 2015 @@ -324,8 +324,7 @@ return STATUS_SUCCESS; } // UDFReadFileEntry()
-//#ifndef _X86_ -#ifndef _MSC_VER +#if !defined (_X86_) || !defined (_MSC_VER) /* Decides if a Unicode character matches one of a list of ASCII characters. @@ -373,8 +372,7 @@ ) { // Genuine illegal char's for DOS. -//#ifdef _X86_ -#ifdef _MSC_VER +#if defined (_X86_) && defined (_MSC_VER) _asm { push ebx
@@ -4280,8 +4278,7 @@ #pragma warning(disable:4035) // re-enable below #endif
-//#ifdef _X86_ -#ifdef _MSC_VER +#if defined (_X86_) && defined (_MSC_VER) __declspec (naked) #endif // _X86_ uint32 @@ -4291,8 +4288,7 @@ IN uint32 len // EDX ) { -//#ifdef _X86_ -#ifdef _MSC_VER +#if defined (_X86_) && defined (_MSC_VER) // uint32 _Size = len;
__asm { @@ -4348,8 +4344,7 @@ The polynomial used is: x^16 + x^12 + x^15 + 1 */
-//#ifdef _X86_ -#ifdef _MSC_VER +#if defined (_X86_) && defined (_MSC_VER) __declspec (naked) #endif // _X86_ uint16 @@ -4359,8 +4354,7 @@ uint32 n // EDX ) { -//#ifdef _X86_ -#ifdef _MSC_VER +#if defined (_X86_) && defined (_MSC_VER) // uint32 _Size = n;
__asm { @@ -4416,8 +4410,7 @@ #endif // _X86_ } // end UDFUnicodeCksum()
-//#ifdef _X86_ -#ifdef _MSC_VER +#if defined (_X86_) && defined (_MSC_VER) __declspec (naked) #endif // _X86_ uint16 @@ -4427,8 +4420,7 @@ uint32 n // EDX ) { -//#ifdef _X86_ -#ifdef _MSC_VER +#if defined (_X86_) && defined (_MSC_VER) // uint32 _Size = n;
__asm { @@ -4523,8 +4515,7 @@ The OSTA-UDF(tm) 1.50 standard states that using CRCs is mandatory. The polynomial used is: x^16 + x^12 + x^15 + 1 */ -//#ifdef _X86_ -#ifdef _MSC_VER +#if defined (_X86_) && defined (_MSC_VER) __declspec (naked) #endif // _X86_ uint16 @@ -4534,8 +4525,7 @@ IN uint32 Size // EDX ) { -//#ifdef _X86_ -#ifdef _MSC_VER +#if defined (_X86_) && defined (_MSC_VER) // uint32 _Size = Size;
__asm {