comparison src/os/linux/vm/os_linux.cpp @ 9060:cc32ccaaf47f

8003310: Enable -Wunused-function when compiling with gcc Summary: Add the -Wunused-function flag and remove a number of unused functions. Reviewed-by: dholmes, coleenp, kvn
author mikael
date Thu, 04 Apr 2013 10:01:26 -0700
parents 17bf4d428955
children 8be1318fbe77
comparison
equal deleted inserted replaced
9059:17bf4d428955 9060:cc32ccaaf47f
174 #endif // JAVASE_EMBEDDED 174 #endif // JAVASE_EMBEDDED
175 175
176 // utility functions 176 // utility functions
177 177
178 static int SR_initialize(); 178 static int SR_initialize();
179 static int SR_finalize();
180 179
181 julong os::available_memory() { 180 julong os::available_memory() {
182 return Linux::available_memory(); 181 return Linux::available_memory();
183 } 182 }
184 183
3670 // Save signal flag 3669 // Save signal flag
3671 os::Linux::set_our_sigflags(SR_signum, act.sa_flags); 3670 os::Linux::set_our_sigflags(SR_signum, act.sa_flags);
3672 return 0; 3671 return 0;
3673 } 3672 }
3674 3673
3675 static int SR_finalize() {
3676 return 0;
3677 }
3678
3679 3674
3680 // returns true on success and false on error - really an error is fatal 3675 // returns true on success and false on error - really an error is fatal
3681 // but this seems the normal response to library errors 3676 // but this seems the normal response to library errors
3682 static bool do_suspend(OSThread* osthread) { 3677 static bool do_suspend(OSThread* osthread) {
3683 // mark as suspended and send signal 3678 // mark as suspended and send signal
4515 } 4510 }
4516 4511
4517 //////////////////////////////////////////////////////////////////////////////// 4512 ////////////////////////////////////////////////////////////////////////////////
4518 // debug support 4513 // debug support
4519 4514
4520 static address same_page(address x, address y) {
4521 int page_bits = -os::vm_page_size();
4522 if ((intptr_t(x) & page_bits) == (intptr_t(y) & page_bits))
4523 return x;
4524 else if (x > y)
4525 return (address)(intptr_t(y) | ~page_bits) + 1;
4526 else
4527 return (address)(intptr_t(y) & page_bits);
4528 }
4529
4530 bool os::find(address addr, outputStream* st) { 4515 bool os::find(address addr, outputStream* st) {
4531 Dl_info dlinfo; 4516 Dl_info dlinfo;
4532 memset(&dlinfo, 0, sizeof(dlinfo)); 4517 memset(&dlinfo, 0, sizeof(dlinfo));
4533 if (dladdr(addr, &dlinfo)) { 4518 if (dladdr(addr, &dlinfo)) {
4534 st->print(PTR_FORMAT ": ", addr); 4519 st->print(PTR_FORMAT ": ", addr);
4548 } 4533 }
4549 st->cr(); 4534 st->cr();
4550 4535
4551 if (Verbose) { 4536 if (Verbose) {
4552 // decode some bytes around the PC 4537 // decode some bytes around the PC
4553 address begin = same_page(addr-40, addr); 4538 address begin = clamp_address_in_page(addr-40, addr, os::vm_page_size());
4554 address end = same_page(addr+40, addr); 4539 address end = clamp_address_in_page(addr+40, addr, os::vm_page_size());
4555 address lowest = (address) dlinfo.dli_sname; 4540 address lowest = (address) dlinfo.dli_sname;
4556 if (!lowest) lowest = (address) dlinfo.dli_fbase; 4541 if (!lowest) lowest = (address) dlinfo.dli_fbase;
4557 if (begin < lowest) begin = lowest; 4542 if (begin < lowest) begin = lowest;
4558 Dl_info dlinfo2; 4543 Dl_info dlinfo2;
4559 if (dladdr(end, &dlinfo2) && dlinfo2.dli_saddr != dlinfo.dli_saddr 4544 if (dladdr(end, &dlinfo2) && dlinfo2.dli_saddr != dlinfo.dli_saddr