1 /* |
1 /* |
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
2965 // Scan the pages from start to end until a page different than |
2965 // Scan the pages from start to end until a page different than |
2966 // the one described in the info parameter is encountered. |
2966 // the one described in the info parameter is encountered. |
2967 char *os::scan_pages(char *start, char* end, page_info* page_expected, page_info* page_found) { |
2967 char *os::scan_pages(char *start, char* end, page_info* page_expected, page_info* page_found) { |
2968 const uint_t info_types[] = { MEMINFO_VLGRP, MEMINFO_VPAGESIZE }; |
2968 const uint_t info_types[] = { MEMINFO_VLGRP, MEMINFO_VPAGESIZE }; |
2969 const size_t types = sizeof(info_types) / sizeof(info_types[0]); |
2969 const size_t types = sizeof(info_types) / sizeof(info_types[0]); |
2970 uint64_t addrs[MAX_MEMINFO_CNT], outdata[types * MAX_MEMINFO_CNT]; |
2970 uint64_t addrs[MAX_MEMINFO_CNT], outdata[types * MAX_MEMINFO_CNT + 1]; |
2971 uint_t validity[MAX_MEMINFO_CNT]; |
2971 uint_t validity[MAX_MEMINFO_CNT]; |
2972 |
2972 |
2973 size_t page_size = MAX2((size_t)os::vm_page_size(), page_expected->size); |
2973 size_t page_size = MAX2((size_t)os::vm_page_size(), page_expected->size); |
2974 uint64_t p = (uint64_t)start; |
2974 uint64_t p = (uint64_t)start; |
2975 while (p < (uint64_t)end) { |
2975 while (p < (uint64_t)end) { |
3494 OSThreadWaitState osts(thread->osthread(), false /* not Object.wait() */); |
3494 OSThreadWaitState osts(thread->osthread(), false /* not Object.wait() */); |
3495 |
3495 |
3496 return os_sleep(millis, interruptible); |
3496 return os_sleep(millis, interruptible); |
3497 } |
3497 } |
3498 |
3498 |
3499 int os::naked_sleep() { |
3499 void os::naked_short_sleep(jlong ms) { |
3500 // %% make the sleep time an integer flag. for now use 1 millisec. |
3500 assert(ms < 1000, "Un-interruptable sleep, short time use only"); |
3501 return os_sleep(1, false); |
3501 |
|
3502 // usleep is deprecated and removed from POSIX, in favour of nanosleep, but |
|
3503 // Solaris requires -lrt for this. |
|
3504 usleep((ms * 1000)); |
|
3505 |
|
3506 return; |
3502 } |
3507 } |
3503 |
3508 |
3504 // Sleep forever; naked call to OS-specific sleep; use with CAUTION |
3509 // Sleep forever; naked call to OS-specific sleep; use with CAUTION |
3505 void os::infinite_sleep() { |
3510 void os::infinite_sleep() { |
3506 while (true) { // sleep forever ... |
3511 while (true) { // sleep forever ... |