src/share/vm/runtime/os.cpp

Print this page


   1 /*
   2  * Copyright (c) 1997, 2009, 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 # include "incls/_precompiled.incl"
  26 # include "incls/_os.cpp.incl"





































  27 
  28 # include <signal.h>
  29 
  30 OSThread*         os::_starting_thread    = NULL;
  31 address           os::_polling_page       = NULL;
  32 volatile int32_t* os::_mem_serialize_page = NULL;
  33 uintptr_t         os::_serialize_page_mask = 0;
  34 long              os::_rand_seed          = 1;
  35 int               os::_processor_count    = 0;
  36 size_t            os::_page_sizes[os::page_sizes_max];
  37 
  38 #ifndef PRODUCT
  39 int os::num_mallocs = 0;            // # of calls to malloc/realloc
  40 size_t os::alloc_bytes = 0;         // # of bytes allocated
  41 int os::num_frees = 0;              // # of calls to free
  42 #endif
  43 
  44 // Fill in buffer with current local time as an ISO-8601 string.
  45 // E.g., yyyy-mm-ddThh:mm:ss-zzzz.
  46 // Returns buffer, or NULL if it failed.


   1 /*
   2  * Copyright (c) 1997, 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 #include "precompiled.hpp"
  26 #include "classfile/classLoader.hpp"
  27 #include "classfile/javaClasses.hpp"
  28 #include "classfile/systemDictionary.hpp"
  29 #include "classfile/vmSymbols.hpp"
  30 #include "code/icBuffer.hpp"
  31 #include "code/vtableStubs.hpp"
  32 #include "gc_implementation/shared/vmGCOperations.hpp"
  33 #include "interpreter/interpreter.hpp"
  34 #include "memory/allocation.inline.hpp"
  35 #include "oops/oop.inline.hpp"
  36 #include "prims/jvm.h"
  37 #include "prims/jvm_misc.hpp"
  38 #include "prims/privilegedStack.hpp"
  39 #include "runtime/arguments.hpp"
  40 #include "runtime/frame.inline.hpp"
  41 #include "runtime/hpi.hpp"
  42 #include "runtime/interfaceSupport.hpp"
  43 #include "runtime/java.hpp"
  44 #include "runtime/javaCalls.hpp"
  45 #include "runtime/mutexLocker.hpp"
  46 #include "runtime/os.hpp"
  47 #include "runtime/stubRoutines.hpp"
  48 #include "services/attachListener.hpp"
  49 #include "services/threadService.hpp"
  50 #include "utilities/defaultStream.hpp"
  51 #include "utilities/events.hpp"
  52 #ifdef TARGET_OS_FAMILY_linux
  53 # include "os_linux.inline.hpp"
  54 # include "thread_linux.inline.hpp"
  55 #endif
  56 #ifdef TARGET_OS_FAMILY_solaris
  57 # include "os_solaris.inline.hpp"
  58 # include "thread_solaris.inline.hpp"
  59 #endif
  60 #ifdef TARGET_OS_FAMILY_windows
  61 # include "os_windows.inline.hpp"
  62 # include "thread_windows.inline.hpp"
  63 #endif
  64 
  65 # include <signal.h>
  66 
  67 OSThread*         os::_starting_thread    = NULL;
  68 address           os::_polling_page       = NULL;
  69 volatile int32_t* os::_mem_serialize_page = NULL;
  70 uintptr_t         os::_serialize_page_mask = 0;
  71 long              os::_rand_seed          = 1;
  72 int               os::_processor_count    = 0;
  73 size_t            os::_page_sizes[os::page_sizes_max];
  74 
  75 #ifndef PRODUCT
  76 int os::num_mallocs = 0;            // # of calls to malloc/realloc
  77 size_t os::alloc_bytes = 0;         // # of bytes allocated
  78 int os::num_frees = 0;              // # of calls to free
  79 #endif
  80 
  81 // Fill in buffer with current local time as an ISO-8601 string.
  82 // E.g., yyyy-mm-ddThh:mm:ss-zzzz.
  83 // Returns buffer, or NULL if it failed.