Changeset 58 for trunk/openjdk/hotspot/src/os
- Timestamp:
- Jul 15, 2010, 2:46:42 PM (15 years ago)
- Location:
- trunk/openjdk/hotspot/src/os/windows/vm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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();
Note:
See TracChangeset
for help on using the changeset viewer.