--- old/src/cpu/x86/vm/vm_version_x86.cpp 2012-02-15 10:54:08.000000000 +0100 +++ new/src/cpu/x86/vm/vm_version_x86.cpp 2012-02-15 10:54:08.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -65,8 +65,8 @@ address generate_getPsrInfo() { // Flags to test CPU type. - const uint32_t EFL_AC = 0x40000; - const uint32_t EFL_ID = 0x200000; + const uint32_t HS_EFL_AC = 0x40000; + const uint32_t HS_EFL_ID = 0x200000; // Values for when we don't have a CPUID instruction. const int CPU_FAMILY_SHIFT = 8; const uint32_t CPU_FAMILY_386 = (3 << CPU_FAMILY_SHIFT); @@ -100,7 +100,7 @@ // // if we are unable to change the AC flag, we have a 386 // - __ xorl(rax, EFL_AC); + __ xorl(rax, HS_EFL_AC); __ push(rax); __ popf(); __ pushf(); @@ -118,7 +118,7 @@ // __ bind(detect_486); __ mov(rax, rcx); - __ xorl(rax, EFL_ID); + __ xorl(rax, HS_EFL_ID); __ push(rax); __ popf(); __ pushf(); --- old/src/os/bsd/vm/osThread_bsd.cpp 2012-02-15 10:54:09.000000000 +0100 +++ new/src/os/bsd/vm/osThread_bsd.cpp 2012-02-15 10:54:09.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,7 +49,7 @@ void OSThread::pd_initialize() { assert(this != NULL, "check"); - _thread_id = NULL; + _thread_id = 0; _pthread_id = NULL; _siginfo = NULL; _ucontext = NULL; --- old/src/os/bsd/vm/osThread_bsd.hpp 2012-02-15 10:54:10.000000000 +0100 +++ new/src/os/bsd/vm/osThread_bsd.hpp 2012-02-15 10:54:09.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,9 +40,7 @@ private: #ifdef _ALLBSD_SOURCE - // _thread_id and _pthread_id are the same on BSD - // keep both to minimize code divergence in os_bsd.cpp - pthread_t _thread_id; + thread_t _thread_id; pthread_t _pthread_id; #else // _thread_id is kernel thread id (similar to LWP id on Solaris). Each @@ -64,7 +62,7 @@ void set_caller_sigmask(sigset_t sigmask) { _caller_sigmask = sigmask; } #ifdef _ALLBSD_SOURCE - pthread_t thread_id() const { + thread_t thread_id() const { return _thread_id; } #else @@ -84,7 +82,7 @@ } #endif // ASSERT #ifdef _ALLBSD_SOURCE - void set_thread_id(pthread_t id) { + void set_thread_id(thread_t id) { _thread_id = id; } #else --- old/src/os/bsd/vm/os_bsd.cpp 2012-02-15 10:54:10.000000000 +0100 +++ new/src/os/bsd/vm/os_bsd.cpp 2012-02-15 10:54:10.000000000 +0100 @@ -979,8 +979,8 @@ } #ifdef _ALLBSD_SOURCE - // thread_id is pthread_id on BSD - osthread->set_thread_id(::pthread_self()); + // thread_id is mach thread on BSD + osthread->set_thread_id(::mach_thread_self()); #else // thread_id is kernel thread id (similar to Solaris LWP id) osthread->set_thread_id(os::Bsd::gettid()); @@ -1171,7 +1171,7 @@ // Store pthread info into the OSThread #ifdef _ALLBSD_SOURCE - osthread->set_thread_id(::pthread_self()); + osthread->set_thread_id(::mach_thread_self()); #else osthread->set_thread_id(os::Bsd::gettid()); #endif @@ -1788,7 +1788,7 @@ return n; } -intx os::current_thread_id() { return (intx)pthread_self(); } +intx os::current_thread_id() { return (intx)::mach_thread_self(); } int os::current_process_id() { // Under the old bsd thread library, bsd gives each thread @@ -5133,9 +5133,9 @@ struct thread_basic_info tinfo; mach_msg_type_number_t tcount = THREAD_INFO_MAX; kern_return_t kr; - mach_port_t mach_thread; + thread_t mach_thread; - mach_thread = pthread_mach_thread_np(thread->osthread()->thread_id()); + mach_thread = thread->osthread()->thread_id(); kr = thread_info(mach_thread, THREAD_BASIC_INFO, (thread_info_t)&tinfo, &tcount); if (kr != KERN_SUCCESS) return -1; --- old/src/os/bsd/vm/os_bsd.inline.hpp 2012-02-15 10:54:11.000000000 +0100 +++ new/src/os/bsd/vm/os_bsd.inline.hpp 2012-02-15 10:54:11.000000000 +0100 @@ -42,6 +42,7 @@ #include #include #include +#include inline void* os::thread_local_storage_at(int index) { return pthread_getspecific((pthread_key_t)index); --- old/src/os_cpu/bsd_x86/vm/vmStructs_bsd_x86.hpp 2012-02-15 10:54:12.000000000 +0100 +++ new/src/os_cpu/bsd_x86/vm/vmStructs_bsd_x86.hpp 2012-02-15 10:54:12.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,7 +34,7 @@ /******************************/ \ /* Threads (NOTE: incomplete) */ \ /******************************/ \ - nonstatic_field(OSThread, _thread_id, pthread_t) \ + nonstatic_field(OSThread, _thread_id, thread_t) \ nonstatic_field(OSThread, _pthread_id, pthread_t) \ /* This must be the last entry, and must be present */ \ last_entry() @@ -46,7 +46,7 @@ /* Posix Thread IDs */ \ /**********************/ \ \ - declare_integer_type(pid_t) \ + declare_unsigned_integer_type(thread_t) \ declare_unsigned_integer_type(pthread_t) \ \ /* This must be the last entry, and must be present */ \ --- old/src/share/vm/utilities/globalDefinitions_gcc.hpp 2012-02-15 10:54:13.000000000 +0100 +++ new/src/share/vm/utilities/globalDefinitions_gcc.hpp 2012-02-15 10:54:13.000000000 +0100 @@ -87,14 +87,6 @@ #endif #ifdef __APPLE__ #include - #if (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4) - // Mac OS X 10.4 defines EFL_AC and EFL_ID, - // which conflict with hotspot variable names. - // - // This has been fixed in Mac OS X 10.5. - #undef EFL_AC - #undef EFL_ID - #endif #endif #include #endif // LINUX || _ALLBSD_SOURCE