src/os/linux/vm/os_linux.inline.hpp

Print this page


   1 /*
   2  * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 


















  25 inline void* os::thread_local_storage_at(int index) {
  26   return pthread_getspecific((pthread_key_t)index);
  27 }
  28 
  29 inline const char* os::file_separator() {
  30   return "/";
  31 }
  32 
  33 inline const char* os::line_separator() {
  34   return "\n";
  35 }
  36 
  37 inline const char* os::path_separator() {
  38   return ":";
  39 }
  40 
  41 inline const char* os::jlong_format_specifier() {
  42   return "%lld";
  43 }
  44 


 106 inline int os::closedir(DIR *dirp)
 107 {
 108   assert(dirp != NULL, "just checking");
 109   return ::closedir(dirp);
 110 }
 111 
 112 // macros for restartable system calls
 113 
 114 #define RESTARTABLE(_cmd, _result) do { \
 115     _result = _cmd; \
 116   } while(((int)_result == OS_ERR) && (errno == EINTR))
 117 
 118 #define RESTARTABLE_RETURN_INT(_cmd) do { \
 119   int _result; \
 120   RESTARTABLE(_cmd, _result); \
 121   return _result; \
 122 } while(false)
 123 
 124 inline bool os::numa_has_static_binding()   { return true; }
 125 inline bool os::numa_has_group_homing()     { return false;  }


   1 /*
   2  * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef OS_LINUX_VM_OS_LINUX_INLINE_HPP
  26 #define OS_LINUX_VM_OS_LINUX_INLINE_HPP
  27 
  28 #include "runtime/atomic.hpp"
  29 #include "runtime/os.hpp"
  30 #ifdef TARGET_OS_ARCH_linux_x86
  31 # include "atomic_linux_x86.inline.hpp"
  32 # include "orderAccess_linux_x86.inline.hpp"
  33 #endif
  34 #ifdef TARGET_OS_ARCH_linux_sparc
  35 # include "atomic_linux_sparc.inline.hpp"
  36 # include "orderAccess_linux_sparc.inline.hpp"
  37 #endif
  38 #ifdef TARGET_OS_ARCH_linux_zero
  39 # include "atomic_linux_zero.inline.hpp"
  40 # include "orderAccess_linux_zero.inline.hpp"
  41 #endif
  42 
  43 inline void* os::thread_local_storage_at(int index) {
  44   return pthread_getspecific((pthread_key_t)index);
  45 }
  46 
  47 inline const char* os::file_separator() {
  48   return "/";
  49 }
  50 
  51 inline const char* os::line_separator() {
  52   return "\n";
  53 }
  54 
  55 inline const char* os::path_separator() {
  56   return ":";
  57 }
  58 
  59 inline const char* os::jlong_format_specifier() {
  60   return "%lld";
  61 }
  62 


 124 inline int os::closedir(DIR *dirp)
 125 {
 126   assert(dirp != NULL, "just checking");
 127   return ::closedir(dirp);
 128 }
 129 
 130 // macros for restartable system calls
 131 
 132 #define RESTARTABLE(_cmd, _result) do { \
 133     _result = _cmd; \
 134   } while(((int)_result == OS_ERR) && (errno == EINTR))
 135 
 136 #define RESTARTABLE_RETURN_INT(_cmd) do { \
 137   int _result; \
 138   RESTARTABLE(_cmd, _result); \
 139   return _result; \
 140 } while(false)
 141 
 142 inline bool os::numa_has_static_binding()   { return true; }
 143 inline bool os::numa_has_group_homing()     { return false;  }
 144 
 145 #endif // OS_LINUX_VM_OS_LINUX_INLINE_HPP