hotspot/src/os/bsd/vm/os_bsd.hpp
author zgu
Thu, 28 Jun 2012 17:03:16 -0400
changeset 13195 be27e1b6a4b9
parent 10565 dc90c239f4ec
child 13518 86a9027340fb
permissions -rw-r--r--
6995781: Native Memory Tracking (Phase 1) 7151532: DCmd for hotspot native memory tracking Summary: Implementation of native memory tracking phase 1, which tracks VM native memory usage, and related DCmd Reviewed-by: acorn, coleenp, fparain
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10565
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     1
/*
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     2
 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     4
 *
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     7
 * published by the Free Software Foundation.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     8
 *
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    13
 * accompanied this code).
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    14
 *
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    18
 *
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    21
 * questions.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    22
 *
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    23
 */
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    24
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    25
#ifndef OS_BSD_VM_OS_BSD_HPP
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    26
#define OS_BSD_VM_OS_BSD_HPP
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    27
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    28
// Bsd_OS defines the interface to Bsd operating systems
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    29
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    30
/* pthread_getattr_np comes with BsdThreads-0.9-7 on RedHat 7.1 */
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    31
typedef int (*pthread_getattr_func_type) (pthread_t, pthread_attr_t *);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    32
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    33
#ifdef __APPLE__
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    34
// Mac OS X doesn't support clock_gettime. Stub out the type, it is
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    35
// unused
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    36
typedef int clockid_t;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    37
#endif
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    38
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    39
class Bsd {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    40
  friend class os;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    41
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    42
  // For signal-chaining
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    43
#define MAXSIGNUM 32
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    44
  static struct sigaction sigact[MAXSIGNUM]; // saved preinstalled sigactions
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    45
  static unsigned int sigs;             // mask of signals that have
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    46
                                        // preinstalled signal handlers
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    47
  static bool libjsig_is_loaded;        // libjsig that interposes sigaction(),
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    48
                                        // __sigaction(), signal() is loaded
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    49
  static struct sigaction *(*get_signal_action)(int);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    50
  static struct sigaction *get_preinstalled_handler(int);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    51
  static void save_preinstalled_handler(int, struct sigaction&);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    52
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    53
  static void check_signal_handler(int sig);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    54
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    55
  // For signal flags diagnostics
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    56
  static int sigflags[MAXSIGNUM];
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    57
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    58
  static int (*_clock_gettime)(clockid_t, struct timespec *);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    59
#ifndef _ALLBSD_SOURCE
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    60
  static int (*_pthread_getcpuclockid)(pthread_t, clockid_t *);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    61
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    62
  static address   _initial_thread_stack_bottom;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    63
  static uintptr_t _initial_thread_stack_size;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    64
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    65
  static const char *_glibc_version;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    66
  static const char *_libpthread_version;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    67
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    68
  static bool _is_floating_stack;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    69
  static bool _is_NPTL;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    70
  static bool _supports_fast_thread_cpu_time;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    71
#endif
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    72
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    73
  static GrowableArray<int>* _cpu_to_node;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    74
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    75
 protected:
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    76
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    77
  static julong _physical_memory;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    78
  static pthread_t _main_thread;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    79
#ifndef _ALLBSD_SOURCE
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    80
  static Mutex* _createThread_lock;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    81
#endif
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    82
  static int _page_size;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    83
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    84
  static julong available_memory();
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    85
  static julong physical_memory() { return _physical_memory; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    86
  static void initialize_system_info();
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    87
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    88
#ifndef _ALLBSD_SOURCE
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    89
  static void set_glibc_version(const char *s)      { _glibc_version = s; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    90
  static void set_libpthread_version(const char *s) { _libpthread_version = s; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    91
#endif
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    92
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    93
  static bool supports_variable_stack_size();
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    94
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    95
#ifndef _ALLBSD_SOURCE
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    96
  static void set_is_NPTL()                   { _is_NPTL = true;  }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    97
  static void set_is_BsdThreads()           { _is_NPTL = false; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    98
  static void set_is_floating_stack()         { _is_floating_stack = true; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    99
#endif
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   100
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   101
  static void rebuild_cpu_to_node_map();
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   102
  static GrowableArray<int>* cpu_to_node()    { return _cpu_to_node; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   103
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   104
  static bool hugetlbfs_sanity_check(bool warn, size_t page_size);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   105
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   106
 public:
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   107
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   108
  static void init_thread_fpu_state();
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   109
#ifndef _ALLBSD_SOURCE
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   110
  static int  get_fpu_control_word();
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   111
  static void set_fpu_control_word(int fpu_control);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   112
#endif
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   113
  static pthread_t main_thread(void)                                { return _main_thread; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   114
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   115
#ifndef _ALLBSD_SOURCE
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   116
  // returns kernel thread id (similar to LWP id on Solaris), which can be
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   117
  // used to access /proc
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   118
  static pid_t gettid();
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   119
  static void set_createThread_lock(Mutex* lk)                      { _createThread_lock = lk; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   120
  static Mutex* createThread_lock(void)                             { return _createThread_lock; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   121
#endif
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   122
  static void hotspot_sigmask(Thread* thread);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   123
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   124
#ifndef _ALLBSD_SOURCE
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   125
  static address   initial_thread_stack_bottom(void)                { return _initial_thread_stack_bottom; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   126
  static uintptr_t initial_thread_stack_size(void)                  { return _initial_thread_stack_size; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   127
#endif
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   128
  static bool is_initial_thread(void);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   129
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   130
  static int page_size(void)                                        { return _page_size; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   131
  static void set_page_size(int val)                                { _page_size = val; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   132
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   133
  static address   ucontext_get_pc(ucontext_t* uc);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   134
  static intptr_t* ucontext_get_sp(ucontext_t* uc);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   135
  static intptr_t* ucontext_get_fp(ucontext_t* uc);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   136
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   137
  // For Analyzer Forte AsyncGetCallTrace profiling support:
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   138
  //
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   139
  // This interface should be declared in os_bsd_i486.hpp, but
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   140
  // that file provides extensions to the os class and not the
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   141
  // Bsd class.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   142
  static ExtendedPC fetch_frame_from_ucontext(Thread* thread, ucontext_t* uc,
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   143
    intptr_t** ret_sp, intptr_t** ret_fp);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   144
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   145
  // This boolean allows users to forward their own non-matching signals
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   146
  // to JVM_handle_bsd_signal, harmlessly.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   147
  static bool signal_handlers_are_installed;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   148
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   149
  static int get_our_sigflags(int);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   150
  static void set_our_sigflags(int, int);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   151
  static void signal_sets_init();
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   152
  static void install_signal_handlers();
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   153
  static void set_signal_handler(int, bool);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   154
  static bool is_sig_ignored(int sig);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   155
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   156
  static sigset_t* unblocked_signals();
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   157
  static sigset_t* vm_signals();
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   158
  static sigset_t* allowdebug_blocked_signals();
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   159
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   160
  // For signal-chaining
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   161
  static struct sigaction *get_chained_signal_action(int sig);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   162
  static bool chained_handler(int sig, siginfo_t* siginfo, void* context);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   163
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   164
#ifndef _ALLBSD_SOURCE
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   165
  // GNU libc and libpthread version strings
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   166
  static const char *glibc_version()          { return _glibc_version; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   167
  static const char *libpthread_version()     { return _libpthread_version; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   168
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   169
  // NPTL or BsdThreads?
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   170
  static bool is_BsdThreads()               { return !_is_NPTL; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   171
  static bool is_NPTL()                       { return _is_NPTL;  }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   172
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   173
  // NPTL is always floating stack. BsdThreads could be using floating
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   174
  // stack or fixed stack.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   175
  static bool is_floating_stack()             { return _is_floating_stack; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   176
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   177
  static void libpthread_init();
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   178
  static bool libnuma_init();
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   179
  static void* libnuma_dlsym(void* handle, const char* name);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   180
#endif
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   181
  // Minimum stack size a thread can be created with (allowing
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   182
  // the VM to completely create the thread and enter user code)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   183
  static size_t min_stack_allowed;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   184
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   185
  // Return default stack size or guard size for the specified thread type
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   186
  static size_t default_stack_size(os::ThreadType thr_type);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   187
  static size_t default_guard_size(os::ThreadType thr_type);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   188
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   189
#ifndef _ALLBSD_SOURCE
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   190
  static void capture_initial_stack(size_t max_size);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   191
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   192
  // Stack overflow handling
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   193
  static bool manually_expand_stack(JavaThread * t, address addr);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   194
  static int max_register_window_saves_before_flushing();
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   195
#endif
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   196
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   197
  // Real-time clock functions
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   198
  static void clock_init(void);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   199
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   200
#ifndef _ALLBSD_SOURCE
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   201
  // fast POSIX clocks support
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   202
  static void fast_thread_clock_init(void);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   203
#endif
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   204
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   205
  static bool supports_monotonic_clock() {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   206
    return _clock_gettime != NULL;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   207
  }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   208
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   209
  static int clock_gettime(clockid_t clock_id, struct timespec *tp) {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   210
    return _clock_gettime ? _clock_gettime(clock_id, tp) : -1;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   211
  }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   212
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   213
#ifndef _ALLBSD_SOURCE
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   214
  static int pthread_getcpuclockid(pthread_t tid, clockid_t *clock_id) {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   215
    return _pthread_getcpuclockid ? _pthread_getcpuclockid(tid, clock_id) : -1;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   216
  }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   217
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   218
  static bool supports_fast_thread_cpu_time() {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   219
    return _supports_fast_thread_cpu_time;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   220
  }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   221
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   222
  static jlong fast_thread_cpu_time(clockid_t clockid);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   223
#endif
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   224
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   225
  // Stack repair handling
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   226
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   227
  // none present
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   228
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   229
  // BsdThreads work-around for 6292965
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   230
  static int safe_cond_timedwait(pthread_cond_t *_cond, pthread_mutex_t *_mutex, const struct timespec *_abstime);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   231
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   232
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   233
  // Bsd suspend/resume support - this helper is a shadow of its former
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   234
  // self now that low-level suspension is barely used, and old workarounds
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   235
  // for BsdThreads are no longer needed.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   236
  class SuspendResume {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   237
  private:
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   238
    volatile int _suspend_action;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   239
    // values for suspend_action:
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   240
    #define SR_NONE               (0x00)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   241
    #define SR_SUSPEND            (0x01)  // suspend request
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   242
    #define SR_CONTINUE           (0x02)  // resume request
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   243
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   244
    volatile jint _state;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   245
    // values for _state: + SR_NONE
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   246
    #define SR_SUSPENDED          (0x20)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   247
  public:
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   248
    SuspendResume() { _suspend_action = SR_NONE; _state = SR_NONE; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   249
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   250
    int suspend_action() const     { return _suspend_action; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   251
    void set_suspend_action(int x) { _suspend_action = x;    }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   252
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   253
    // atomic updates for _state
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   254
    void set_suspended()           {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   255
      jint temp, temp2;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   256
      do {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   257
        temp = _state;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   258
        temp2 = Atomic::cmpxchg(temp | SR_SUSPENDED, &_state, temp);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   259
      } while (temp2 != temp);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   260
    }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   261
    void clear_suspended()        {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   262
      jint temp, temp2;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   263
      do {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   264
        temp = _state;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   265
        temp2 = Atomic::cmpxchg(temp & ~SR_SUSPENDED, &_state, temp);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   266
      } while (temp2 != temp);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   267
    }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   268
    bool is_suspended()            { return _state & SR_SUSPENDED;       }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   269
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   270
    #undef SR_SUSPENDED
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   271
  };
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   272
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   273
private:
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   274
  typedef int (*sched_getcpu_func_t)(void);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   275
  typedef int (*numa_node_to_cpus_func_t)(int node, unsigned long *buffer, int bufferlen);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   276
  typedef int (*numa_max_node_func_t)(void);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   277
  typedef int (*numa_available_func_t)(void);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   278
  typedef int (*numa_tonode_memory_func_t)(void *start, size_t size, int node);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   279
  typedef void (*numa_interleave_memory_func_t)(void *start, size_t size, unsigned long *nodemask);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   280
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   281
  static sched_getcpu_func_t _sched_getcpu;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   282
  static numa_node_to_cpus_func_t _numa_node_to_cpus;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   283
  static numa_max_node_func_t _numa_max_node;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   284
  static numa_available_func_t _numa_available;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   285
  static numa_tonode_memory_func_t _numa_tonode_memory;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   286
  static numa_interleave_memory_func_t _numa_interleave_memory;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   287
  static unsigned long* _numa_all_nodes;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   288
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   289
  static void set_sched_getcpu(sched_getcpu_func_t func) { _sched_getcpu = func; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   290
  static void set_numa_node_to_cpus(numa_node_to_cpus_func_t func) { _numa_node_to_cpus = func; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   291
  static void set_numa_max_node(numa_max_node_func_t func) { _numa_max_node = func; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   292
  static void set_numa_available(numa_available_func_t func) { _numa_available = func; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   293
  static void set_numa_tonode_memory(numa_tonode_memory_func_t func) { _numa_tonode_memory = func; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   294
  static void set_numa_interleave_memory(numa_interleave_memory_func_t func) { _numa_interleave_memory = func; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   295
  static void set_numa_all_nodes(unsigned long* ptr) { _numa_all_nodes = ptr; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   296
public:
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   297
  static int sched_getcpu()  { return _sched_getcpu != NULL ? _sched_getcpu() : -1; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   298
  static int numa_node_to_cpus(int node, unsigned long *buffer, int bufferlen) {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   299
    return _numa_node_to_cpus != NULL ? _numa_node_to_cpus(node, buffer, bufferlen) : -1;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   300
  }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   301
  static int numa_max_node() { return _numa_max_node != NULL ? _numa_max_node() : -1; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   302
  static int numa_available() { return _numa_available != NULL ? _numa_available() : -1; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   303
  static int numa_tonode_memory(void *start, size_t size, int node) {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   304
    return _numa_tonode_memory != NULL ? _numa_tonode_memory(start, size, node) : -1;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   305
  }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   306
  static void numa_interleave_memory(void *start, size_t size) {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   307
    if (_numa_interleave_memory != NULL && _numa_all_nodes != NULL) {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   308
      _numa_interleave_memory(start, size, _numa_all_nodes);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   309
    }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   310
  }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   311
  static int get_node_by_cpu(int cpu_id);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   312
};
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   313
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   314
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents: 10565
diff changeset
   315
class PlatformEvent : public CHeapObj<mtInternal> {
10565
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   316
  private:
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   317
    double CachePad [4] ;   // increase odds that _mutex is sole occupant of cache line
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   318
    volatile int _Event ;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   319
    volatile int _nParked ;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   320
    pthread_mutex_t _mutex  [1] ;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   321
    pthread_cond_t  _cond   [1] ;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   322
    double PostPad  [2] ;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   323
    Thread * _Assoc ;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   324
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   325
  public:       // TODO-FIXME: make dtor private
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   326
    ~PlatformEvent() { guarantee (0, "invariant") ; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   327
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   328
  public:
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   329
    PlatformEvent() {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   330
      int status;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   331
      status = pthread_cond_init (_cond, NULL);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   332
      assert_status(status == 0, status, "cond_init");
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   333
      status = pthread_mutex_init (_mutex, NULL);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   334
      assert_status(status == 0, status, "mutex_init");
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   335
      _Event   = 0 ;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   336
      _nParked = 0 ;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   337
      _Assoc   = NULL ;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   338
    }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   339
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   340
    // Use caution with reset() and fired() -- they may require MEMBARs
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   341
    void reset() { _Event = 0 ; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   342
    int  fired() { return _Event; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   343
    void park () ;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   344
    void unpark () ;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   345
    int  TryPark () ;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   346
    int  park (jlong millis) ;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   347
    void SetAssociation (Thread * a) { _Assoc = a ; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   348
} ;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   349
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents: 10565
diff changeset
   350
class PlatformParker : public CHeapObj<mtInternal> {
10565
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   351
  protected:
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   352
    pthread_mutex_t _mutex [1] ;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   353
    pthread_cond_t  _cond  [1] ;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   354
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   355
  public:       // TODO-FIXME: make dtor private
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   356
    ~PlatformParker() { guarantee (0, "invariant") ; }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   357
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   358
  public:
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   359
    PlatformParker() {
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   360
      int status;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   361
      status = pthread_cond_init (_cond, NULL);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   362
      assert_status(status == 0, status, "cond_init");
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   363
      status = pthread_mutex_init (_mutex, NULL);
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   364
      assert_status(status == 0, status, "mutex_init");
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   365
    }
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   366
} ;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   367
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   368
#endif // OS_BSD_VM_OS_BSD_HPP