| /* | |
| * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. | |
| * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
| * | |
| * This code is free software; you can redistribute it and/or modify it | |
| * under the terms of the GNU General Public License version 2 only, as | |
| * published by the Free Software Foundation. Oracle designates this | |
| * particular file as subject to the "Classpath" exception as provided | |
| * by Oracle in the LICENSE file that accompanied this code. | |
| * | |
| * This code is distributed in the hope that it will be useful, but WITHOUT | |
| * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| * version 2 for more details (a copy is included in the LICENSE file that | |
| * accompanied this code). | |
| * | |
| * You should have received a copy of the GNU General Public License version | |
| * 2 along with this work; if not, write to the Free Software Foundation, | |
| * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
| * | |
| * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
| * or visit www.oracle.com if you need additional information or have any | |
| * questions. | |
| */ | |
| package jdk.internal.util; | |
| /** | |
| * The corresponding source file is generated by GensrcMisc.gmk for java.base. | |
| * @see OperatingSystem | |
| * @see Architecture | |
| */ | |
| class PlatformProps { | |
| // Name of the current OperatingSystem enum as substituted by the build | |
| static final String CURRENT_OS_STRING = "@@OPENJDK_TARGET_OS@@"; | |
| // Precomputed booleans for each Operating System | |
| static final boolean TARGET_OS_IS_LINUX = "@@OPENJDK_TARGET_OS@@" == "linux"; | |
| static final boolean TARGET_OS_IS_MACOS = "@@OPENJDK_TARGET_OS@@" == "macos"; | |
| static final boolean TARGET_OS_IS_WINDOWS = "@@OPENJDK_TARGET_OS@@" == "windows"; | |
| static final boolean TARGET_OS_IS_AIX = "@@OPENJDK_TARGET_OS@@" == "aix"; | |
| // The Architecture value for the current architecture | |
| static final String CURRENT_ARCH_STRING = "@@OPENJDK_TARGET_CPU@@"; | |
| // Architecture.is64Bit() uses this value | |
| static final int TARGET_ARCH_BITS = @@OPENJDK_TARGET_CPU_BITS@@; | |
| // Architecture.isLittleEndian value from the build | |
| static final boolean TARGET_ARCH_LITTLE_ENDIAN = "@@OPENJDK_TARGET_CPU_ENDIAN@@" == "little"; | |
| // Precomputed booleans for each Architecture, shared with jdk.internal.util.Architecture | |
| // The variables are named to match the Architecture value names, and | |
| // the values chosen to match the build values. | |
| static final boolean TARGET_ARCH_IS_AARCH64 = "@@OPENJDK_TARGET_CPU@@" == "aarch64"; | |
| static final boolean TARGET_ARCH_IS_ARM = "@@OPENJDK_TARGET_CPU@@" == "arm"; | |
| static final boolean TARGET_ARCH_IS_LOONGARCH64 = "@@OPENJDK_TARGET_CPU@@" == "loongarch64"; | |
| static final boolean TARGET_ARCH_IS_MIPSEL = "@@OPENJDK_TARGET_CPU@@" == "mipsel"; | |
| static final boolean TARGET_ARCH_IS_MIPS64EL= "@@OPENJDK_TARGET_CPU@@" == "mips64el"; | |
| static final boolean TARGET_ARCH_IS_PPC = "@@OPENJDK_TARGET_CPU@@" == "ppc"; | |
| static final boolean TARGET_ARCH_IS_PPC64 = "@@OPENJDK_TARGET_CPU@@" == "ppc64"; | |
| static final boolean TARGET_ARCH_IS_PPC64LE = "@@OPENJDK_TARGET_CPU@@" == "ppc64le"; | |
| static final boolean TARGET_ARCH_IS_RISCV64 = "@@OPENJDK_TARGET_CPU@@" == "riscv64"; | |
| static final boolean TARGET_ARCH_IS_S390 = "@@OPENJDK_TARGET_CPU@@" == "s390"; | |
| static final boolean TARGET_ARCH_IS_SPARCV9 = "@@OPENJDK_TARGET_CPU@@" == "sparcv9"; | |
| static final boolean TARGET_ARCH_IS_X86 = "@@OPENJDK_TARGET_CPU@@" == "x86"; | |
| static final boolean TARGET_ARCH_IS_X64 = "@@OPENJDK_TARGET_CPU@@" == "x64"; | |
| } |