1 /*
2 * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2014, Red Hat Inc. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
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
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
478 return 0;
479 }
480
481 void os::Linux::set_fpu_control_word(int fpu_control) {
482 }
483
484 // Check that the linux kernel version is 2.4 or higher since earlier
485 // versions do not support SSE without patches.
486 bool os::supports_sse() {
487 return true;
488 }
489
490 bool os::is_allocatable(size_t bytes) {
491 return true;
492 }
493
494 ////////////////////////////////////////////////////////////////////////////////
495 // thread stack
496
497 size_t os::Linux::min_stack_allowed = 64 * K;
498
499 // aarch64: pthread on aarch64 is always in floating stack mode
500 bool os::Linux::supports_variable_stack_size() { return true; }
501
502 // return default stack size for thr_type
503 size_t os::Linux::default_stack_size(os::ThreadType thr_type) {
504 // default stack size (compiler thread needs larger stack)
505 size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M);
506 return s;
507 }
508
509 size_t os::Linux::default_guard_size(os::ThreadType thr_type) {
510 // Creating guard page is very expensive. Java thread has HotSpot
511 // guard page, only enable glibc guard page for non-Java threads.
512 return (thr_type == java_thread ? 0 : page_size());
513 }
514
515 // Java thread:
516 //
517 // Low memory addresses
518 // +------------------------+
519 // | |\ JavaThread created by VM does not have glibc
520 // | glibc guard page | - guard, attached Java thread usually has
|
1 /*
2 * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2014, Red Hat Inc. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
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
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
478 return 0;
479 }
480
481 void os::Linux::set_fpu_control_word(int fpu_control) {
482 }
483
484 // Check that the linux kernel version is 2.4 or higher since earlier
485 // versions do not support SSE without patches.
486 bool os::supports_sse() {
487 return true;
488 }
489
490 bool os::is_allocatable(size_t bytes) {
491 return true;
492 }
493
494 ////////////////////////////////////////////////////////////////////////////////
495 // thread stack
496
497 size_t os::Linux::min_stack_allowed = 64 * K;
498
499 // return default stack size for thr_type
500 size_t os::Linux::default_stack_size(os::ThreadType thr_type) {
501 // default stack size (compiler thread needs larger stack)
502 size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M);
503 return s;
504 }
505
506 size_t os::Linux::default_guard_size(os::ThreadType thr_type) {
507 // Creating guard page is very expensive. Java thread has HotSpot
508 // guard page, only enable glibc guard page for non-Java threads.
509 return (thr_type == java_thread ? 0 : page_size());
510 }
511
512 // Java thread:
513 //
514 // Low memory addresses
515 // +------------------------+
516 // | |\ JavaThread created by VM does not have glibc
517 // | glibc guard page | - guard, attached Java thread usually has
|