< prev index next >

src/os/bsd/vm/os_bsd.cpp

Print this page


   1 /*
   2  * Copyright (c) 1999, 2015, 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  *


3594   // See bug 6351349.
3595   pid_t java_launcher_pid = (pid_t) Arguments::sun_java_launcher_pid();
3596 
3597   _initial_pid = (java_launcher_pid > 0) ? java_launcher_pid : getpid();
3598 
3599   clock_tics_per_sec = CLK_TCK;
3600 
3601   init_random(1234567);
3602 
3603   ThreadCritical::initialize();
3604 
3605   Bsd::set_page_size(getpagesize());
3606   if (Bsd::page_size() == -1) {
3607     fatal(err_msg("os_bsd.cpp: os::init: sysconf failed (%s)",
3608                   strerror(errno)));
3609   }
3610   init_page_sizes((size_t) Bsd::page_size());
3611 
3612   Bsd::initialize_system_info();
3613 
3614   // main_thread points to the aboriginal thread
3615   Bsd::_main_thread = pthread_self();
3616 
3617   Bsd::clock_init();
3618   initial_time_count = javaTimeNanos();
3619 
3620 #ifdef __APPLE__
3621   // XXXDARWIN
3622   // Work around the unaligned VM callbacks in hotspot's
3623   // sharedRuntime. The callbacks don't use SSE2 instructions, and work on
3624   // Linux, Solaris, and FreeBSD. On Mac OS X, dyld (rightly so) enforces
3625   // alignment when doing symbol lookup. To work around this, we force early
3626   // binding of all symbols now, thus binding when alignment is known-good.
3627   _dyld_bind_fully_image_containing_address((const void *) &os::init);
3628 #endif
3629 }
3630 
3631 // To install functions for atexit system call
3632 extern "C" {
3633   static void perfMemory_exit_helper() {
3634     perfMemory_exit();


   1 /*
   2  * Copyright (c) 1999, 2018, 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  *


3594   // See bug 6351349.
3595   pid_t java_launcher_pid = (pid_t) Arguments::sun_java_launcher_pid();
3596 
3597   _initial_pid = (java_launcher_pid > 0) ? java_launcher_pid : getpid();
3598 
3599   clock_tics_per_sec = CLK_TCK;
3600 
3601   init_random(1234567);
3602 
3603   ThreadCritical::initialize();
3604 
3605   Bsd::set_page_size(getpagesize());
3606   if (Bsd::page_size() == -1) {
3607     fatal(err_msg("os_bsd.cpp: os::init: sysconf failed (%s)",
3608                   strerror(errno)));
3609   }
3610   init_page_sizes((size_t) Bsd::page_size());
3611 
3612   Bsd::initialize_system_info();
3613 
3614   // _main_thread points to the thread that created/loaded the JVM.
3615   Bsd::_main_thread = pthread_self();
3616 
3617   Bsd::clock_init();
3618   initial_time_count = javaTimeNanos();
3619 
3620 #ifdef __APPLE__
3621   // XXXDARWIN
3622   // Work around the unaligned VM callbacks in hotspot's
3623   // sharedRuntime. The callbacks don't use SSE2 instructions, and work on
3624   // Linux, Solaris, and FreeBSD. On Mac OS X, dyld (rightly so) enforces
3625   // alignment when doing symbol lookup. To work around this, we force early
3626   // binding of all symbols now, thus binding when alignment is known-good.
3627   _dyld_bind_fully_image_containing_address((const void *) &os::init);
3628 #endif
3629 }
3630 
3631 // To install functions for atexit system call
3632 extern "C" {
3633   static void perfMemory_exit_helper() {
3634     perfMemory_exit();


< prev index next >