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
#define UDF_UNC_STR_TAG "AppStr"
#endif
-//#ifdef _X86_
-#ifdef _MSC_VER
+#if defined (_X86_) && defined (_MSC_VER)
__asm push ebx
__asm push esi
USHORT i;
-//#ifdef _X86_
-#ifdef _MSC_VER
+#if defined (_X86_) && defined (_MSC_VER)
__asm push ebx
__asm push esi
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
// 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;
}
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
}
}
if(bm) {
- UDFSetBit__(bm, Lba);
+ UDFSetBit(bm, Lba);
KdPrint(("Set BB @ %#x\n", Lba));
}
#ifdef _BROWSE_UDF_
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
#ifndef _PLATFORM_SPECIFIC_H_
#define _PLATFORM_SPECIFIC_H_
-#if defined _X86_
typedef char int8;
typedef short int16;
typedef long int32;
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_
if(!BlockCount)
return 0;
-//#ifdef _X86_
-#ifdef _MSC_VER
+#if defined (_X86_) && defined (_MSC_VER)
__asm push ecx
__asm push ebx
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));
KdPrint(("EIP=%8.8x\n",PtrExceptionPointers->ContextRecord->Eip));
}
// KdPrint(("Flags: %s %s ",PtrExceptionPointers->ContextRecord->Eip));
+#endif //_X86_
#endif // UDF_DBG
USHORT i;
-//#ifdef _X86_
-#ifdef _MSC_VER
+#if defined (_X86_) && defined (_MSC_VER)
PWCHAR retval;
#define ValidateFileInfo(fi) {}
#endif
-//#ifdef _X86_
-#ifdef _MSC_VER
+#if defined (_X86_) && defined (_MSC_VER)
__inline VOID UDFTouch(IN PVOID addr)
{
)
{
PUDFPartMap pm = Vcb->Partitions;
-//#ifdef _X86_
-#ifdef _MSC_VER
+#if defined (_X86_) && defined (_MSC_VER)
uint32 retval;
__asm {
push ebx
array Bitmap. Bitmap scan is limited with Lim.
*/
-//#if defined _X86_
-#if defined _MSC_VER
+#if defined (_X86_) && defined (_MSC_VER)
__declspec (naked)
uint32
if(!Extent) return 0;
int64 i=0;
-//#ifdef _X86_
-#ifdef _MSC_VER
+#if defined (_X86_) && defined (_MSC_VER)
__asm push ebx
__asm push ecx
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
)
{
-//#ifdef _X86_
-#ifdef _MSC_VER
+#if defined (_X86_) && defined (_MSC_VER)
BOOLEAN RC = FALSE;
}
}
if(bm) {
- UDFSetBit__(bm, vItem->lba);
+ UDFSetBit(bm, vItem->lba);
KdPrint(("Set BB @ %#x\n", vItem->lba));
}
#ifdef _BROWSE_UDF_
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.
)
{
// Genuine illegal char's for DOS.
-//#ifdef _X86_
-#ifdef _MSC_VER
+#if defined (_X86_) && defined (_MSC_VER)
_asm {
push ebx
#pragma warning(disable:4035) // re-enable below
#endif
-//#ifdef _X86_
-#ifdef _MSC_VER
+#if defined (_X86_) && defined (_MSC_VER)
__declspec (naked)
#endif // _X86_
uint32
IN uint32 len // EDX
)
{
-//#ifdef _X86_
-#ifdef _MSC_VER
+#if defined (_X86_) && defined (_MSC_VER)
// uint32 _Size = len;
__asm {
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
uint32 n // EDX
)
{
-//#ifdef _X86_
-#ifdef _MSC_VER
+#if defined (_X86_) && defined (_MSC_VER)
// uint32 _Size = n;
__asm {
#endif // _X86_
} // end UDFUnicodeCksum()
-//#ifdef _X86_
-#ifdef _MSC_VER
+#if defined (_X86_) && defined (_MSC_VER)
__declspec (naked)
#endif // _X86_
uint16
uint32 n // EDX
)
{
-//#ifdef _X86_
-#ifdef _MSC_VER
+#if defined (_X86_) && defined (_MSC_VER)
// uint32 _Size = n;
__asm {
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
IN uint32 Size // EDX
)
{
-//#ifdef _X86_
-#ifdef _MSC_VER
+#if defined (_X86_) && defined (_MSC_VER)
// uint32 _Size = Size;
__asm {