1 $NetBSD: patch-hotspot_src_os_solaris_vm_os__solaris.cpp,v 1.1 2015/07/03 20:40:59 fhajny Exp $
5 --- hotspot/src/os/solaris/vm/os_solaris.cpp.orig 2015-06-10 10:31:52.000000000 +0000
6 +++ hotspot/src/os/solaris/vm/os_solaris.cpp
7 @@ -534,7 +540,7 @@ static bool assign_distribution(processo
8 const processorid_t limit_id = max_id + 1;
9 // Make up markers for available processors.
10 bool* available_id = NEW_C_HEAP_ARRAY(bool, limit_id, mtInternal);
11 - for (uint c = 0; c < limit_id; c += 1) {
12 + for (processorid_t c = 0; c < limit_id; c += 1) {
13 available_id[c] = false;
15 for (uint a = 0; a < id_length; a += 1) {
16 @@ -557,7 +563,7 @@ static bool assign_distribution(processo
17 // ... find the next available processor in the board.
18 for (uint slot = 0; slot < processors_per_board; slot += 1) {
19 uint try_id = board * processors_per_board + slot;
20 - if ((try_id < limit_id) && (available_id[try_id] == true)) {
21 + if ((try_id < (uint)limit_id) && (available_id[try_id] == true)) {
22 distribution[assigned] = try_id;
23 available_id[try_id] = false;
25 @@ -565,7 +571,7 @@ static bool assign_distribution(processo
29 - if (board * processors_per_board + 0 >= limit_id) {
30 + if (board * processors_per_board + 0 >= (uint)limit_id) {
34 @@ -622,7 +628,7 @@ bool os::bind_to_processor(uint processo
35 bool os::getenv(const char* name, char* buffer, int len) {
36 char* val = ::getenv( name );
38 - || strlen(val) + 1 > len ) {
39 + || strlen(val) + 1 > (size_t)len ) {
40 if (len > 0) buffer[0] = 0; // return a null string
43 @@ -801,7 +807,7 @@ void os::init_system_properties_values()
47 - for (i = 0; i < info->dls_cnt; i++, path++) {
48 + for (i = 0; (uint_t)i < info->dls_cnt; i++, path++) {
49 uint_t flags = path->dls_flags & LA_SER_MASK;
50 if (((flags & LA_SER_LIBPATH) == 0) && !inserted) {
51 strcat(library_path, common_path);
52 @@ -907,7 +913,8 @@ extern "C" void* java_start(void* thread
53 // in java_to_os_priority. So we save the native priority
54 // in the osThread and recall it here.
56 - if ( osthr->thread_id() != -1 ) {
57 + // thread_id_t ("osThread_solaris.hpp") == thread_t (<thread.h>) == unsigned int
58 + if ( osthr->thread_id() != (unsigned int)-1 ) {
59 if ( UseThreadPriorities ) {
60 int prio = osthr->native_priority();
61 if (ThreadPriorityVerbose) {
62 @@ -2786,7 +2793,7 @@ void os::numa_make_global(char *addr, si
63 // Get the number of the locality groups.
64 size_t os::numa_get_groups_num() {
65 size_t n = Solaris::lgrp_nlgrps(Solaris::lgrp_cookie());
66 - return n != -1 ? n : 1;
67 + return n != (size_t) -1 ? n : 1;
70 // Get a list of leaf locality groups. A leaf lgroup is group that
71 @@ -2798,7 +2805,7 @@ size_t os::numa_get_leaf_groups(int *ids
74 int result_size = 0, top = 1, bottom = 0, cur = 0;
75 - for (int k = 0; k < size; k++) {
76 + for (size_t k = 0; k < size; k++) {
77 int r = Solaris::lgrp_children(Solaris::lgrp_cookie(), ids[cur],
78 (Solaris::lgrp_id_t*)&ids[top], size - top);
80 @@ -2918,7 +2925,7 @@ char *os::scan_pages(char *start, char*
83 if ((validity[i] & 2) != 0 && page_expected->lgrp_id > 0) {
84 - if (outdata[types * i] != page_expected->lgrp_id) {
85 + if (outdata[types * i] != (uint64_t)page_expected->lgrp_id) {
89 @@ -4685,7 +4692,7 @@ const char * signames[] = {
90 const char* os::exception_name(int exception_code, char* buf, size_t size) {
91 if (0 < exception_code && exception_code <= SIGRTMAX) {
93 - if (exception_code < sizeof(signames)/sizeof(const char*)) {
94 + if ((size_t)exception_code < sizeof(signames)/sizeof(const char*)) {
95 jio_snprintf(buf, size, "%s", signames[exception_code]);
97 jio_snprintf(buf, size, "SIG%d", exception_code);
98 @@ -5017,7 +5024,7 @@ void os::init(void) {
99 // If the pagesize of the VM is greater than 8K determine the appropriate
100 // number of initial guard pages. The user can change this with the
101 // command line arguments, if needed.
102 - if (vm_page_size() > 8*K) {
103 + if ((size_t)vm_page_size() > 8*K) {
104 StackYellowPages = 1;
106 StackShadowPages = round_to((StackShadowPages*8*K), vm_page_size()) / vm_page_size();
107 @@ -5038,7 +5045,7 @@ jint os::init_2(void) {
109 // Allocate a single page and mark it as readable for safepoint polling. Also
110 // use this first mmap call to check support for MAP_ALIGN.
111 - address polling_page = (address)Solaris::mmap_chunk((char*)page_size,
112 + address polling_page = (address)Solaris::mmap_chunk((char*)(uintptr_t)page_size,
114 MAP_PRIVATE | MAP_ALIGN,
116 @@ -5090,7 +5097,7 @@ jint os::init_2(void) {
117 // stack on a power of 2 boundary. The real fix for this
118 // should be to fix the guard page mechanism.
120 - if (vm_page_size() > 8*K) {
121 + if ((size_t)vm_page_size() > 8*K) {
122 threadStackSizeInBytes = (threadStackSizeInBytes != 0)
123 ? threadStackSizeInBytes +
124 ((StackYellowPages + StackRedPages) * vm_page_size())