Changeset 58
- Timestamp:
- Jul 15, 2010, 2:46:42 PM (15 years ago)
- Location:
- trunk/openjdk/hotspot/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/openjdk/hotspot/src/cpu/x86/vm/jniFastGetField_x86_32.cpp
r2 r58 30 30 #define BUFFER_SIZE 30 31 31 32 #if def _WINDOWS32 #if defined(_WINDOWS) || defined(OS2) 33 33 GetBooleanField_t JNI_FastGetField::jni_fast_GetBooleanField_fp; 34 34 GetByteField_t JNI_FastGetField::jni_fast_GetByteField_fp; … … 110 110 __ jcc (Assembler::notEqual, slow); 111 111 112 #if ndef _WINDOWS112 #if !defined(_WINDOWS) && !defined(__WIN32OS2__) 113 113 __ ret (0); 114 114 #else … … 132 132 __ flush (); 133 133 134 #if ndef _WINDOWS134 #if !defined(_WINDOWS) && !defined(OS2) 135 135 return fast_entry; 136 136 #else … … 227 227 __ pop (rsi); 228 228 229 #if ndef _WINDOWS229 #if !defined(_WINDOWS) && !defined(__WIN32OS2__) 230 230 __ ret (0); 231 231 #else … … 244 244 __ flush (); 245 245 246 #if ndef _WINDOWS246 #if !defined(_WINDOWS) && !defined(OS2) 247 247 return fast_entry; 248 248 #else … … 321 321 __ jcc (Assembler::notEqual, slow_with_pop); 322 322 323 #if ndef _WINDOWS323 #if !defined(_WINDOWS) && !defined(__WIN32OS2__) 324 324 __ ret (0); 325 325 #else … … 345 345 __ flush (); 346 346 347 #if ndef _WINDOWS347 #if !defined(_WINDOWS) && !defined(OS2) 348 348 return fast_entry; 349 349 #else -
trunk/openjdk/hotspot/src/os/windows/vm/os_windows.cpp
r2 r58 56 56 #include <vdmdbg.h> 57 57 58 #ifdef __WIN32OS2__ 59 #include <mmsystem.h> 60 #include <wincon.h> 61 #include <basetsd.h> 62 #define _M_IX86 63 #define _lseeki64 lseek 64 #endif 65 58 66 // for timer info max values which include all bits 59 67 #define ALL_64_BITS CONST64(0xFFFFFFFFFFFFFFFF) … … 531 539 532 540 HANDLE thread_handle = 541 #ifdef __WIN32OS2__ 542 // @todo probably need to cause some per-thread LIBC initialization routine 543 CreateThread(NULL, 544 stack_size, 545 (LPTHREAD_START_ROUTINE) java_start, 546 thread, 547 CREATE_SUSPENDED | STACK_SIZE_PARAM_IS_A_RESERVATION, 548 (LPDWORD)&thread_id); 549 #else 533 550 (HANDLE)_beginthreadex(NULL, 534 551 (unsigned)stack_size, … … 536 553 thread, 537 554 CREATE_SUSPENDED | STACK_SIZE_PARAM_IS_A_RESERVATION, 538 &thread_id); 555 (PDWORD)&thread_id); 556 #endif 539 557 if (thread_handle == NULL) { 540 558 // perhaps STACK_SIZE_PARAM_IS_A_RESERVATION is not supported, try again 541 559 // without the flag. 542 560 thread_handle = 561 #ifdef __WIN32OS2__ 562 // @todo probably need to cause some per-thread LIBC initialization routine 563 CreateThread(NULL, 564 stack_size, 565 (LPTHREAD_START_ROUTINE) java_start, 566 thread, 567 CREATE_SUSPENDED, 568 (LPDWORD)&thread_id); 569 #else 543 570 (HANDLE)_beginthreadex(NULL, 544 571 (unsigned)stack_size, … … 547 574 CREATE_SUSPENDED, 548 575 &thread_id); 576 #endif 549 577 } 550 578 if (thread_handle == NULL) { … … 621 649 622 650 julong os::win32::available_memory() { 651 #ifdef __WIN32OS2__ 652 MEMORYSTATUS ms; 653 ms.dwLength = sizeof(ms); 654 GlobalMemoryStatus(&ms); 655 656 return ms.dwAvailPhys; 657 #else 623 658 // Use GlobalMemoryStatusEx() because GlobalMemoryStatus() may return incorrect 624 659 // value if total memory is larger than 4GB … … 628 663 629 664 return (julong)ms.ullAvailPhys; 665 #endif 630 666 } 631 667 … … 644 680 645 681 // VC6 lacks DWORD_PTR 682 #ifndef __WIN32OS2__ 646 683 #if _MSC_VER < 1300 647 684 typedef UINT_PTR DWORD_PTR; 685 #endif 648 686 #endif 649 687 … … 703 741 704 742 // Constant offset - calculated using offset() 705 static jlong _offset = 116444736000000000 ;743 static jlong _offset = 116444736000000000LL; 706 744 // Fake time counter for reproducible results when debugging 707 745 static jlong fake_time = 0; … … 1331 1369 1332 1370 void* os::dll_lookup(void* handle, const char* name) { 1333 return GetProcAddress((HMODULE)handle, name);1371 return CAST_FROM_FN_PTR(void *, GetProcAddress((HMODULE)handle, name)); 1334 1372 } 1335 1373 … … 1446 1484 static const arch_t arch_array[]={ 1447 1485 {IMAGE_FILE_MACHINE_I386, (char*)"IA 32"}, 1486 #ifndef __WIN32OS2__ 1448 1487 {IMAGE_FILE_MACHINE_AMD64, (char*)"AMD 64"}, 1449 {IMAGE_FILE_MACHINE_IA64, (char*)"IA 64"} 1488 {IMAGE_FILE_MACHINE_IA64, (char*)"IA 64"}, 1489 #endif 1450 1490 }; 1451 1491 #if (defined _M_IA64) … … 1530 1570 case 5000: st->print(" Windows 2000"); break; 1531 1571 case 5001: st->print(" Windows XP"); break; 1572 #ifndef __WIN32OS2__ 1532 1573 case 5002: 1533 1574 case 6000: … … 1573 1614 break; 1574 1615 } 1616 #endif 1575 1617 default: // future windows, print out its major and minor versions 1576 1618 st->print(" Windows NT %d.%d", osvi.dwMajorVersion, osvi.dwMinorVersion); … … 1594 1636 st->print(" %dk page", os::vm_page_size()>>10); 1595 1637 1638 #ifdef __WIN32OS2__ 1639 MEMORYSTATUS ms; 1640 ms.dwLength = sizeof(ms); 1641 GlobalMemoryStatus(&ms); 1642 #else 1596 1643 // Use GlobalMemoryStatusEx() because GlobalMemoryStatus() may return incorrect 1597 1644 // value if total memory is larger than 4GB … … 1599 1646 ms.dwLength = sizeof(ms); 1600 1647 GlobalMemoryStatusEx(&ms); 1648 #endif 1601 1649 1602 1650 st->print(", physical %uk", os::physical_memory() >> 10); 1603 1651 st->print("(%uk free)", os::available_memory() >> 10); 1604 1652 1653 #ifdef __WIN32OS2__ 1654 st->print(", swap %uk", ms.dwTotalPageFile >> 10); 1655 st->print("(%uk free)", ms.dwAvailPageFile >> 10); 1656 #else 1605 1657 st->print(", swap %uk", ms.ullTotalPageFile >> 10); 1606 1658 st->print("(%uk free)", ms.ullAvailPageFile >> 10); 1659 #endif 1607 1660 st->cr(); 1608 1661 } … … 2450 2503 } 2451 2504 2505 #ifndef __WIN32OS2__ 2506 2452 2507 // Windows large page support is available on Windows 2003. In order to use 2453 2508 // large page memory, the administrator must first assign additional privilege … … 2555 2610 } 2556 2611 2612 #endif // ifndef __WIN32OS2__ 2613 2557 2614 bool os::large_page_init() { 2558 2615 if (!UseLargePages) return false; … … 2564 2621 2565 2622 # define WARN(msg) if (warn_on_failure) { warning(msg); } 2623 2624 #ifdef __WIN32OS2__ 2625 WARN("Large page is not supported by the operating system."); 2626 #else 2566 2627 if (resolve_functions_for_large_page_init()) { 2567 2628 if (request_lock_memory_privilege()) { … … 2601 2662 2602 2663 cleanup_after_large_page_init(); 2664 #endif // ifdef __WIN32OS2__ 2665 2603 2666 return success; 2604 2667 } … … 2639 2702 2640 2703 size_t os::large_page_size() { 2704 #ifdef __WIN32OS2__ 2705 return 0; 2706 #else 2641 2707 return _large_page_size; 2708 #endif 2642 2709 } 2643 2710 … … 2657 2724 const DWORD prot = exec ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE; 2658 2725 2726 #ifndef __WIN32OS2__ 2659 2727 if (UseLargePagesIndividualAllocation) { 2660 2728 if (TracePageSizes && Verbose) { … … 2751 2819 return res; 2752 2820 } 2821 #else // ifndef __WIN32OS2__ 2822 // normal policy just allocate it all at once 2823 DWORD flag = MEM_RESERVE | MEM_COMMIT; 2824 char * res = (char *)VirtualAlloc(NULL, bytes, flag, prot); 2825 return res; 2826 #endif // ifndef __WIN32OS2__ 2753 2827 } 2754 2828 … … 3158 3232 _processor_count = si.dwNumberOfProcessors; 3159 3233 3234 #ifdef __WIN32OS2__ 3235 MEMORYSTATUS ms; 3236 ms.dwLength = sizeof(ms); 3237 3238 GlobalMemoryStatus(&ms); 3239 _physical_memory = ms.dwTotalPhys; 3240 #else 3160 3241 MEMORYSTATUSEX ms; 3161 3242 ms.dwLength = sizeof(ms); … … 3165 3246 GlobalMemoryStatusEx(&ms); 3166 3247 _physical_memory = ms.ullTotalPhys; 3248 #endif 3167 3249 3168 3250 OSVERSIONINFO oi; … … 3253 3335 void *code_ptr = (void *)code; 3254 3336 __try { 3337 #ifdef __EMX__ 3338 __asm__("call *%0" : : "m"(code_ptr)); 3339 #else 3255 3340 __asm call code_ptr 3341 #endif 3256 3342 } __except(nx_exception_filter((_EXCEPTION_POINTERS*)_exception_info())) { 3257 3343 tty->print_raw_cr("NX protection detected."); … … 3283 3369 // Initialize main_process and main_thread 3284 3370 main_process = GetCurrentProcess(); // Remember main_process is a pseudo handle 3285 if (!DuplicateHandle(main_process, GetCurrentThread(), main_process,3371 if (!DuplicateHandle(main_process, GetCurrentThread(), main_process, 3286 3372 &main_thread, THREAD_ALL_ACCESS, false, 0)) { 3287 3373 fatal("DuplicateHandle failed\n"); … … 3349 3435 #ifndef _WIN64 3350 3436 static long fp_control_word = 0; 3437 #ifdef __EMX__ 3438 __asm__("fstcw %0" : "=m"(fp_control_word)); 3439 #else 3351 3440 __asm { fstcw fp_control_word } 3441 #endif 3352 3442 // see Intel PPro Manual, Vol. 2, p 7-16 3353 3443 const long precision = 0x20; … … 3358 3448 const long invalid = 0x01; 3359 3449 fp_control_word |= invalid; 3450 #ifdef __EMX__ 3451 __asm__("fldcw %0" : : "m"(fp_control_word)); 3452 #else 3360 3453 __asm { fldcw fp_control_word } 3454 #endif 3361 3455 #endif 3362 3456 } -
trunk/openjdk/hotspot/src/os/windows/vm/perfMemory_windows.cpp
r2 r58 218 218 } 219 219 220 #ifndef __WIN32OS2__ 220 221 if (fa & FILE_ATTRIBUTE_REPARSE_POINT) { 221 222 // we don't accept any redirection for the user specific directory … … 229 230 return false; 230 231 } 232 #endif 231 233 232 234 if (fa & FILE_ATTRIBUTE_DIRECTORY) { … … 566 568 } 567 569 570 #ifndef __WIN32OS2__ 568 571 if ((flags & FS_PERSISTENT_ACLS) == 0) { 569 572 // file system doesn't support ACLs, declare file system unsafe … … 583 586 return false; 584 587 } 588 #endif 585 589 586 590 return true; … … 744 748 if (lpSA != NULL) { 745 749 // free the contained security descriptor and the ACL 746 free_security_desc( lpSA->lpSecurityDescriptor);750 free_security_desc((PSECURITY_DESCRIPTOR)lpSA->lpSecurityDescriptor); 747 751 lpSA->lpSecurityDescriptor = NULL; 748 752 … … 801 805 802 806 DWORD nbytes = GetLengthSid(token_buf->User.Sid); 803 PSID pSID = NEW_C_HEAP_ARRAY(char, nbytes);807 PSID pSID = (PSID)NEW_C_HEAP_ARRAY(char, nbytes); 804 808 805 809 if (!CopySid(nbytes, pSID, token_buf->User.Sid)) { … … 926 930 int matches = 0; 927 931 for (int i = 0; i < ace_count; i++) { 928 if (EqualSid(aces[i].pSid, &(((ACCESS_ALLOWED_ACE *)ace)->SidStart))) {932 if (EqualSid(aces[i].pSid, (PSID)&(((ACCESS_ALLOWED_ACE *)ace)->SidStart))) { 929 933 matches++; 930 934 break; … … 995 999 } 996 1000 1001 #ifndef __WIN32OS2__ 997 1002 // if running on windows 2000 or later, set the automatic inheritance 998 1003 // control flags. … … 1015 1020 } 1016 1021 } 1022 #endif 1017 1023 // Note, the security descriptor maintains a reference to the newACL, not 1018 1024 // a copy of it. Therefore, the newACL is not freed here. It is freed when … … 1226 1232 // DACLs might fix the corrupted the DACLs. 1227 1233 SECURITY_INFORMATION secInfo = DACL_SECURITY_INFORMATION; 1228 if (!SetFileSecurity(dirname, secInfo, pDirSA->lpSecurityDescriptor)) { 1234 if (!SetFileSecurity(dirname, secInfo, 1235 (PSECURITY_DESCRIPTOR)pDirSA->lpSecurityDescriptor)) { 1229 1236 if (PrintMiscellaneous && Verbose) { 1230 1237 lasterror = GetLastError(); -
trunk/openjdk/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp
r2 r58 58 58 if ( ThreadLocalStorage::get_thread_ptr_offset() == 0 ) { 59 59 int thread_ptr_offset; 60 #ifdef __EMX__ 61 __asm__("leal %1, %%eax; " 62 "subl %%fs:0, %%eax; " 63 "movl %%eax, %0; " 64 : "=m"(thread_ptr_offset) : "m"(wrapperthread) : "%eax"); 65 #else 60 66 __asm { 61 67 lea eax, dword ptr wrapperthread; … … 63 69 mov thread_ptr_offset, eax 64 70 }; 71 #endif 65 72 ThreadLocalStorage::set_thread_ptr_offset(thread_ptr_offset); 66 73 } … … 71 78 else { 72 79 int test_thread_ptr_offset; 80 #ifdef __EMX__ 81 __asm__("leal %1, %%eax; " 82 "subl %%fs:0, %%eax; " 83 "movl %%eax, %0; " 84 : "=m"(test_thread_ptr_offset) : "m"(wrapperthread) : "%eax"); 85 #else 73 86 __asm { 74 87 lea eax, dword ptr wrapperthread; … … 76 89 mov test_thread_ptr_offset, eax 77 90 }; 91 #endif 78 92 assert(test_thread_ptr_offset == ThreadLocalStorage::get_thread_ptr_offset(), 79 93 "thread pointer offset from SEH changed"); … … 340 354 intptr_t* _get_previous_fp() { 341 355 intptr_t **frameptr; 356 #ifdef __EMX__ 357 __asm("movl %%ebp, %0" : "=m"(frameptr)); 358 #else 342 359 __asm { 343 360 mov frameptr, ebp 344 361 }; 362 #endif 345 363 return *frameptr; 346 364 } … … 423 441 extern "C" int SafeFetch32 (int * adr, int Err) { 424 442 int rv = Err ; 425 _ try {443 __try { 426 444 rv = *((volatile int *) adr) ; 427 445 } __except(EXCEPTION_EXECUTE_HANDLER) { … … 432 450 extern "C" intptr_t SafeFetchN (intptr_t * adr, intptr_t Err) { 433 451 intptr_t rv = Err ; 434 _ try {452 __try { 435 453 rv = *((volatile intptr_t *) adr) ; 436 454 } __except(EXCEPTION_EXECUTE_HANDLER) { … … 446 464 // On systems that don't support pause a rep:nop 447 465 // is executed as a nop. The rep: prefix is ignored. 466 #ifdef __EMX__ 467 __asm__("pause; "); 468 #else 448 469 _asm { 449 470 pause ; 450 471 }; 472 #endif 451 473 return 1 ; 452 474 #endif // AMD64 … … 457 479 #ifndef AMD64 458 480 int fpu_cntrl_word = StubRoutines::fpu_cntrl_wrd_std(); 481 #ifdef __EMX__ 482 __asm__("fldcw %0; " : : "m"(fpu_cntrl_word)); 483 #else 459 484 __asm fldcw fpu_cntrl_word; 485 #endif 460 486 #endif // !AMD64 461 487 } -
trunk/openjdk/hotspot/src/share/vm/prims/forte.cpp
r2 r58 618 618 619 619 620 #if ndef _WINDOWS620 #if !defined(_WINDOWS) && !defined(OS2) 621 621 // Support for the Forte(TM) Peformance Tools collector. 622 622 // … … 637 637 #define collector_func_load(x0,x1,x2,x3,x4,x5,x6) \ 638 638 ( collector_func_load ? collector_func_load(x0,x1,x2,x3,x4,x5,x6),0 : 0 ) 639 #endif // !_WINDOWS 639 #endif // !_WINDOWS && !OS2 640 640 641 641 } // end extern "C" … … 643 643 644 644 void Forte::register_stub(const char* name, address start, address end) { 645 #if !defined(_WINDOWS) && !defined( IA64)645 #if !defined(_WINDOWS) && !defined(OS2) && !defined(IA64) 646 646 assert(pointer_delta(end, start, sizeof(jbyte)) < INT_MAX, 647 647 "Code size exceeds maximum range") … … 649 649 collector_func_load((char*)name, NULL, NULL, start, 650 650 pointer_delta(end, start, sizeof(jbyte)), 0, NULL); 651 #endif // !_WINDOWS && ! IA64652 } 651 #endif // !_WINDOWS && !OS2 && !IA64 652 } -
trunk/openjdk/hotspot/src/share/vm/prims/jniFastGetField.hpp
r2 r58 61 61 62 62 public: 63 #if defined(_WINDOWS) && !defined(_WIN64)63 #if (defined(_WINDOWS) && !defined(_WIN64)) || defined(OS2) 64 64 static GetBooleanField_t jni_fast_GetBooleanField_fp; 65 65 static GetByteField_t jni_fast_GetByteField_fp; -
trunk/openjdk/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
r51 r58 82 82 83 83 #ifdef OS2 84 #include <sys/types.h> 84 85 #ifdef __WIN32OS2__ 85 86 #include <excpt.h> 87 // compiler's select() would conflict with Winsock 88 #define select __io_select 86 89 #include <io.h> 90 #undef select 91 #ifdef __EMX__ 92 // we disable BSD visibility for the compiler so define these manually 93 int finite(double) __pure2; 94 int isnanf(float) __pure2; 95 #define S_IREAD S_IRUSR 96 #define S_IWRITE S_IWUSR 97 #define S_IEXEC S_IXUSR 98 #include <alloca.h> // <stdlib.h> defines alloca only in BSD mode 99 #endif 100 #else // __WIN32OS2__ 101 #include <io.h> 102 #endif // __WIN32OS2__ 103 #ifdef __EMX__ 104 #include <strings.h> // strcasecmp() 105 // EMX doesn't provide some ANSI declarations 106 #define _alloca alloca 107 #define _fileno fileno 108 #define _O_BINARY O_BINARY 109 #define _O_TEXT O_TEXT 110 #define _O_CREAT O_CREAT 111 #define _O_TRUNC O_TRUNC 112 #define _O_EXCL O_TRUNC 113 #define _O_WRONLY O_WRONLY 114 #define _O_RDONLY O_RDONLY 115 #define _O_RDWR O_RDWR 116 #define _S_IREAD S_IREAD 117 #define _S_IWRITE S_IWRITE 118 #define _S_IEXEC S_IEXEC 87 119 #endif 88 120 #endif // OS2 -
trunk/openjdk/hotspot/src/share/vm/utilities/ostream.cpp
r2 r58 835 835 #endif 836 836 837 #ifdef __WIN32OS2__ 838 #include <winsock.h> 839 #endif 840 837 841 // Network access 838 842 networkStream::networkStream() : bufferedStream(1024*10, 1024*10) {
Note:
See TracChangeset
for help on using the changeset viewer.