hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp
changeset 36181 3a16e8ce0abf
parent 35201 996db89f378e
child 37430 fd743dadef12
equal deleted inserted replaced
36177:b2b76aba8e42 36181:3a16e8ce0abf
     1 /*
     1 /*
     2  * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
     3  * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
     3  * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
     4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     5  *
     5  *
     6  * This code is free software; you can redistribute it and/or modify it
     6  * This code is free software; you can redistribute it and/or modify it
     7  * under the terms of the GNU General Public License version 2 only, as
     7  * under the terms of the GNU General Public License version 2 only, as
    63   return (address)__builtin_frame_address(0);
    63   return (address)__builtin_frame_address(0);
    64 }
    64 }
    65 
    65 
    66 frame os::get_sender_for_C_frame(frame* fr) {
    66 frame os::get_sender_for_C_frame(frame* fr) {
    67   ShouldNotCallThis();
    67   ShouldNotCallThis();
       
    68   return frame(NULL, NULL); // silence compile warning.
    68 }
    69 }
    69 
    70 
    70 frame os::current_frame() {
    71 frame os::current_frame() {
    71   // The only thing that calls this is the stack printing code in
    72   // The only thing that calls this is the stack printing code in
    72   // VMError::report:
    73   // VMError::report:
   100   // Nothing to do.
   101   // Nothing to do.
   101 }
   102 }
   102 
   103 
   103 address os::Linux::ucontext_get_pc(const ucontext_t* uc) {
   104 address os::Linux::ucontext_get_pc(const ucontext_t* uc) {
   104   ShouldNotCallThis();
   105   ShouldNotCallThis();
       
   106   return NULL; // silence compile warnings
   105 }
   107 }
   106 
   108 
   107 void os::Linux::ucontext_set_pc(ucontext_t * uc, address pc) {
   109 void os::Linux::ucontext_set_pc(ucontext_t * uc, address pc) {
   108   ShouldNotCallThis();
   110   ShouldNotCallThis();
   109 }
   111 }
   110 
   112 
   111 ExtendedPC os::fetch_frame_from_context(const void* ucVoid,
   113 ExtendedPC os::fetch_frame_from_context(const void* ucVoid,
   112                                         intptr_t** ret_sp,
   114                                         intptr_t** ret_sp,
   113                                         intptr_t** ret_fp) {
   115                                         intptr_t** ret_fp) {
   114   ShouldNotCallThis();
   116   ShouldNotCallThis();
       
   117   return NULL; // silence compile warnings
   115 }
   118 }
   116 
   119 
   117 frame os::fetch_frame_from_context(const void* ucVoid) {
   120 frame os::fetch_frame_from_context(const void* ucVoid) {
   118   ShouldNotCallThis();
   121   ShouldNotCallThis();
       
   122   return frame(NULL, NULL); // silence compile warnings
   119 }
   123 }
   120 
   124 
   121 extern "C" JNIEXPORT int
   125 extern "C" JNIEXPORT int
   122 JVM_handle_linux_signal(int sig,
   126 JVM_handle_linux_signal(int sig,
   123                         siginfo_t* info,
   127                         siginfo_t* info,
   260           "\n#    | |        =-*-=__\\ "
   264           "\n#    | |        =-*-=__\\ "
   261           "\n#    OOO        c_c_(___)");
   265           "\n#    OOO        c_c_(___)");
   262   }
   266   }
   263 #endif // !PRODUCT
   267 #endif // !PRODUCT
   264 
   268 
   265   const char *fmt = "caught unhandled signal %d";
       
   266   char buf[64];
   269   char buf[64];
   267 
   270 
   268   sprintf(buf, fmt, sig);
   271   sprintf(buf, "caught unhandled signal %d", sig);
       
   272 
       
   273 // Silence -Wformat-security warning for fatal()
       
   274 PRAGMA_DIAG_PUSH
       
   275 PRAGMA_FORMAT_NONLITERAL_IGNORED
   269   fatal(buf);
   276   fatal(buf);
       
   277 PRAGMA_DIAG_POP
       
   278   return true; // silence compiler warnings
   270 }
   279 }
   271 
   280 
   272 void os::Linux::init_thread_fpu_state(void) {
   281 void os::Linux::init_thread_fpu_state(void) {
   273   // Nothing to do
   282   // Nothing to do
   274 }
   283 }
   275 
   284 
   276 int os::Linux::get_fpu_control_word() {
   285 int os::Linux::get_fpu_control_word() {
   277   ShouldNotCallThis();
   286   ShouldNotCallThis();
       
   287   return -1; // silence compile warnings
   278 }
   288 }
   279 
   289 
   280 void os::Linux::set_fpu_control_word(int fpu) {
   290 void os::Linux::set_fpu_control_word(int fpu) {
   281   ShouldNotCallThis();
   291   ShouldNotCallThis();
   282 }
   292 }
   417 // Stubs for things that would be in linux_zero.s if it existed.
   427 // Stubs for things that would be in linux_zero.s if it existed.
   418 // You probably want to disassemble these monkeys to check they're ok.
   428 // You probably want to disassemble these monkeys to check they're ok.
   419 
   429 
   420 extern "C" {
   430 extern "C" {
   421   int SpinPause() {
   431   int SpinPause() {
       
   432       return -1; // silence compile warnings
   422   }
   433   }
   423 
   434 
   424 
   435 
   425   void _Copy_conjoint_jshorts_atomic(jshort* from, jshort* to, size_t count) {
   436   void _Copy_conjoint_jshorts_atomic(jshort* from, jshort* to, size_t count) {
   426     if (from > to) {
   437     if (from > to) {