View Javadoc
1   /*
2    * Copyright 2016-2024 The OSHI Project Contributors
3    * SPDX-License-Identifier: MIT
4    */
5   package oshi.jna.platform.windows;
6   
7   import com.sun.jna.Native;
8   
9   /**
10   * Kernel32. This class should be considered non-API as it may be removed if/when its code is incorporated into the JNA
11   * project.
12   */
13  public interface Kernel32 extends com.sun.jna.platform.win32.Kernel32 {
14      /** Constant <code>INSTANCE</code> */
15      Kernel32 INSTANCE = Native.load("Kernel32", Kernel32.class);
16  
17      enum ProcessorFeature {
18          PF_FLOATING_POINT_PRECISION_ERRATA(0), PF_FLOATING_POINT_EMULATED(1), PF_COMPARE_EXCHANGE_DOUBLE(2),
19          PF_MMX_INSTRUCTIONS_AVAILABLE(3), PF_PPC_MOVEMEM_64BIT_OK(4), PF_ALPHA_BYTE_INSTRUCTIONS(5),
20          PF_XMMI_INSTRUCTIONS_AVAILABLE(6), PF_3DNOW_INSTRUCTIONS_AVAILABLE(7), PF_RDTSC_INSTRUCTION_AVAILABLE(8),
21          PF_PAE_ENABLED(9), PF_XMMI64_INSTRUCTIONS_AVAILABLE(10), PF_SSE_DAZ_MODE_AVAILABLE(11), PF_NX_ENABLED(12),
22          PF_SSE3_INSTRUCTIONS_AVAILABLE(13), PF_COMPARE_EXCHANGE128(14), PF_COMPARE64_EXCHANGE128(15),
23          PF_CHANNELS_ENABLED(16), PF_XSAVE_ENABLED(17), PF_ARM_VFP_32_REGISTERS_AVAILABLE(18),
24          PF_ARM_NEON_INSTRUCTIONS_AVAILABLE(19), PF_SECOND_LEVEL_ADDRESS_TRANSLATION(20), PF_VIRT_FIRMWARE_ENABLED(21),
25          PF_RDWRFSGSBASE_AVAILABLE(22), PF_FASTFAIL_AVAILABLE(23), PF_ARM_DIVIDE_INSTRUCTION_AVAILABLE(24),
26          PF_ARM_64BIT_LOADSTORE_ATOMIC(25), PF_ARM_EXTERNAL_CACHE_AVAILABLE(26), PF_ARM_FMAC_INSTRUCTIONS_AVAILABLE(27),
27          PF_RDRAND_INSTRUCTION_AVAILABLE(28), PF_ARM_V8_INSTRUCTIONS_AVAILABLE(29),
28          PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE(30), PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE(31),
29          PF_RDTSCP_INSTRUCTION_AVAILABLE(32), PF_RDPID_INSTRUCTION_AVAILABLE(33),
30          PF_ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE(34), PF_SSSE3_INSTRUCTIONS_AVAILABLE(36),
31          PF_SSE4_1_INSTRUCTIONS_AVAILABLE(37), PF_SSE4_2_INSTRUCTIONS_AVAILABLE(38), PF_AVX_INSTRUCTIONS_AVAILABLE(39),
32          PF_AVX2_INSTRUCTIONS_AVAILABLE(40), PF_AVX512F_INSTRUCTIONS_AVAILABLE(41),
33          PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE(43), PF_ARM_V83_JSCVT_INSTRUCTIONS_AVAILABLE(44),
34          PF_ARM_V83_LRCPC_INSTRUCTIONS_AVAILABLE(45);
35  
36          private final int value;
37  
38          ProcessorFeature(int value) {
39              this.value = value;
40          }
41  
42          /**
43           * @return the value
44           */
45          public int value() {
46              return value;
47          }
48      }
49  
50      /**
51       * Determines whether the specified processor feature is supported by the current computer.
52       *
53       * @param ProcessorFeature The processor feature to be tested. This parameter can be one of the values in
54       *                         {@link ProcessorFeature}.
55       * @return If the feature is supported, the return value is true. If the feature is not supported, the return value
56       *         is false. If the HAL does not support detection of the feature, whether or not the hardware supports the
57       *         feature, the return value is also false.
58       */
59      boolean IsProcessorFeaturePresent(int ProcessorFeature);
60  }