From: Jan Vorlicek Date: Wed, 18 Jan 2017 00:49:55 +0000 (+0100) Subject: Remove obsolete platforms ifdefs from PAL (#8971) X-Git-Tag: accepted/tizen/base/20180629.140029~2589 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=968b13576d3ef2bb585e860f012a7eedb97ab808;p=platform%2Fupstream%2Fcoreclr.git Remove obsolete platforms ifdefs from PAL (#8971) There were many ifdefs for obsolete platforms and processors like AIX, HPUX, SPARC, ALPHA etc. This change is a cleanup that removes them. --- diff --git a/src/pal/inc/pal.h b/src/pal/inc/pal.h index a449ba7..369e87a 100644 --- a/src/pal/inc/pal.h +++ b/src/pal/inc/pal.h @@ -83,16 +83,6 @@ extern "C" { #define _M_IX86 400 #elif defined(__i386__) && !defined(_M_IX86) #define _M_IX86 300 -#elif defined(__ppc__) && !defined(_M_PPC) -#define _M_PPC 100 -#elif defined(_AIX) && defined(_POWER) && !defined(_M_PPC) -#define _M_PPC 100 -#elif defined(__sparc__) && !defined(_M_SPARC) -#define _M_SPARC 100 -#elif defined(__hppa__) && !defined(_M_PARISC) -#define _M_PARISC 100 -#elif defined(__ia64__) && !defined(_M_IA64) -#define _M_IA64 64100 #elif defined(__x86_64__) && !defined(_M_AMD64) #define _M_AMD64 100 #elif defined(__arm__) && !defined(_M_ARM) @@ -103,20 +93,6 @@ extern "C" { #if defined(_M_IX86) && !defined(_X86_) #define _X86_ -#elif defined(_M_ALPHA) && !defined(_ALPHA_) -#define _ALPHA_ -#elif defined(_M_PPC) && !defined(_PPC_) -#define _PPC_ -#elif defined(_M_SPARC) && !defined(_SPARC_) -#define _SPARC_ -#elif defined(_M_PARISC) && !defined(_PARISC_) -#define _PARISC_ -#elif defined(_M_MRX000) && !defined(_MIPS_) -#define _MIPS_ -#elif defined(_M_M68K) && !defined(_68K_) -#define _68K_ -#elif defined(_M_IA64) && !defined(_IA64_) -#define _IA64_ #elif defined(_M_AMD64) && !defined(_AMD64_) #define _AMD64_ #elif defined(_M_ARM) && !defined(_ARM_) @@ -129,10 +105,6 @@ extern "C" { /******************* ABI-specific glue *******************************/ -#if defined(_PPC_) || defined(_PPC64_) || defined(_SPARC_) || defined(_PARISC_) || defined(_IA64_) -#define BIGENDIAN 1 -#endif - #ifdef __APPLE__ // Both PowerPC, i386 and x86_64 on Mac OS X use 16-byte alignment. #define STACK_ALIGN_BITS 4 @@ -191,20 +163,8 @@ extern "C" { #define __annotation(x) #endif //!MSC_VER -#ifdef _MSC_VER - -#if defined(_M_MRX000) || defined(_M_ALPHA) || defined(_M_PPC) || defined(_M_IA64) -#define UNALIGNED __unaligned -#else -#define UNALIGNED -#endif - -#else // _MSC_VER - #define UNALIGNED -#endif // _MSC_VER - #ifndef FORCEINLINE #if _MSC_VER < 1200 #define FORCEINLINE inline @@ -215,75 +175,19 @@ extern "C" { #ifndef PAL_STDCPP_COMPAT -#ifdef _M_ALPHA +#if __GNUC__ -typedef struct { - char *a0; /* pointer to first homed integer argument */ - int offset; /* byte offset of next parameter */ -} va_list; - -#define va_start(list, v) __builtin_va_start(list, v, 1) -#define va_end(list) - -#elif __GNUC__ - -#if defined(_AIX) - -typedef __builtin_va_list __gnuc_va_list; typedef __builtin_va_list va_list; -#define va_start(v,l) __builtin_va_start(v,l) -#define va_end __builtin_va_end -#define va_arg __builtin_va_arg - -#else // _AIX - -#if __GNUC__ == 2 -typedef void * va_list; -#else -typedef __builtin_va_list va_list; -#endif // __GNUC__ /* We should consider if the va_arg definition here is actually necessary. Could we use the standard va_arg definition? */ -#if __GNUC__ == 2 -#if defined(_SPARC_) || defined(_PARISC_) // ToDo: is this the right thing for PARISC? -#define va_start(list, v) (__builtin_next_arg(v), list = (char *) __builtin_saveregs()) -#define __va_rounded_size(TYPE) \ - (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) -#define __record_type_class 12 -#define __real_type_class 8 -#define va_arg(pvar,TYPE) \ -__extension__ \ -(*({((__builtin_classify_type (*(TYPE*) 0) >= __record_type_class \ - || (__builtin_classify_type (*(TYPE*) 0) == __real_type_class \ - && sizeof (TYPE) == 16)) \ - ? ((pvar) = (char *)(pvar) + __va_rounded_size (TYPE *), \ - *(TYPE **) (void *) ((char *)(pvar) - __va_rounded_size (TYPE *))) \ - : __va_rounded_size (TYPE) == 8 \ - ? ({ union {char __d[sizeof (TYPE)]; int __i[2];} __u; \ - __u.__i[0] = ((int *) (void *) (pvar))[0]; \ - __u.__i[1] = ((int *) (void *) (pvar))[1]; \ - (pvar) = (char *)(pvar) + 8; \ - (TYPE *) (void *) __u.__d; }) \ - : ((pvar) = (char *)(pvar) + __va_rounded_size (TYPE), \ - ((TYPE *) (void *) ((char *)(pvar) - __va_rounded_size (TYPE)))));})) -#else // _SPARC_ or _PARISC_ -// GCC 2.95.3 on non-SPARC -#define __va_size(type) (((sizeof(type) + sizeof(int) - 1) / sizeof(int)) * sizeof(int)) -#define va_start(list, v) ((list) = (va_list) __builtin_next_arg(v)) -#define va_arg(ap, type) (*(type *)((ap) += __va_size(type), (ap) - __va_size(type))) -#endif // _SPARC_ or _PARISC_ -#else // __GNUC__ == 2 #define va_start __builtin_va_start #define va_arg __builtin_va_arg -#endif // __GNUC__ == 2 #define va_copy __builtin_va_copy #define va_end __builtin_va_end -#endif // _AIX - #define VOID void #define PUB __attribute__((visibility("default"))) @@ -628,26 +532,6 @@ PAL_Random( IN OUT LPVOID lpBuffer, IN DWORD dwLength); -#ifdef PLATFORM_UNIX - -PALIMPORT -DWORD -PALAPI -PAL_CreateExecWatchpoint( - HANDLE hThread, - PVOID pvInstruction - ); - -PALIMPORT -DWORD -PALAPI -PAL_DeleteExecWatchpoint( - HANDLE hThread, - PVOID pvInstruction - ); - -#endif - PALIMPORT BOOL PALAPI @@ -1913,650 +1797,6 @@ typedef struct _KNONVOLATILE_CONTEXT_POINTERS { } KNONVOLATILE_CONTEXT_POINTERS, *PKNONVOLATILE_CONTEXT_POINTERS; -#elif defined(_PPC_) - -// -// *********************************************************************************** -// -// NOTE: These context definitions are replicated in ndp/clr/src/debug/inc/DbgTargetContext.h (for the -// purposes manipulating contexts from different platforms during remote debugging). Be sure to keep those -// definitions in sync if you make any changes here. -// -// *********************************************************************************** -// - -#define CONTEXT_CONTROL 0x00000001L -#define CONTEXT_FLOATING_POINT 0x00000002L -#define CONTEXT_INTEGER 0x00000004L - -#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER) -#define CONTEXT_ALL CONTEXT_FULL - -typedef struct _CONTEXT { - - // - // This section is specified/returned if the ContextFlags word contains - // the flag CONTEXT_FLOATING_POINT. - // - - double Fpr0; // Floating registers 0..31 - double Fpr1; - double Fpr2; - double Fpr3; - double Fpr4; - double Fpr5; - double Fpr6; - double Fpr7; - double Fpr8; - double Fpr9; - double Fpr10; - double Fpr11; - double Fpr12; - double Fpr13; - double Fpr14; - double Fpr15; - double Fpr16; - double Fpr17; - double Fpr18; - double Fpr19; - double Fpr20; - double Fpr21; - double Fpr22; - double Fpr23; - double Fpr24; - double Fpr25; - double Fpr26; - double Fpr27; - double Fpr28; - double Fpr29; - double Fpr30; - double Fpr31; - double Fpscr; // Floating point status/control reg - - // - // This section is specified/returned if the ContextFlags word contains - // the flag CONTEXT_INTEGER. - // - - ULONG Gpr0; // General registers 0..31 - ULONG Gpr1; // StackPointer - ULONG Gpr2; - ULONG Gpr3; - ULONG Gpr4; - ULONG Gpr5; - ULONG Gpr6; - ULONG Gpr7; - ULONG Gpr8; - ULONG Gpr9; - ULONG Gpr10; - ULONG Gpr11; - ULONG Gpr12; - ULONG Gpr13; - ULONG Gpr14; - ULONG Gpr15; - ULONG Gpr16; - ULONG Gpr17; - ULONG Gpr18; - ULONG Gpr19; - ULONG Gpr20; - ULONG Gpr21; - ULONG Gpr22; - ULONG Gpr23; - ULONG Gpr24; - ULONG Gpr25; - ULONG Gpr26; - ULONG Gpr27; - ULONG Gpr28; - ULONG Gpr29; - ULONG Gpr30; - ULONG Gpr31; - - ULONG Cr; // Condition register - ULONG Xer; // Fixed point exception register - - // - // This section is specified/returned if the ContextFlags word contains - // the flag CONTEXT_CONTROL. - // - - ULONG Msr; // Machine status register - ULONG Iar; // Instruction address register - ULONG Lr; // Link register - ULONG Ctr; // Count register - - // - // The flags values within this flag control the contents of - // a CONTEXT record. - // - // If the context record is used as an input parameter, then - // for each portion of the context record controlled by a flag - // whose value is set, it is assumed that that portion of the - // context record contains valid context. If the context record - // is being used to modify a thread's context, then only that - // portion of the threads context will be modified. - // - // If the context record is used as an IN OUT parameter to capture - // the context of a thread, then only those portions of the thread's - // context corresponding to set flags will be returned. - // - // The context record is never used as an OUT only parameter. - // - - ULONG ContextFlags; - - ULONG Fill[3]; // Pad out to multiple of 16 bytes - - // - // This section is specified/returned if CONTEXT_DEBUG_REGISTERS is - // set in ContextFlags. Note that CONTEXT_DEBUG_REGISTERS is NOT - // included in CONTEXT_FULL. - // - ULONG Dr0; // Breakpoint Register 1 - ULONG Dr1; // Breakpoint Register 2 - ULONG Dr2; // Breakpoint Register 3 - ULONG Dr3; // Breakpoint Register 4 - ULONG Dr4; // Breakpoint Register 5 - ULONG Dr5; // Breakpoint Register 6 - ULONG Dr6; // Debug Status Register - ULONG Dr7; // Debug Control Register - -} CONTEXT, *PCONTEXT, *LPCONTEXT; - -#elif defined(_SPARC_) - -#define CONTEXT_CONTROL 0x00000001L -#define CONTEXT_FLOATING_POINT 0x00000002L -#define CONTEXT_INTEGER 0x00000004L - -#define COUNT_FLOATING_REGISTER 32 -#define COUNT_DOUBLE_REGISTER 16 -#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER) -#define CONTEXT_ALL CONTEXT_FULL - -typedef struct _CONTEXT { - // - // This section is specified/returned if the ContextFlags word contains - // the flag CONTEXT_INTEGER. - // - ULONG g0; - ULONG g1; - ULONG g2; - ULONG g3; - ULONG g4; - ULONG g5; - ULONG g6; - ULONG g7; - ULONG o0; - ULONG o1; - ULONG o2; - ULONG o3; - ULONG o4; - ULONG o5; - ULONG sp; - ULONG o7; - ULONG l0; - ULONG l1; - ULONG l2; - ULONG l3; - ULONG l4; - ULONG l5; - ULONG l6; - ULONG l7; - ULONG i0; - ULONG i1; - ULONG i2; - ULONG i3; - ULONG i4; - ULONG i5; - ULONG fp; - ULONG i7; - - ULONG y; - - // - // This section is specified/returned if the ContextFlags word contains - // the flag CONTEXT_CONTROL. - // -#if defined(__sparcv9) - ULONG ccr; -#else - ULONG psr; -#endif - ULONG pc; // program counter - ULONG npc; // next address to be executed - - ULONG ContextFlags; - - // - // This section is specified/returned if the ContextFlags word contains - // the flag CONTEXT_FLOATING_POINT. - // - ULONGLONG fsr; - union { - float f[COUNT_FLOATING_REGISTER]; - double d[COUNT_DOUBLE_REGISTER]; - } fprs; - -} CONTEXT, *PCONTEXT, *LPCONTEXT; - -#elif defined(_PARISC_) - -// ToDo: Get this correct for PARISC architecture -#define CONTEXT_CONTROL 0x00000001L -#define CONTEXT_FLOATING_POINT 0x00000002L -#define CONTEXT_INTEGER 0x00000004L - -#define COUNT_FLOATING_REGISTER 32 -#define COUNT_DOUBLE_REGISTER 16 -#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER) -#define CONTEXT_ALL CONTEXT_FULL - -typedef struct _CONTEXT { - // - // This section is specified/returned if the ContextFlags word contains - // the flag CONTEXT_INTEGER. - // - ULONG g0; - ULONG g1; - ULONG g2; - ULONG g3; - ULONG g4; - ULONG g5; - ULONG g6; - ULONG g7; - ULONG o0; - ULONG o1; - ULONG o2; - ULONG o3; - ULONG o4; - ULONG o5; - ULONG sp; - ULONG o7; - ULONG l0; - ULONG l1; - ULONG l2; - ULONG l3; - ULONG l4; - ULONG l5; - ULONG l6; - ULONG l7; - ULONG i0; - ULONG i1; - ULONG i2; - ULONG i3; - ULONG i4; - ULONG i5; - ULONG fp; - ULONG i7; - - ULONG y; - - // - // This section is specified/returned if the ContextFlags word contains - // the flag CONTEXT_CONTROL. - // - ULONG psr; - ULONG pc; // program counter - ULONG npc; // next address to be executed - - ULONG ContextFlags; - - // - // This section is specified/returned if the ContextFlags word contains - // the flag CONTEXT_FLOATING_POINT. - // - ULONGLONG fsr; - union { - float f[COUNT_FLOATING_REGISTER]; - double d[COUNT_DOUBLE_REGISTER]; - } fprs; - -} CONTEXT, *PCONTEXT, *LPCONTEXT; - -#elif defined(_IA64_) - -// copied from winnt.h -typedef struct _FLOAT128 { - __int64 LowPart; - __int64 HighPart; -} FLOAT128; - -typedef FLOAT128 *PFLOAT128; - -// begin_ntddk begin_nthal - -// -// The following flags control the contents of the CONTEXT structure. -// - -#if !defined(RC_INVOKED) - -#define CONTEXT_IA64 0x00080000 - -#define CONTEXT_CONTROL (CONTEXT_IA64 | 0x00000001L) -#define CONTEXT_LOWER_FLOATING_POINT (CONTEXT_IA64 | 0x00000002L) -#define CONTEXT_HIGHER_FLOATING_POINT (CONTEXT_IA64 | 0x00000004L) -#define CONTEXT_INTEGER (CONTEXT_IA64 | 0x00000008L) -#define CONTEXT_DEBUG (CONTEXT_IA64 | 0x00000010L) -#define CONTEXT_IA32_CONTROL (CONTEXT_IA64 | 0x00000020L) // Includes StIPSR - - -#define CONTEXT_FLOATING_POINT (CONTEXT_LOWER_FLOATING_POINT | CONTEXT_HIGHER_FLOATING_POINT) -#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER | CONTEXT_IA32_CONTROL) -#define CONTEXT_ALL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER | CONTEXT_DEBUG | CONTEXT_IA32_CONTROL) - -#define CONTEXT_EXCEPTION_ACTIVE 0x8000000 -#define CONTEXT_SERVICE_ACTIVE 0x10000000 -#define CONTEXT_EXCEPTION_REQUEST 0x40000000 -#define CONTEXT_EXCEPTION_REPORTING 0x80000000 - -#endif // !defined(RC_INVOKED) - -// -// Context Frame -// -// This frame has a several purposes: 1) it is used as an argument to -// NtContinue, 2) it is used to construct a call frame for APC delivery, -// 3) it is used to construct a call frame for exception dispatching -// in user mode, 4) it is used in the user level thread creation -// routines, and 5) it is used to to pass thread state to debuggers. -// -// N.B. Because this record is used as a call frame, it must be EXACTLY -// a multiple of 16 bytes in length and aligned on a 16-byte boundary. -// - -typedef struct _CONTEXT { - - // - // The flags values within this flag control the contents of - // a CONTEXT record. - // - // If the context record is used as an input parameter, then - // for each portion of the context record controlled by a flag - // whose value is set, it is assumed that that portion of the - // context record contains valid context. If the context record - // is being used to modify a thread's context, then only that - // portion of the threads context will be modified. - // - // If the context record is used as an IN OUT parameter to capture - // the context of a thread, then only those portions of the thread's - // context corresponding to set flags will be returned. - // - // The context record is never used as an OUT only parameter. - // - - DWORD ContextFlags; - DWORD Fill1[3]; // for alignment of following on 16-byte boundary - - // - // This section is specified/returned if the ContextFlags word contains - // the flag CONTEXT_DEBUG. - // - // N.B. CONTEXT_DEBUG is *not* part of CONTEXT_FULL. - // - - ULONGLONG DbI0; - ULONGLONG DbI1; - ULONGLONG DbI2; - ULONGLONG DbI3; - ULONGLONG DbI4; - ULONGLONG DbI5; - ULONGLONG DbI6; - ULONGLONG DbI7; - - ULONGLONG DbD0; - ULONGLONG DbD1; - ULONGLONG DbD2; - ULONGLONG DbD3; - ULONGLONG DbD4; - ULONGLONG DbD5; - ULONGLONG DbD6; - ULONGLONG DbD7; - - // - // This section is specified/returned if the ContextFlags word contains - // the flag CONTEXT_LOWER_FLOATING_POINT. - // - - FLOAT128 FltS0; - FLOAT128 FltS1; - FLOAT128 FltS2; - FLOAT128 FltS3; - FLOAT128 FltT0; - FLOAT128 FltT1; - FLOAT128 FltT2; - FLOAT128 FltT3; - FLOAT128 FltT4; - FLOAT128 FltT5; - FLOAT128 FltT6; - FLOAT128 FltT7; - FLOAT128 FltT8; - FLOAT128 FltT9; - - // - // This section is specified/returned if the ContextFlags word contains - // the flag CONTEXT_HIGHER_FLOATING_POINT. - // - - FLOAT128 FltS4; - FLOAT128 FltS5; - FLOAT128 FltS6; - FLOAT128 FltS7; - FLOAT128 FltS8; - FLOAT128 FltS9; - FLOAT128 FltS10; - FLOAT128 FltS11; - FLOAT128 FltS12; - FLOAT128 FltS13; - FLOAT128 FltS14; - FLOAT128 FltS15; - FLOAT128 FltS16; - FLOAT128 FltS17; - FLOAT128 FltS18; - FLOAT128 FltS19; - - FLOAT128 FltF32; - FLOAT128 FltF33; - FLOAT128 FltF34; - FLOAT128 FltF35; - FLOAT128 FltF36; - FLOAT128 FltF37; - FLOAT128 FltF38; - FLOAT128 FltF39; - - FLOAT128 FltF40; - FLOAT128 FltF41; - FLOAT128 FltF42; - FLOAT128 FltF43; - FLOAT128 FltF44; - FLOAT128 FltF45; - FLOAT128 FltF46; - FLOAT128 FltF47; - FLOAT128 FltF48; - FLOAT128 FltF49; - - FLOAT128 FltF50; - FLOAT128 FltF51; - FLOAT128 FltF52; - FLOAT128 FltF53; - FLOAT128 FltF54; - FLOAT128 FltF55; - FLOAT128 FltF56; - FLOAT128 FltF57; - FLOAT128 FltF58; - FLOAT128 FltF59; - - FLOAT128 FltF60; - FLOAT128 FltF61; - FLOAT128 FltF62; - FLOAT128 FltF63; - FLOAT128 FltF64; - FLOAT128 FltF65; - FLOAT128 FltF66; - FLOAT128 FltF67; - FLOAT128 FltF68; - FLOAT128 FltF69; - - FLOAT128 FltF70; - FLOAT128 FltF71; - FLOAT128 FltF72; - FLOAT128 FltF73; - FLOAT128 FltF74; - FLOAT128 FltF75; - FLOAT128 FltF76; - FLOAT128 FltF77; - FLOAT128 FltF78; - FLOAT128 FltF79; - - FLOAT128 FltF80; - FLOAT128 FltF81; - FLOAT128 FltF82; - FLOAT128 FltF83; - FLOAT128 FltF84; - FLOAT128 FltF85; - FLOAT128 FltF86; - FLOAT128 FltF87; - FLOAT128 FltF88; - FLOAT128 FltF89; - - FLOAT128 FltF90; - FLOAT128 FltF91; - FLOAT128 FltF92; - FLOAT128 FltF93; - FLOAT128 FltF94; - FLOAT128 FltF95; - FLOAT128 FltF96; - FLOAT128 FltF97; - FLOAT128 FltF98; - FLOAT128 FltF99; - - FLOAT128 FltF100; - FLOAT128 FltF101; - FLOAT128 FltF102; - FLOAT128 FltF103; - FLOAT128 FltF104; - FLOAT128 FltF105; - FLOAT128 FltF106; - FLOAT128 FltF107; - FLOAT128 FltF108; - FLOAT128 FltF109; - - FLOAT128 FltF110; - FLOAT128 FltF111; - FLOAT128 FltF112; - FLOAT128 FltF113; - FLOAT128 FltF114; - FLOAT128 FltF115; - FLOAT128 FltF116; - FLOAT128 FltF117; - FLOAT128 FltF118; - FLOAT128 FltF119; - - FLOAT128 FltF120; - FLOAT128 FltF121; - FLOAT128 FltF122; - FLOAT128 FltF123; - FLOAT128 FltF124; - FLOAT128 FltF125; - FLOAT128 FltF126; - FLOAT128 FltF127; - - // - // This section is specified/returned if the ContextFlags word contains - // the flag CONTEXT_LOWER_FLOATING_POINT | CONTEXT_HIGHER_FLOATING_POINT | CONTEXT_CONTROL. - // - - ULONGLONG StFPSR; // FP status - - // - // This section is specified/returned if the ContextFlags word contains - // the flag CONTEXT_INTEGER. - // - // N.B. The registers gp, sp, rp are part of the control context - // - - ULONGLONG IntGp; // r1, volatile - ULONGLONG IntT0; // r2-r3, volatile - ULONGLONG IntT1; // - ULONGLONG IntS0; // r4-r7, preserved - ULONGLONG IntS1; - ULONGLONG IntS2; - ULONGLONG IntS3; - ULONGLONG IntV0; // r8, volatile - ULONGLONG IntT2; // r9-r11, volatile - ULONGLONG IntT3; - ULONGLONG IntT4; - ULONGLONG IntSp; // stack pointer (r12), special - ULONGLONG IntTeb; // teb (r13), special - ULONGLONG IntT5; // r14-r31, volatile - ULONGLONG IntT6; - ULONGLONG IntT7; - ULONGLONG IntT8; - ULONGLONG IntT9; - ULONGLONG IntT10; - ULONGLONG IntT11; - ULONGLONG IntT12; - ULONGLONG IntT13; - ULONGLONG IntT14; - ULONGLONG IntT15; - ULONGLONG IntT16; - ULONGLONG IntT17; - ULONGLONG IntT18; - ULONGLONG IntT19; - ULONGLONG IntT20; - ULONGLONG IntT21; - ULONGLONG IntT22; - - ULONGLONG IntNats; // Nat bits for r1-r31 - // r1-r31 in bits 1 thru 31. - ULONGLONG Preds; // predicates, preserved - - ULONGLONG BrRp; // return pointer, b0, preserved - ULONGLONG BrS0; // b1-b5, preserved - ULONGLONG BrS1; - ULONGLONG BrS2; - ULONGLONG BrS3; - ULONGLONG BrS4; - ULONGLONG BrT0; // b6-b7, volatile - ULONGLONG BrT1; - - // - // This section is specified/returned if the ContextFlags word contains - // the flag CONTEXT_CONTROL. - // - - // Other application registers - ULONGLONG ApUNAT; // User Nat collection register, preserved - ULONGLONG ApLC; // Loop counter register, preserved - ULONGLONG ApEC; // Epilog counter register, preserved - ULONGLONG ApCCV; // CMPXCHG value register, volatile - ULONGLONG ApDCR; // Default control register (TBD) - - // Register stack info - ULONGLONG RsPFS; // Previous function state, preserved - ULONGLONG RsBSP; // Backing store pointer, preserved - ULONGLONG RsBSPSTORE; - ULONGLONG RsRSC; // RSE configuration, volatile - ULONGLONG RsRNAT; // RSE Nat collection register, preserved - - // Trap Status Information - ULONGLONG StIPSR; // Interruption Processor Status - ULONGLONG StIIP; // Interruption IP - ULONGLONG StIFS; // Interruption Function State - - // iA32 related control registers - ULONGLONG StFCR; // copy of Ar21 - ULONGLONG Eflag; // Eflag copy of Ar24 - ULONGLONG SegCSD; // iA32 CSDescriptor (Ar25) - ULONGLONG SegSSD; // iA32 SSDescriptor (Ar26) - ULONGLONG Cflag; // Cr0+Cr4 copy of Ar27 - ULONGLONG StFSR; // x86 FP status (copy of AR28) - ULONGLONG StFIR; // x86 FP status (copy of AR29) - ULONGLONG StFDR; // x86 FP status (copy of AR30) - - ULONGLONG UNUSEDPACK; // added to pack StFDR to 16-bytes - -} CONTEXT, *PCONTEXT, *LPCONTEXT; #elif defined(_AMD64_) // copied from winnt.h @@ -3290,9 +2530,7 @@ PALIMPORT BOOL PALAPI PAL_VirtualUnwindOutOfProc(CONTEXT *context, /* PAL_CS_NATIVE_DATA_SIZE is defined as sizeof(PAL_CRITICAL_SECTION_NATIVE_DATA) */ -#if defined(_AIX) -#define PAL_CS_NATIVE_DATA_SIZE 100 -#elif defined(__APPLE__) && defined(__i386__) +#if defined(__APPLE__) && defined(__i386__) #define PAL_CS_NATIVE_DATA_SIZE 76 #elif defined(__APPLE__) && defined(__x86_64__) #define PAL_CS_NATIVE_DATA_SIZE 120 @@ -3300,8 +2538,6 @@ PALIMPORT BOOL PALAPI PAL_VirtualUnwindOutOfProc(CONTEXT *context, #define PAL_CS_NATIVE_DATA_SIZE 12 #elif defined(__FreeBSD__) && defined(__x86_64__) #define PAL_CS_NATIVE_DATA_SIZE 24 -#elif defined(__hpux__) && (defined(__hppa__) || defined (__ia64__)) -#define PAL_CS_NATIVE_DATA_SIZE 148 #elif defined(__linux__) && defined(_ARM_) #define PAL_CS_NATIVE_DATA_SIZE 80 #elif defined(__linux__) && defined(_ARM64_) @@ -3314,18 +2550,8 @@ PALIMPORT BOOL PALAPI PAL_VirtualUnwindOutOfProc(CONTEXT *context, #define PAL_CS_NATIVE_DATA_SIZE 96 #elif defined(__NetBSD__) && defined(__earm__) #define PAL_CS_NATIVE_DATA_SIZE 56 -#elif defined(__NetBSD__) && defined(__hppa__) -#define PAL_CS_NATIVE_DATA_SIZE 92 #elif defined(__NetBSD__) && defined(__i386__) #define PAL_CS_NATIVE_DATA_SIZE 56 -#elif defined(__NetBSD__) && defined(__mips__) -#define PAL_CS_NATIVE_DATA_SIZE 56 -#elif defined(__NetBSD__) && (defined(__sparc__) && !defined(__sparc64__)) -#define PAL_CS_NATIVE_DATA_SIZE 56 -#elif defined(__NetBSD__) && defined(__sparc64__) -#define PAL_CS_NATIVE_DATA_SIZE 92 -#elif defined(__sun__) -#define PAL_CS_NATIVE_DATA_SIZE 48 #else #warning #error PAL_CS_NATIVE_DATA_SIZE is not defined for this architecture @@ -6790,20 +6016,14 @@ public: #ifdef __APPLE__ #define MAKEDLLNAME_W(name) u"lib" name u".dylib" #define MAKEDLLNAME_A(name) "lib" name ".dylib" -#elif defined(_AIX) -#define MAKEDLLNAME_W(name) L"lib" name L".a" -#define MAKEDLLNAME_A(name) "lib" name ".a" -#elif defined(__hppa__) || defined(_IA64_) -#define MAKEDLLNAME_W(name) L"lib" name L".sl" -#define MAKEDLLNAME_A(name) "lib" name ".sl" #else #define MAKEDLLNAME_W(name) u"lib" name u".so" #define MAKEDLLNAME_A(name) "lib" name ".so" #endif -#else +#else // PLATFORM_UNIX #define MAKEDLLNAME_W(name) name L".dll" #define MAKEDLLNAME_A(name) name ".dll" -#endif +#endif // PLATFORM_UNIX #ifdef UNICODE #define MAKEDLLNAME(x) MAKEDLLNAME_W(x) @@ -6815,10 +6035,6 @@ public: #if __APPLE__ #define PAL_SHLIB_SUFFIX ".dylib" -#elif _AIX -#define PAL_SHLIB_SUFFIX ".a" -#elif _HPUX_ -#define PAL_SHLIB_SUFFIX ".sl" #else #define PAL_SHLIB_SUFFIX ".so" #endif diff --git a/src/pal/inc/rt/intsafe.h b/src/pal/inc/rt/intsafe.h index 2ab2cf1..5cdf659 100644 --- a/src/pal/inc/rt/intsafe.h +++ b/src/pal/inc/rt/intsafe.h @@ -93,8 +93,7 @@ typedef LONG HRESULT; #define LODWORD(_qw) ((ULONG)(_qw)) #if defined(MIDL_PASS) || defined(RC_INVOKED) || defined(_M_CEE_PURE) \ - || defined(_68K_) || defined(_MPPC_) || defined(_PPC_) \ - || defined(_M_IA64) || defined(_M_AMD64) || defined(__ARM_ARCH) + || defined(_M_AMD64) || defined(__ARM_ARCH) #ifndef UInt32x32To64 #define UInt32x32To64(a, b) ((unsigned __int64)((ULONG)(a)) * (unsigned __int64)((ULONG)(b))) diff --git a/src/pal/inc/rt/palrt.h b/src/pal/inc/rt/palrt.h index ce637ba..e2d844d 100644 --- a/src/pal/inc/rt/palrt.h +++ b/src/pal/inc/rt/palrt.h @@ -243,7 +243,7 @@ inline void *__cdecl operator new(size_t, void *_P) #define ARGUMENT_PRESENT(ArgumentPointer) (\ (CHAR *)(ArgumentPointer) != (CHAR *)(NULL) ) -#if defined(_WIN64) || defined(_M_ALPHA) +#if defined(_WIN64) #define MAX_NATURAL_ALIGNMENT sizeof(ULONGLONG) #else #define MAX_NATURAL_ALIGNMENT sizeof(ULONG) diff --git a/src/pal/src/cruntime/math.cpp b/src/pal/src/cruntime/math.cpp index 08f4192..d53dbe7 100644 --- a/src/pal/src/cruntime/math.cpp +++ b/src/pal/src/cruntime/math.cpp @@ -66,11 +66,7 @@ int __cdecl _finite(double x) PERF_ENTRY(_finite); ENTRY("_finite (x=%f)\n", x); -#if defined(_IA64_) && defined (_HPUX_) - ret = !isnan(x) && (x != PAL_POSINF_DBL) && (x != PAL_NEGINF_DBL); -#else ret = isfinite(x); -#endif LOGEXIT("_finite returns int %d\n", ret); PERF_EXIT(_finite); @@ -452,11 +448,7 @@ int __cdecl _finitef(float x) PERF_ENTRY(_finitef); ENTRY("_finitef (x=%f)\n", x); -#if defined(_IA64_) && defined (_HPUX_) - ret = !isnan(x) && (x != PAL_POSINF_FLT) && (x != PAL_NEGINF_FLT); -#else ret = isfinite(x); -#endif LOGEXIT("_finitef returns int %d\n", ret); PERF_EXIT(_finitef); diff --git a/src/pal/src/debug/debug.cpp b/src/pal/src/debug/debug.cpp index 2f7d17c..2fd0442 100644 --- a/src/pal/src/debug/debug.cpp +++ b/src/pal/src/debug/debug.cpp @@ -543,229 +543,6 @@ SetThreadContext( return ret; } -/*++ -Function: - PAL_CreateExecWatchpoint - -Abstract - Creates an OS exec watchpoint for the specified instruction - and thread. This function should only be called on architectures - that do not support a hardware single-step mode (e.g., SPARC). - -Parameter - hThread : the thread for which the watchpoint is to apply - pvInstruction : the instruction on which the watchpoint is to be set - -Return - A Win32 error code ---*/ - -DWORD -PAL_CreateExecWatchpoint( - HANDLE hThread, - PVOID pvInstruction - ) -{ - PERF_ENTRY(PAL_CreateExecWatchpoint); - ENTRY("PAL_CreateExecWatchpoint (hThread=%p, pvInstruction=%p)\n", hThread, pvInstruction); - - DWORD dwError = ERROR_NOT_SUPPORTED; - -#if HAVE_PRWATCH_T - - CPalThread *pThread = NULL; - CPalThread *pTargetThread = NULL; - IPalObject *pobjThread = NULL; - int fd = -1; - char ctlPath[50]; - - struct - { - long ctlCode; - prwatch_t prwatch; - } ctlStruct; - - // - // We must never set a watchpoint on an instruction that enters a syscall; - // if such a request comes in we succeed it w/o actually creating the - // watchpoint. This mirrors the behavior of setting the single-step flag - // in a thread context when the thread is w/in a system service -- the - // flag is ignored and will not be present when the thread returns - // to user mode. - // - -#if defined(_SPARC_) - if (*(DWORD*)pvInstruction == 0x91d02008) // ta 8 - { - TRACE("Watchpoint requested on sysenter instruction -- ignoring"); - dwError = ERROR_SUCCESS; - goto PAL_CreateExecWatchpointExit; - } -#else -#error Need syscall instruction for this platform -#endif // _SPARC_ - - pThread = InternalGetCurrentThread(); - - dwError = InternalGetThreadDataFromHandle( - pThread, - hThread, - 0, // THREAD_SET_CONTEXT - &pTargetThread, - &pobjThread - ); - - if (NO_ERROR != dwError) - { - goto PAL_CreateExecWatchpointExit; - } - - snprintf(ctlPath, sizeof(ctlPath), "/proc/%u/lwp/%u/lwpctl", getpid(), pTargetThread->GetLwpId()); - - fd = InternalOpen(pThread, ctlPath, O_WRONLY); - if (-1 == fd) - { - ERROR("Failed to open %s\n", ctlPath); - dwError = ERROR_INVALID_ACCESS; - goto PAL_CreateExecWatchpointExit; - } - - ctlStruct.ctlCode = PCWATCH; - ctlStruct.prwatch.pr_vaddr = (uintptr_t) pvInstruction; - ctlStruct.prwatch.pr_size = sizeof(DWORD); - ctlStruct.prwatch.pr_wflags = WA_EXEC | WA_TRAPAFTER; - - if (write(fd, (void*) &ctlStruct, sizeof(ctlStruct)) != sizeof(ctlStruct)) - { - ERROR("Failure writing control structure (errno = %u)\n", errno); - dwError = ERROR_INTERNAL_ERROR; - goto PAL_CreateExecWatchpointExit; - } - - dwError = ERROR_SUCCESS; - -PAL_CreateExecWatchpointExit: - - if (NULL != pobjThread) - { - pobjThread->ReleaseReference(pThread); - } - - if (-1 != fd) - { - close(fd); - } - -#endif // HAVE_PRWATCH_T - - LOGEXIT("PAL_CreateExecWatchpoint returns ret:%d\n", dwError); - PERF_EXIT(PAL_CreateExecWatchpoint); - return dwError; -} - -/*++ -Function: - PAL_DeleteExecWatchpoint - -Abstract - Deletes an OS exec watchpoint for the specified instruction - and thread. This function should only be called on architectures - that do not support a hardware single-step mode (e.g., SPARC). - -Parameter - hThread : the thread to remove the watchpoint from - pvInstruction : the instruction for which the watchpoint is to be removed - -Return - A Win32 error code. Attempting to delete a watchpoint that does not exist - may or may not result in an error, depending on the behavior of the - underlying operating system. ---*/ - -DWORD -PAL_DeleteExecWatchpoint( - HANDLE hThread, - PVOID pvInstruction - ) -{ - PERF_ENTRY(PAL_DeleteExecWatchpoint); - ENTRY("PAL_DeleteExecWatchpoint (hThread=%p, pvInstruction=%p)\n", hThread, pvInstruction); - - DWORD dwError = ERROR_NOT_SUPPORTED; - -#if HAVE_PRWATCH_T - - CPalThread *pThread = NULL; - CPalThread *pTargetThread = NULL; - IPalObject *pobjThread = NULL; - int fd = -1; - char ctlPath[50]; - - struct - { - long ctlCode; - prwatch_t prwatch; - } ctlStruct; - - - pThread = InternalGetCurrentThread(); - - dwError = InternalGetThreadDataFromHandle( - pThread, - hThread, - 0, // THREAD_SET_CONTEXT - &pTargetThread, - &pobjThread - ); - - if (NO_ERROR != dwError) - { - goto PAL_DeleteExecWatchpointExit; - } - - snprintf(ctlPath, sizeof(ctlPath), "/proc/%u/lwp/%u/lwpctl", getpid(), pTargetThread->GetLwpId()); - - fd = InternalOpen(pThread, ctlPath, O_WRONLY); - if (-1 == fd) - { - ERROR("Failed to open %s\n", ctlPath); - dwError = ERROR_INVALID_ACCESS; - goto PAL_DeleteExecWatchpointExit; - } - - ctlStruct.ctlCode = PCWATCH; - ctlStruct.prwatch.pr_vaddr = (uintptr_t) pvInstruction; - ctlStruct.prwatch.pr_size = sizeof(DWORD); - ctlStruct.prwatch.pr_wflags = 0; - - if (write(fd, (void*) &ctlStruct, sizeof(ctlStruct)) != sizeof(ctlStruct)) - { - ERROR("Failure writing control structure (errno = %u)\n", errno); - dwError = ERROR_INTERNAL_ERROR; - goto PAL_DeleteExecWatchpointExit; - } - - dwError = ERROR_SUCCESS; - -PAL_DeleteExecWatchpointExit: - - if (NULL != pobjThread) - { - pobjThread->ReleaseReference(pThread); - } - - if (-1 != fd) - { - close(fd); - } - -#endif // HAVE_PRWATCH_T - - LOGEXIT("PAL_DeleteExecWatchpoint returns ret:%d\n", dwError); - PERF_EXIT(PAL_DeleteExecWatchpoint); - return dwError; -} - __attribute__((noinline)) __attribute__((optnone)) void diff --git a/src/pal/src/file/disk.cpp b/src/pal/src/file/disk.cpp index ef1d488..08880c9 100644 --- a/src/pal/src/file/disk.cpp +++ b/src/pal/src/file/disk.cpp @@ -26,10 +26,7 @@ Revision History: #include "pal/stackstring.hpp" #include -#if !defined(_AIX) -// do we actually need this on other platforms. We don't seem to be using anything from there #include -#endif #include #if HAVE_STATVFS #include diff --git a/src/pal/src/file/file.cpp b/src/pal/src/file/file.cpp index 6443a5e..5d8d241 100644 --- a/src/pal/src/file/file.cpp +++ b/src/pal/src/file/file.cpp @@ -3657,12 +3657,9 @@ DWORD FILEGetLastErrorFromErrno( void ) case EEXIST: dwRet = ERROR_ALREADY_EXISTS; break; -#if !defined(_AIX) - // ENOTEMPTY is the same as EEXIST on AIX. Meaningful when involving directory operations case ENOTEMPTY: dwRet = ERROR_DIR_NOT_EMPTY; break; -#endif case EBADF: dwRet = ERROR_INVALID_HANDLE; break; diff --git a/src/pal/src/include/pal/modulename.h b/src/pal/src/include/pal/modulename.h index 70b0a61..20001f8 100644 --- a/src/pal/src/include/pal/modulename.h +++ b/src/pal/src/include/pal/modulename.h @@ -28,9 +28,6 @@ extern "C" #endif // __cplusplus const char *PAL_dladdr(LPVOID ProcAddress); -#if defined(_AIX) -int GetLibRotorNameViaLoadQuery(LPSTR pszBuf); -#endif #ifdef __cplusplus } diff --git a/src/pal/src/include/pal/virtual.h b/src/pal/src/include/pal/virtual.h index a4e2252..31d225f 100644 --- a/src/pal/src/include/pal/virtual.h +++ b/src/pal/src/include/pal/virtual.h @@ -58,12 +58,7 @@ enum VIRTUAL_CONSTANTS VIRTUAL_EXECUTE, VIRTUAL_EXECUTE_READ, - /* Page manipulation constants. */ -#ifdef __sparc__ - VIRTUAL_PAGE_SIZE = 0x2000, -#else // __sparc__ VIRTUAL_PAGE_SIZE = 0x1000, -#endif // __sparc__ VIRTUAL_PAGE_MASK = VIRTUAL_PAGE_SIZE - 1, BOUNDARY_64K = 0xffff }; diff --git a/src/pal/src/loader/modulename.cpp b/src/pal/src/loader/modulename.cpp index 026f89b..87c1b02 100644 --- a/src/pal/src/loader/modulename.cpp +++ b/src/pal/src/loader/modulename.cpp @@ -30,118 +30,10 @@ Abstract: #include #endif // NEED_DLCOMPAT -#if defined(_AIX) -#include -#endif - using namespace CorUnix; SET_DEFAULT_DEBUG_CHANNEL(LOADER); -#if defined(_AIX) -/*++ - GetLibRotorNameViaLoadQuery - - Retrieve the full path of the librotor_pal.so using loadquery() - -Parameters: - pszBuf - CHAR array of MAX_PATH_FNAME length - -Return value: - 0 on success - -1 on failure, with last error set ---*/ -int GetLibRotorNameViaLoadQuery(LPSTR pszBuf) -{ - CHAR* pLoadQueryBuf = NULL; - UINT cbBuf = 1024; - struct ld_info * pInfo = NULL; - INT iLQRetVal = -1; - INT iRetVal = -1; - CPalThread *pThread = NULL; - - if (!pszBuf) - { - ASSERT("GetLibRotorNameViaLoadQuery requires non-NULL pszBuf\n"); - SetLastError(ERROR_INTERNAL_ERROR); - goto Done; - } - - pThread = InternalGetCurrentThread(); - // Loop trying to call loadquery with enough memory until either - // 1) we succeed, 2) we run out of memory or 3) loadquery throws - // an error other than ENOMEM - while (iLQRetVal != 0) - { - pLoadQueryBuf = (CHAR*) InternalMalloc (pThread, cbBuf * sizeof(char)); - if (!pLoadQueryBuf) - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - goto Done; - } - iLQRetVal = loadquery(L_GETINFO, pLoadQueryBuf, cbBuf); - if (iLQRetVal < 0) - { - free(pThread, pLoadQueryBuf); - pLoadQueryBuf = NULL; - DWORD dwLastError = GetLastError(); - if (dwLastError == ERROR_NOT_ENOUGH_MEMORY) - { - // The buffer's too small. Try twice as large as a guess... - cbBuf *= 2; - } - else - { - SetLastError(ERROR_INTERNAL_ERROR); - goto Done; - } - } - } - - // We successfully called loadquery, so now see if we can find - // librotor_pal.a in the module list - if (pLoadQueryBuf) - { - pInfo = (struct ld_info *)pLoadQueryBuf; - while (TRUE) - { - if (strstr(pInfo->ldinfo_filename, "librotor_pal.a")) - { - UINT cchFileName = strlen(pInfo->ldinfo_filename); - if (cchFileName + 1 > MAX_PATH_FNAME) - { - ASSERT("Filename returned by loadquery was longer than MAX_PATH_FNAME!\n"); - SetLastError(ERROR_INTERNAL_ERROR); - goto Done; - } - else - { - // The buffer should be large enough to accomodate the filename. - // So, we send in the size of the filename+1 - strcpy_s(pszBuf, MAX_PATH_FNAME, pInfo->ldinfo_filename); - iRetVal = 0; - goto Done; - } - } - else - { - // The (wacky) design of ld_info is that the value of next is an offset in - // bytes rather than a pointer. So we need this weird cast to char * to get - // the pointer math correct. - if (pInfo->ldinfo_next == 0) - break; - else - pInfo = (struct ld_info *) ((char *)pInfo + pInfo->ldinfo_next); - } - } - } -Done: - if (pLoadQueryBuf) - free(pThread, pLoadQueryBuf); - return iRetVal; -} -#endif // defined(_AIX) - /*++ PAL_dladdr @@ -165,31 +57,6 @@ Notes: --*/ const char *PAL_dladdr(LPVOID ProcAddress) { -#if defined(_AIX) || defined(__hppa__) - /* dladdr is not supported on AIX or 32-bit HPUX-PARISC */ - return (NULL); -#elif defined(_HPUX_) && defined(_IA64_) - /* dladdr is not supported on HP-UX/IA64. That said, PAL_dladdr just returns to module name - and we can get that via dlgetname. So use that for HPUX. */ - { - char* pszName = NULL; - load_module_desc desc; - __uint64_t uimodret = NULL; - uimodret = dlmodinfo((__uint64_t)ProcAddress, &desc, sizeof(desc), NULL, 0, 0); - if (!uimodret) - { - WARN("dlmodinfo call failed! dlerror says '%s'\n", dlerror()); - return NULL; - } - pszName = dlgetname(&desc, sizeof(desc), NULL, 0, 0); - if (!pszName) - { - WARN("dlgetname desc didn't describe a loaded module?! dlerror says '%s'\n", dlerror()); - return NULL; - } - return pszName; - } -#else Dl_info dl_info; if (!dladdr(ProcAddress, &dl_info)) { @@ -202,6 +69,5 @@ const char *PAL_dladdr(LPVOID ProcAddress) /* Return the module name */ return dl_info.dli_fname; } -#endif } diff --git a/src/pal/src/misc/perftrace.cpp b/src/pal/src/misc/perftrace.cpp index d4fba33..9c66d4a 100644 --- a/src/pal/src/misc/perftrace.cpp +++ b/src/pal/src/misc/perftrace.cpp @@ -231,11 +231,7 @@ PERFGetTicks(){ #endif return ((ULONGLONG)((unsigned int)(d)) << 32) | (unsigned int)(a); #else -#ifdef __sparc__ - return (ULONGLONG)gethrtime(); -#else return 0; // on non-BSD and non-Windows, we'll return 0 for now. -#endif // __sparc__ #endif // _X86_ } diff --git a/src/pal/src/misc/sysinfo.cpp b/src/pal/src/misc/sysinfo.cpp index e7589e8..3ccb35a 100644 --- a/src/pal/src/misc/sysinfo.cpp +++ b/src/pal/src/misc/sysinfo.cpp @@ -76,11 +76,6 @@ Revision History: SET_DEFAULT_DEBUG_CHANNEL(MISC); -#if defined(_HPUX_) && ( defined (_IA64_) || defined (__hppa__) ) -#include -#include -#endif - #ifndef __APPLE__ #if HAVE_SYSCONF && HAVE__SC_AVPHYS_PAGES #define SYSCONF_PAGES _SC_AVPHYS_PAGES @@ -135,22 +130,11 @@ GetSystemInfo( lpSystemInfo->dwActiveProcessorMask_PAL_Undefined = 0; #if HAVE_SYSCONF -#if defined(_HPUX_) && ( defined (_IA64_) || defined (__hppa__) ) - struct pst_dynamic psd; - if (pstat_getdynamic(&psd, sizeof(psd), (size_t)1, 0) != -1) { - nrcpus = psd.psd_proc_cnt; - } - else { - ASSERT("pstat_getdynamic failed (%d)\n", errno); - } - -#else // !__hppa__ nrcpus = sysconf(_SC_NPROCESSORS_ONLN); if (nrcpus < 1) { ASSERT("sysconf failed for _SC_NPROCESSORS_ONLN (%d)\n", errno); } -#endif // __hppa__ #elif HAVE_SYSCTL int rc; size_t sz; @@ -171,7 +155,7 @@ GetSystemInfo( #ifdef VM_MAXUSER_ADDRESS lpSystemInfo->lpMaximumApplicationAddress = (PVOID) VM_MAXUSER_ADDRESS; -#elif defined(__sun__) || defined(_AIX) || defined(__hppa__) || ( defined (_IA64_) && defined (_HPUX_) ) || defined(__linux__) +#elif defined(__linux__) lpSystemInfo->lpMaximumApplicationAddress = (PVOID) (1ull << 47); #elif defined(USERLIMIT) lpSystemInfo->lpMaximumApplicationAddress = (PVOID) USERLIMIT; diff --git a/src/pal/src/safecrt/cruntime.h b/src/pal/src/safecrt/cruntime.h index cdad474..7341a38 100644 --- a/src/pal/src/safecrt/cruntime.h +++ b/src/pal/src/safecrt/cruntime.h @@ -36,11 +36,11 @@ #endif /* defined (_SYSCRT) && defined (_WIN64) */ #if !defined (UNALIGNED) -#if defined (_M_IA64) || defined (_M_AMD64) +#if defined (_M_AMD64) #define UNALIGNED __unaligned -#else /* defined (_M_IA64) || defined (_M_AMD64) */ +#else /* defined (_M_AMD64) */ #define UNALIGNED -#endif /* defined (_M_IA64) || defined (_M_AMD64) */ +#endif /* defined (_M_AMD64) */ #endif /* !defined (UNALIGNED) */ #ifdef _M_IX86 @@ -57,9 +57,9 @@ #define REG8 #define REG9 -#elif defined (_M_IA64) || defined (_M_AMD64) +#elif defined (_M_AMD64) /* - * IA64 + * AMD64 */ #define REG1 register #define REG2 register @@ -71,7 +71,7 @@ #define REG8 register #define REG9 register -#else /* defined (_M_IA64) || defined (_M_AMD64) */ +#else /* defined (_M_AMD64) */ #pragma message ("Machine register set not defined") @@ -89,7 +89,7 @@ #define REG8 #define REG9 -#endif /* defined (_M_IA64) || defined (_M_AMD64) */ +#endif /* defined (_M_AMD64) */ /* * Are the macro definitions below still needed in this file? diff --git a/src/pal/src/shmemory/shmemory.cpp b/src/pal/src/shmemory/shmemory.cpp index 42e06be..35dadd6 100644 --- a/src/pal/src/shmemory/shmemory.cpp +++ b/src/pal/src/shmemory/shmemory.cpp @@ -189,10 +189,6 @@ SET_DEFAULT_DEBUG_CHANNEL(SHMEM); #define SEGMENT_NAME_SUFFIX_LENGTH 10 -#if defined(_DEBUG) && defined(_HPUX_) -#define TRACK_SHMLOCK_OWNERSHIP -#endif // _DEBUG && _HPUX_ - /* SHMPTR structure : High byte is SHM segment number @@ -808,24 +804,6 @@ int SHMLock(void) CHECK_CANARIES(header); #endif // TRACK_SHMLOCK_OWNERSHIP -#ifdef _HPUX_ - // - // TODO: workaround for VSW # 381564 - // - if (0 == tmp_pid && my_pid != header->spinlock) - { - ERROR("InterlockedCompareExchange returned the Comperand but " - "failed to store the Exchange value to the Destination: " - "looping again [my_pid=%u header->spinlock=%u tmp_pid=%u " - "spincount=%d locking_thread=%u]\n", (DWORD)my_pid, - (DWORD)header->spinlock, (DWORD)tmp_pid, (int)spincount, - (HANDLE)locking_thread); - - // Keep looping - tmp_pid = 42; - } -#endif // _HPUX_ - if (0 == tmp_pid) { // Spinlock acquired: break out of the loop @@ -964,31 +942,17 @@ int SHMRelease(void) #endif // TRACK_SHMLOCK_OWNERSHIP -#ifdef _HPUX_ - // - // TODO: workaround for VSW # 381564 - // - do -#endif // _HPUX_ - { - /* Make sure we don't touch the spinlock if we don't own it. We're - supposed to own it if we get here, but just in case... */ - tmp_pid = InterlockedCompareExchange((LONG *) &header->spinlock, 0, my_pid); + /* Make sure we don't touch the spinlock if we don't own it. We're + supposed to own it if we get here, but just in case... */ + tmp_pid = InterlockedCompareExchange((LONG *) &header->spinlock, 0, my_pid); - if (tmp_pid != my_pid) - { - ASSERT("Process 0x%08x tried to release spinlock owned by process " - "0x%08x! \n", my_pid, tmp_pid); - PALCLeaveCriticalSection(&shm_critsec); - return 0; - } + if (tmp_pid != my_pid) + { + ASSERT("Process 0x%08x tried to release spinlock owned by process " + "0x%08x! \n", my_pid, tmp_pid); + PALCLeaveCriticalSection(&shm_critsec); + return 0; } -#ifdef _HPUX_ - // - // TODO: workaround for VSW # 381564 - // - while (my_pid == header->spinlock); -#endif // _HPUX_ /* indicate no thread (in this process) holds the SHM lock */ locking_thread = 0; diff --git a/src/pal/src/thread/threadsusp.cpp b/src/pal/src/thread/threadsusp.cpp index b31b88d..c7787be 100644 --- a/src/pal/src/thread/threadsusp.cpp +++ b/src/pal/src/thread/threadsusp.cpp @@ -36,16 +36,6 @@ Revision History: #include #include -#if defined(_AIX) -// AIX requires explicit definition of the union semun (see semctl man page) -union semun -{ - int val; - struct semid_ds * buf; - unsigned short * array; -}; -#endif - using namespace CorUnix; /* ------------------- Definitions ------------------------------*/ diff --git a/src/pal/tests/palsuite/composite/synchronization/nativecriticalsection/pal_composite_native_cs.cpp b/src/pal/tests/palsuite/composite/synchronization/nativecriticalsection/pal_composite_native_cs.cpp index 40efacd..0ccd5c9 100644 --- a/src/pal/tests/palsuite/composite/synchronization/nativecriticalsection/pal_composite_native_cs.cpp +++ b/src/pal/tests/palsuite/composite/synchronization/nativecriticalsection/pal_composite_native_cs.cpp @@ -445,13 +445,9 @@ ULONGLONG GetTicks(void) asm volatile("rdtsc":"=a" (a), "=d" (d)); return ((ULONGLONG)((unsigned int)(d)) << 32) | (unsigned int)(a); #else -#if defined(__sparc__) || (defined (_HPUX_) && defined(__ia64__)) - return (ULONGLONG)gethrtime(); -#else // #error Don''t know how to get ticks on this platform return (ULONGLONG)gethrtime(); -#endif // __sparc__ -#endif // _X86_ +#endif // i386 } diff --git a/src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/pal_composite_native_cs.cpp b/src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/pal_composite_native_cs.cpp index 4c19d3b..ec5c1c3 100644 --- a/src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/pal_composite_native_cs.cpp +++ b/src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/pal_composite_native_cs.cpp @@ -449,13 +449,9 @@ ULONGLONG GetTicks(void) asm volatile("rdtsc":"=a" (a), "=d" (d)); return ((ULONGLONG)((unsigned int)(d)) << 32) | (unsigned int)(a); #else -#if defined(__sparc__) || (defined (_HPUX_) && defined(__ia64__)) - return (ULONGLONG)gethrtime(); -#else // #error Don''t know how to get ticks on this platform return (ULONGLONG)gethrtime(); -#endif // __sparc__ -#endif // _X86_ +#endif // i386 } diff --git a/src/pal/tests/palsuite/file_io/ReadFile/test2/ReadFile.cpp b/src/pal/tests/palsuite/file_io/ReadFile/test2/ReadFile.cpp index f16858e..789e001 100644 --- a/src/pal/tests/palsuite/file_io/ReadFile/test2/ReadFile.cpp +++ b/src/pal/tests/palsuite/file_io/ReadFile/test2/ReadFile.cpp @@ -30,11 +30,7 @@ const char* szResultsFile = "Results.txt"; //Previously number of tests was 6, now 4 refer VSW 312690 #define NOOFTESTS 4 -#ifdef __sparc__ -const int PAGESIZE = 8192; -#else // __sparc__ const int PAGESIZE = 4096; -#endif // __sparc__ char *readBuffer; diff --git a/src/pal/tests/palsuite/file_io/WriteFile/test2/WriteFile.cpp b/src/pal/tests/palsuite/file_io/WriteFile/test2/WriteFile.cpp index 24c148a..9345bc6 100644 --- a/src/pal/tests/palsuite/file_io/WriteFile/test2/WriteFile.cpp +++ b/src/pal/tests/palsuite/file_io/WriteFile/test2/WriteFile.cpp @@ -20,11 +20,7 @@ char* writeBuffer; const char* szWritableFile = "Writeable.txt"; const char* szResultsFile = "Results.txt"; -#ifdef __sparc__ -const int PAGESIZE = 8192; -#else // __sparc__ const int PAGESIZE = 4096; -#endif // __sparc__ BOOL writeTest(DWORD dwByteCount, DWORD dwBytesWrittenResult, BOOL bResult) { diff --git a/src/pal/tests/palsuite/miscellaneous/InterlockedExchange64/test1/test.cpp b/src/pal/tests/palsuite/miscellaneous/InterlockedExchange64/test1/test.cpp index 12e8b50..bd26a54 100644 --- a/src/pal/tests/palsuite/miscellaneous/InterlockedExchange64/test1/test.cpp +++ b/src/pal/tests/palsuite/miscellaneous/InterlockedExchange64/test1/test.cpp @@ -74,7 +74,7 @@ int __cdecl main(int argc, char *argv[]) { #endif } -#endif //defined(BIT64) && defined(_IA64_) +#endif // BIT64 && PLATFORM_UNIX PAL_Terminate(); return PASS; }