1 /*
   2  * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright (c) 2014, Red Hat Inc. All rights reserved.
   4  * Copyright (c) 2015, Linaro Ltd. All rights reserved.
   5  * Copyright (c) 2015-2018, Azul Systems, Inc. All rights reserved.
   6  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   7  *
   8  * This code is free software; you can redistribute it and/or modify it
   9  * under the terms of the GNU General Public License version 2 only, as
  10  * published by the Free Software Foundation.
  11  *
  12  * This code is distributed in the hope that it will be useful, but WITHOUT
  13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15  * version 2 for more details (a copy is included in the LICENSE file that
  16  * accompanied this code).
  17  *
  18  * You should have received a copy of the GNU General Public License version
  19  * 2 along with this work; if not, write to the Free Software Foundation,
  20  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  21  *
  22  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  23  * or visit www.oracle.com if you need additional information or have any
  24  * questions.
  25  *
  26  */
  27 
  28 #ifndef CPU_AARCH32_VM_VM_VERSION_AARCH32_HPP
  29 #define CPU_AARCH32_VM_VM_VERSION_AARCH32_HPP
  30 
  31 #include "runtime/globals_extension.hpp"
  32 #include "runtime/vm_version.hpp"
  33 #include "utilities/sizes.hpp"
  34 
  35 enum ProcessorFeatures {
  36     FT_NONE = 0,
  37     FT_HW_DIVIDE = 1,
  38     FT_VFPV2 = 2,
  39     FT_VFPV3 = 4,
  40     FT_VFPV3D32 = 8,
  41     FT_ARMV7 = 16,
  42     FT_ARMV6T2 = 32,
  43     FT_ARMV6K = 64,
  44     FT_SINGLE_CORE = 128,
  45     FT_AdvSIMD = 256,
  46     FT_CRC32 = 512,
  47     FT_MP_EXT = 1024,
  48     FT_AES = 2048,
  49     FT_ALL = 0xffff
  50 };
  51 
  52 class VM_Version : public Abstract_VM_Version {
  53  public:
  54   // Processor feature lookup.
  55 
  56   enum {
  57     CPU_ARM       = 'A',
  58     CPU_BROADCOM  = 'B',
  59     CPU_CAVIUM    = 'C',
  60     CPU_DEC       = 'D',
  61     CPU_INFINEON  = 'I',
  62     CPU_MOTOROLA  = 'M',
  63     CPU_NVIDIA    = 'N',
  64     CPU_AMCC      = 'P',
  65     CPU_QUALCOM   = 'Q',
  66     CPU_MARVELL   = 'V',
  67     CPU_INTEL     = 'i',
  68   } cpuFamily;
  69 
  70   // Initialization
  71   static void initialize();
  72 
  73  private:
  74   static enum ProcessorFeatures _features;
  75   static const char* _cpu_features;
  76     static volatile bool _is_determine_features_test_running;
  77 
  78   static void get_processor_features();
  79   static bool identify_procline(const char *tag, char **line);
  80 
  81  public:
  82   static enum ProcessorFeatures features() {
  83     return _features;
  84   }
  85     static void features(ProcessorFeatures f) {
  86       _features = f;
  87     }
  88     static bool is_determine_features_test_running() { return _is_determine_features_test_running; }
  89 };
  90 
  91 #ifdef HARD_FLOAT_CC
  92 inline const bool hasFPU(void) { return true; }
  93 #else
  94 inline bool hasFPU(void) { return (UseFPU); }
  95 #endif
  96 
  97 
  98 #endif // CPU_AARCH32_VM_VM_VERSION_AARCH32_HPP