Mercurial > hg > graal-jvmci-8
comparison src/os/solaris/vm/os_solaris.cpp @ 17810:62c54fcc0a35
Merge
author | kvn |
---|---|
date | Tue, 25 Mar 2014 17:07:36 -0700 |
parents | bbfbe9b06038 7d28f4e15b61 |
children | 6048424d3865 |
comparison
equal
deleted
inserted
replaced
17809:a433eb716ce1 | 17810:62c54fcc0a35 |
---|---|
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. |
2230 st->print("%s",(p.pr_mflags & MA_WRITE) ? "w" : "-"); | 2230 st->print("%s",(p.pr_mflags & MA_WRITE) ? "w" : "-"); |
2231 st->print("%s",(p.pr_mflags & MA_EXEC) ? "x" : "-"); | 2231 st->print("%s",(p.pr_mflags & MA_EXEC) ? "x" : "-"); |
2232 st->cr(); | 2232 st->cr(); |
2233 status = true; | 2233 status = true; |
2234 } | 2234 } |
2235 ::close(fd); | 2235 } |
2236 } | 2236 ::close(fd); |
2237 } | 2237 } |
2238 return status; | 2238 return status; |
2239 } | 2239 } |
2240 | 2240 |
2241 void os::pd_print_cpu_info(outputStream* st) { | 2241 void os::pd_print_cpu_info(outputStream* st) { |
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) { |
3004 } else { | 3004 } else { |
3005 return NULL; | 3005 return NULL; |
3006 } | 3006 } |
3007 } | 3007 } |
3008 | 3008 |
3009 if (i != addrs_count) { | 3009 if (i < addrs_count) { |
3010 if ((validity[i] & 2) != 0) { | 3010 if ((validity[i] & 2) != 0) { |
3011 page_found->lgrp_id = outdata[types * i]; | 3011 page_found->lgrp_id = outdata[types * i]; |
3012 } else { | 3012 } else { |
3013 page_found->lgrp_id = -1; | 3013 page_found->lgrp_id = -1; |
3014 } | 3014 } |
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 ... |