mirror of
https://github.com/reactos/reactos.git
synced 2025-06-03 00:10:39 +00:00
[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 ^^ svn path=/trunk/; revision=68144
This commit is contained in:
parent
6d2d280649
commit
1b5231d4ed
13 changed files with 29 additions and 67 deletions
|
@ -806,8 +806,7 @@ MyAppendUnicodeToString_(
|
|||
#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 @@ MyInitUnicodeString(
|
|||
|
||||
USHORT i;
|
||||
|
||||
//#ifdef _X86_
|
||||
#ifdef _MSC_VER
|
||||
#if defined (_X86_) && defined (_MSC_VER)
|
||||
|
||||
__asm push ebx
|
||||
__asm push esi
|
||||
|
|
|
@ -184,7 +184,9 @@ typedef struct _IMAGE_NT_HEADERS {
|
|||
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
|
||||
|
||||
|
|
|
@ -224,7 +224,7 @@ UDFTIOVerify(
|
|||
|
||||
// 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 @@ UDFPrepareForWriteOperation(
|
|||
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 @@ try_exit: NOTHING;
|
|||
}
|
||||
}
|
||||
if(bm) {
|
||||
UDFSetBit__(bm, Lba);
|
||||
UDFSetBit(bm, Lba);
|
||||
KdPrint(("Set BB @ %#x\n", Lba));
|
||||
}
|
||||
#ifdef _BROWSE_UDF_
|
||||
|
@ -3689,7 +3689,7 @@ UDFPrepareForReadOperation(
|
|||
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
|
||||
|
|
|
@ -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 unsigned long long uint64;
|
|||
|
||||
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_
|
||||
|
|
|
@ -455,8 +455,7 @@ WCacheGetSortedListIndex(
|
|||
if(!BlockCount)
|
||||
return 0;
|
||||
|
||||
//#ifdef _X86_
|
||||
#ifdef _MSC_VER
|
||||
#if defined (_X86_) && defined (_MSC_VER)
|
||||
|
||||
__asm push ecx
|
||||
__asm push ebx
|
||||
|
|
|
@ -280,6 +280,7 @@ UDFExceptionFilter(
|
|||
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 @@ UDFExceptionFilter(
|
|||
KdPrint(("EIP=%8.8x\n",PtrExceptionPointers->ContextRecord->Eip));
|
||||
}
|
||||
// KdPrint(("Flags: %s %s ",PtrExceptionPointers->ContextRecord->Eip));
|
||||
#endif //_X86_
|
||||
|
||||
#endif // UDF_DBG
|
||||
|
||||
|
|
|
@ -24,8 +24,7 @@ UDFDissectName(
|
|||
|
||||
USHORT i;
|
||||
|
||||
//#ifdef _X86_
|
||||
#ifdef _MSC_VER
|
||||
#if defined (_X86_) && defined (_MSC_VER)
|
||||
|
||||
PWCHAR retval;
|
||||
|
||||
|
|
|
@ -234,8 +234,7 @@ DbgCompareMemory(PVOID d, PVOID s, ULONG l) {
|
|||
#define ValidateFileInfo(fi) {}
|
||||
#endif
|
||||
|
||||
//#ifdef _X86_
|
||||
#ifdef _MSC_VER
|
||||
#if defined (_X86_) && defined (_MSC_VER)
|
||||
|
||||
__inline VOID UDFTouch(IN PVOID addr)
|
||||
{
|
||||
|
|
|
@ -50,8 +50,7 @@ UDFPhysLbaToPart(
|
|||
)
|
||||
{
|
||||
PUDFPartMap pm = Vcb->Partitions;
|
||||
//#ifdef _X86_
|
||||
#ifdef _MSC_VER
|
||||
#if defined (_X86_) && defined (_MSC_VER)
|
||||
uint32 retval;
|
||||
__asm {
|
||||
push ebx
|
||||
|
@ -322,8 +321,7 @@ EO_gpl:
|
|||
array Bitmap. Bitmap scan is limited with Lim.
|
||||
*/
|
||||
|
||||
//#if defined _X86_
|
||||
#if defined _MSC_VER
|
||||
#if defined (_X86_) && defined (_MSC_VER)
|
||||
|
||||
__declspec (naked)
|
||||
uint32
|
||||
|
|
|
@ -146,8 +146,7 @@ UDFGetExtentLength(
|
|||
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 @@ UDFGetMappingLength(
|
|||
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
|
||||
|
|
|
@ -2932,8 +2932,7 @@ UDFCheckZeroBuf(
|
|||
)
|
||||
{
|
||||
|
||||
//#ifdef _X86_
|
||||
#ifdef _MSC_VER
|
||||
#if defined (_X86_) && defined (_MSC_VER)
|
||||
|
||||
BOOLEAN RC = FALSE;
|
||||
|
||||
|
|
|
@ -435,7 +435,7 @@ UDFVRead(
|
|||
}
|
||||
}
|
||||
if(bm) {
|
||||
UDFSetBit__(bm, vItem->lba);
|
||||
UDFSetBit(bm, vItem->lba);
|
||||
KdPrint(("Set BB @ %#x\n", vItem->lba));
|
||||
}
|
||||
#ifdef _BROWSE_UDF_
|
||||
|
|
|
@ -324,8 +324,7 @@ UDFReadFileEntry(
|
|||
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 @@ UDFIsIllegalChar(
|
|||
)
|
||||
{
|
||||
// Genuine illegal char's for DOS.
|
||||
//#ifdef _X86_
|
||||
#ifdef _MSC_VER
|
||||
#if defined (_X86_) && defined (_MSC_VER)
|
||||
_asm {
|
||||
push ebx
|
||||
|
||||
|
@ -4280,8 +4278,7 @@ UDFCompareFileInfo(
|
|||
#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 @@ crc32(
|
|||
IN uint32 len // EDX
|
||||
)
|
||||
{
|
||||
//#ifdef _X86_
|
||||
#ifdef _MSC_VER
|
||||
#if defined (_X86_) && defined (_MSC_VER)
|
||||
// uint32 _Size = len;
|
||||
|
||||
__asm {
|
||||
|
@ -4348,8 +4344,7 @@ EO_CRC:
|
|||
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 @@ UDFUnicodeCksum(
|
|||
uint32 n // EDX
|
||||
)
|
||||
{
|
||||
//#ifdef _X86_
|
||||
#ifdef _MSC_VER
|
||||
#if defined (_X86_) && defined (_MSC_VER)
|
||||
// uint32 _Size = n;
|
||||
|
||||
__asm {
|
||||
|
@ -4416,8 +4410,7 @@ EO_uCRC:
|
|||
#endif // _X86_
|
||||
} // end UDFUnicodeCksum()
|
||||
|
||||
//#ifdef _X86_
|
||||
#ifdef _MSC_VER
|
||||
#if defined (_X86_) && defined (_MSC_VER)
|
||||
__declspec (naked)
|
||||
#endif // _X86_
|
||||
uint16
|
||||
|
@ -4427,8 +4420,7 @@ UDFUnicodeCksum150(
|
|||
uint32 n // EDX
|
||||
)
|
||||
{
|
||||
//#ifdef _X86_
|
||||
#ifdef _MSC_VER
|
||||
#if defined (_X86_) && defined (_MSC_VER)
|
||||
// uint32 _Size = n;
|
||||
|
||||
__asm {
|
||||
|
@ -4523,8 +4515,7 @@ use16_2:
|
|||
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 @@ UDFCrc(
|
|||
IN uint32 Size // EDX
|
||||
)
|
||||
{
|
||||
//#ifdef _X86_
|
||||
#ifdef _MSC_VER
|
||||
#if defined (_X86_) && defined (_MSC_VER)
|
||||
// uint32 _Size = Size;
|
||||
|
||||
__asm {
|
||||
|
|
Loading…
Reference in a new issue