Direct-BT  2.3.1
Direct-BT - Direct Bluetooth Programming.
PlatformToolkit.java
Go to the documentation of this file.
1 /**
2  * Author: Sven Gothel <sgothel@jausoft.com>
3  * Copyright (c) 2020 Gothel Software e.K.
4  * Copyright (c) 2020 ZAFENA AB
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining
7  * a copy of this software and associated documentation files (the
8  * "Software"), to deal in the Software without restriction, including
9  * without limitation the rights to use, copy, modify, merge, publish,
10  * distribute, sublicense, and/or sell copies of the Software, and to
11  * permit persons to whom the Software is furnished to do so, subject to
12  * the following conditions:
13  *
14  * The above copyright notice and this permission notice shall be
15  * included in all copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24  */
25 package org.direct_bt;
26 
27 import java.io.File;
28 import java.nio.ByteBuffer;
29 import java.nio.ByteOrder;
30 import java.nio.IntBuffer;
31 import java.nio.ShortBuffer;
32 import java.security.AccessController;
33 import java.security.PrivilegedAction;
34 import java.util.ArrayList;
35 import java.util.Iterator;
36 import java.util.List;
37 import java.util.StringTokenizer;
38 
39 /**
40  * Miscellaneous platform utilities, allowed to be used within same Java package.
41  */
42 final class PlatformToolkit {
43  public enum OSType {
44  UNIX, MACOS, IOS, WINDOWS;
45  }
46  public enum CPUFamily {
47  /** AMD/Intel */
48  X86,
49  /** ARM 32bit */
51  /** ARM 64bit */
53  /** Power PC */
54  PPC,
55  /** SPARC */
57  /** Mips */
59  /** PA RISC */
61  /** Itanium */
63  /** Hitachi SuperH */
65  }
66  public enum CPUType {
67  /** ARM 32bit default, usually little endian */
68  ARM( CPUFamily.ARM32, true),
69  /** ARM7EJ, ARM9E, ARM10E, XScale, usually little endian */
71  /** ARM11, usually little endian */
73  /** ARM Cortex, usually little endian */
75  // 4
76 
77  /** X86 32bit, little endian */
78  X86_32( CPUFamily.X86, true),
79  /** PPC 32bit default, usually big endian */
80  PPC( CPUFamily.PPC, true),
81  /** MIPS 32bit, big endian (mips) or little endian (mipsel) */
83  /** Hitachi SuperH 32bit default, ??? endian */
85  /** SPARC 32bit, big endian */
87  // 9
88 
89  /** ARM64 default (64bit), usually little endian */
90  ARM64( CPUFamily.ARM64, false),
91  /** ARM AArch64 (64bit), usually little endian */
93  /** X86 64bit, little endian */
94  X86_64( CPUFamily.X86, false),
95  /** PPC 64bit default, usually big endian */
96  PPC64( CPUFamily.PPC, false),
97  /** MIPS 64bit, big endian (mips64) or little endian (mipsel64) ? */
99  /** Itanium 64bit default, little endian */
100  IA64( CPUFamily.IA64, false),
101  /** SPARC 64bit, big endian */
103  /** PA_RISC2_0 64bit, ??? endian */
105  // 17
106 
107  public final CPUFamily family;
108  public final boolean is32Bit;
109 
110  CPUType(final CPUFamily type, final boolean is32Bit){
111  this.family = type;
112  this.is32Bit = is32Bit;
113  }
114 
115  /**
116  * Returns {@code true} if the given {@link CPUType} is compatible
117  * w/ this one, i.e. at least {@link #family} and {@link #is32Bit} is equal.
118  */
119  public final boolean isCompatible(final CPUType other) {
120  if( null == other ) {
121  return false;
122  } else if( other == this ) {
123  return true;
124  } else {
125  return this.family == other.family &&
126  this.is32Bit == other.is32Bit;
127  }
128  }
129 
130  public static final CPUType query(final String cpuABILower) {
131  if( null == cpuABILower ) {
132  throw new IllegalArgumentException("Null cpuABILower arg");
133  }
134  if( cpuABILower.equals("x86") ||
135  cpuABILower.equals("i386") ||
136  cpuABILower.equals("i486") ||
137  cpuABILower.equals("i586") ||
138  cpuABILower.equals("i686") ) {
139  return X86_32;
140  } else if( cpuABILower.equals("x86_64") ||
141  cpuABILower.equals("amd64") ) {
142  return X86_64;
143  } else if( cpuABILower.equals("ia64") ) {
144  return IA64;
145  } else if( cpuABILower.equals("aarch64") ) {
146  return ARM64;
147  } else if( cpuABILower.startsWith("arm") ) {
148  if( cpuABILower.equals("armv8-a") ||
149  cpuABILower.equals("arm-v8-a") ||
150  cpuABILower.equals("arm-8-a") ||
151  cpuABILower.equals("arm64-v8a") ) {
152  return ARMv8_A;
153  } else if( cpuABILower.startsWith("arm64") ) {
154  return ARM64;
155  } else if( cpuABILower.startsWith("armv7") ||
156  cpuABILower.startsWith("arm-v7") ||
157  cpuABILower.startsWith("arm-7") ||
158  cpuABILower.startsWith("armeabi-v7") ) {
159  return ARMv7;
160  } else if( cpuABILower.startsWith("armv5") ||
161  cpuABILower.startsWith("arm-v5") ||
162  cpuABILower.startsWith("arm-5") ) {
163  return ARMv5;
164  } else if( cpuABILower.startsWith("armv6") ||
165  cpuABILower.startsWith("arm-v6") ||
166  cpuABILower.startsWith("arm-6") ) {
167  return ARMv6;
168  } else {
169  return ARM;
170  }
171  } else if( cpuABILower.equals("sparcv9") ) {
172  return SPARCV9_64;
173  } else if( cpuABILower.equals("sparc") ) {
174  return SPARC_32;
175  } else if( cpuABILower.equals("pa_risc2.0") ) {
176  return PA_RISC2_0;
177  } else if( cpuABILower.startsWith("ppc64") ) {
178  return PPC64;
179  } else if( cpuABILower.startsWith("ppc") ) {
180  return PPC;
181  } else if( cpuABILower.startsWith("mips64") ) {
182  return MIPS_64;
183  } else if( cpuABILower.startsWith("mips") ) {
184  return MIPS_32;
185  } else if( cpuABILower.startsWith("superh") ) {
186  return SuperH;
187  } else {
188  throw new RuntimeException("Please port CPUType detection to your platform (CPU_ABI string '" + cpuABILower + "')");
189  }
190  }
191  }
192  public enum ABIType {
193  GENERIC_ABI ( 0x00 ),
194  /** ARM GNU-EABI ARMEL -mfloat-abi=softfp */
195  EABI_GNU_ARMEL ( 0x01 ),
196  /** ARM GNU-EABI ARMHF -mfloat-abi=hard */
197  EABI_GNU_ARMHF ( 0x02 ),
198  /** ARM EABI AARCH64 (64bit) */
199  EABI_AARCH64 ( 0x03 );
200 
201  public final int id;
202 
203  ABIType(final int id){
204  this.id = id;
205  }
206 
207  /**
208  * Returns {@code true} if the given {@link ABIType} is compatible
209  * w/ this one, i.e. they are equal.
210  */
211  public final boolean isCompatible(final ABIType other) {
212  if( null == other ) {
213  return false;
214  } else {
215  return other == this;
216  }
217  }
218 
219  public static final ABIType query(final CPUType cpuType, final String cpuABILower) {
220  if( null == cpuType ) {
221  throw new IllegalArgumentException("Null cpuType");
222  } else if( null == cpuABILower ) {
223  throw new IllegalArgumentException("Null cpuABILower");
224  } else if( CPUFamily.ARM64 == cpuType.family ) {
225  return EABI_AARCH64;
226  } else if( CPUFamily.ARM32 == cpuType.family ) {
227  // FIXME: We only support EABI_GNU_ARMHF on ARM 32bit for now!
228  return EABI_GNU_ARMHF;
229  } else {
230  return GENERIC_ABI;
231  }
232  }
233  }
234 
235  /** Lower case system property '{@code os.name}'. */
236  static final String os_name;
237  /** Lower case system property '{@code os.arch}' */
238  static final String os_arch;
239  private static final String user_dir;
240  private static final String java_user_lib_path;
241  private static final String java_boot_lib_path;
242 
243  /**
244  * Unique platform denominator composed as '{@link #os_name}' + '-' + '{@link #os_arch}'.
245  */
246  static final String os_and_arch;
247  static final OSType OS_TYPE;
248  private static final boolean isOSX;
249 
250  private static final String prefix;
251  private static final String suffix;
252 
253  static {
254  {
255  final String[] props =
256  AccessController.doPrivileged(new PrivilegedAction<String[]>() {
257  @Override
258  public String[] run() {
259  final String[] props = new String[5];
260  int i=0;
261  props[i++] = System.getProperty("os.name").toLowerCase(); // 0
262  props[i++] = System.getProperty("os.arch").toLowerCase(); // 1
263  props[i++] = System.getProperty("user.dir"); // 2
264  props[i++] = System.getProperty("java.library.path"); // 3
265  props[i++] = System.getProperty("sun.boot.library.path"); // 4
266  return props;
267  }
268  });
269  int i=0;
270  os_name = props[i++];
271  final String _os_arch1 = props[i++];
272  user_dir = props[i++];
273  java_user_lib_path = props[i++];
274  java_boot_lib_path = props[i++];
275 
276  final boolean LITTLE_ENDIAN = queryIsLittleEndianImpl();
277  final CPUType CPU_TYPE = CPUType.query(_os_arch1);
278  final ABIType ABI_TYPE = ABIType.query(CPU_TYPE, _os_arch1);
279  final String _os_arch2 = getArchName(CPU_TYPE, ABI_TYPE, LITTLE_ENDIAN);
280  os_arch = null != _os_arch2 ? _os_arch2 : _os_arch1;
281  os_and_arch = os_name+"-"+os_arch;
282  if( BTFactory.DEBUG ) {
283  System.err.println("PlatformToolkit: os_name "+os_name+", os_arch ("+_os_arch1+" -> "+_os_arch2+" ->) "+os_arch+" (final), "+
284  "CPU_TYPE "+CPU_TYPE+", ABI_TYPE "+ABI_TYPE+", LITTLE_ENDIAN "+LITTLE_ENDIAN);
285  }
286  }
287 
288  if ( os_name.startsWith("mac os x") ||
289  os_name.startsWith("darwin") ) {
290  OS_TYPE = OSType.MACOS;
291  isOSX = true;
292  } else if ( os_name.startsWith("ios") ) {
293  OS_TYPE = OSType.IOS;
294  isOSX = true;
295  } else if ( os_name.startsWith("windows") ) {
296  OS_TYPE = OSType.WINDOWS;
297  isOSX = false;
298  } else {
299  OS_TYPE = OSType.UNIX;
300  isOSX = false;
301  }
302 
303  switch (OS_TYPE) {
304  case WINDOWS:
305  prefix = "";
306  suffix = ".dll";
307  break;
308 
309  case MACOS:
310  case IOS:
311  prefix = "lib";
312  suffix = ".dylib";
313  break;
314 
315  case UNIX:
316  default:
317  prefix = "lib";
318  suffix = ".so";
319  break;
320  }
321  }
322 
323  private static final boolean queryIsLittleEndianImpl() {
324  final ByteBuffer tst_b = ByteBuffer.allocateDirect(4 /* SIZEOF_INT */).order(ByteOrder.nativeOrder()); // 32bit in native order
325  final IntBuffer tst_i = tst_b.asIntBuffer();
326  final ShortBuffer tst_s = tst_b.asShortBuffer();
327  tst_i.put(0, 0x0A0B0C0D);
328  return 0x0C0D == tst_s.get(0);
329  }
330  private static final String getArchName(final CPUType cpuType, final ABIType abiType, final boolean littleEndian) {
331  switch( abiType ) {
332  case EABI_GNU_ARMEL:
333  return "arm"; // actually not supported!
334  case EABI_GNU_ARMHF:
335  return "armhf";
336  case EABI_AARCH64:
337  return "arm64";
338  default:
339  break;
340  }
341 
342  switch( cpuType ) {
343  case X86_32:
344  return "i386";
345  case PPC:
346  return "ppc";
347  case MIPS_32:
348  return littleEndian ? "mipsel" : "mips";
349  case SuperH:
350  return "superh";
351  case SPARC_32:
352  return "sparc";
353 
354  case X86_64:
355  return "amd64";
356  case PPC64:
357  return littleEndian ? "ppc64le" : "ppc64";
358  case MIPS_64:
359  return "mips64";
360  case IA64:
361  return "ia64";
362  case SPARCV9_64:
363  return "sparcv9";
364  case PA_RISC2_0:
365  return "risc2.0";
366  default:
367  return null;
368  }
369  }
370 
371  /**
372  * Produces a list of potential full native library pathnames, denoted by its {@code libBaseName}.
373  *
374  * <p>
375  * Basic order of library locations
376  * <pre>
377  * User locations:
378  * - current working directory + {@link #os_and_arch}
379  * - iterate through paths within 'java.library.path', adding {@link #os_and_arch} to each
380  * - current working directory
381  * - iterate through paths within 'java.library.path'
382  *
383  * System locations:
384  * - optional OSX path
385  * - iterate through paths within 'sun.boot.library.path'
386  * </pre>
387  * </p>
388  *
389  * <p>
390  * Example:
391  * <pre>
392  /usr/local/projects/direct_bt/dist-amd64/linux-amd64/libdirect_bt.so (addPath cwd.os_and_arch)
393  /usr/local/projects/direct_bt/dist-amd64/lib/linux-amd64/libdirect_bt.so (addPath java-user-libpath.os_and_arch:0)
394  /usr/local/projects/direct_bt/dist-amd64/libdirect_bt.so (addPath cwd)
395  /usr/local/projects/direct_bt/dist-amd64/lib/libdirect_bt.so (addPath java-user-libpath:0)
396  /usr/lib/jvm/java-14-openjdk-amd64/lib/libdirect_bt.so (addPath java-boot-libpath:0)
397  * </pre>
398  *
399  * @param libBaseName library basename without prefix (like 'lib') or suffix like '.so'.
400  * @param searchSystemPath
401  * @param searchSystemPathFirst
402  * @param loader
403  * @return
404  */
405  private static final List<String> enumerateLibraryPaths(final String libBaseName,
406  final boolean searchSystemPath,
407  final boolean searchSystemPathFirst,
408  final ClassLoader loader) {
409  final List<String> paths = new ArrayList<String>();
410 
411  if ( libBaseName == null || libBaseName.length() == 0 ) {
412  return paths;
413  }
414 
415  final String libPlatformName = getPlatformName(libBaseName);
416 
417  if( searchSystemPath && searchSystemPathFirst ) {
418  // Add probable Mac OS X-specific paths
419  if ( isOSX ) {
420  // Add historical location
421  addPath("osx-1", "/Library/Frameworks/" + libBaseName + ".framework", libPlatformName, paths);
422  // Add current location
423  addPath("osx-2", "/System/Library/Frameworks/" + libBaseName + ".framework", libPlatformName, paths);
424  }
425  addMultiPaths("java-boot-libpath", java_boot_lib_path, libPlatformName, paths);
426  }
427 
428  addPath("cwd.os_and_arch", user_dir+File.separator+os_and_arch, libPlatformName, paths);
429  addMultiPaths2("java-user-libpath.os_and_arch", java_user_lib_path, os_and_arch, libPlatformName, paths);
430 
431  addPath("cwd", user_dir, libPlatformName, paths);
432  addMultiPaths("java-user-libpath", java_user_lib_path, libPlatformName, paths);
433 
434  if( searchSystemPath && !searchSystemPathFirst ) {
435  // Add probable Mac OS X-specific paths
436  if ( isOSX ) {
437  // Add historical location
438  addPath("osx-1", "/Library/Frameworks/" + libBaseName + ".Framework", libPlatformName, paths);
439  // Add current location
440  addPath("osx-2", "/System/Library/Frameworks/" + libBaseName + ".Framework", libPlatformName, paths);
441  }
442  addMultiPaths("java-boot-libpath", java_boot_lib_path, libPlatformName, paths);
443  }
444 
445  return paths;
446  }
447 
448 
449  private static final String getPlatformName(final String libBaseName) {
450  return prefix + libBaseName + suffix;
451  }
452  private static final String getCanonicalPath(final String path) {
453  return AccessController.doPrivileged(new PrivilegedAction<String>() {
454  @Override
455  public String run() {
456  try {
457  final File f = new File(path);
458  // f.getCanonicalPath() also resolved '.', '..' and symbolic links in contrast to f.getAbsolutePath()
459  return f.getCanonicalPath();
460  } catch (final Throwable t) {
461  if( BTFactory.DEBUG ) {
462  System.err.println("getAbsolutePath("+path+") failed: "+t.getMessage());
463  }
464  return null;
465  }
466  } } );
467  }
468  private static final void addPath(final String msg, final String path, final String platformName, final List<String> paths) {
469  if( null != path && path.length() > 0 ) {
470  final String fullpath = path + File.separator + platformName;
471  final String abspath = getCanonicalPath(fullpath);
472  if( null != abspath ) {
473  final boolean isDup = paths.contains(abspath);
474  if( BTFactory.DEBUG ) {
475  System.err.println(" "+abspath+" (addPath "+msg+", dropped duplicate "+isDup+")");
476  }
477  if( !isDup ) {
478  paths.add(abspath);
479  }
480  }
481  }
482  }
483  private static final void addMultiPaths(final String msg, final String pathList, final String platformName, final List<String> paths) {
484  if( null != pathList && pathList.length() > 0 ) {
485  final StringTokenizer tokenizer = new StringTokenizer(pathList, File.pathSeparator);
486  int i=0;
487  while (tokenizer.hasMoreTokens()) {
488  addPath(msg+":"+i, tokenizer.nextToken(), platformName, paths);
489  i++;
490  }
491  }
492  }
493  private static final void addMultiPaths2(final String msg, final String pathList, final String subDir, final String platformName, final List<String> paths) {
494  if( null != pathList && pathList.length() > 0 && null != subDir && subDir.length() > 0 ) {
495  final StringTokenizer tokenizer = new StringTokenizer(pathList, File.pathSeparator);
496  int i=0;
497  while (tokenizer.hasMoreTokens()) {
498  final String path = tokenizer.nextToken() + File.separator + subDir;
499  addPath(msg+":"+i, path, platformName, paths);
500  i++;
501  }
502  }
503  }
504 
505 
506  /**
507  * Loads a native library, denoted by its {@code libBaseName}.
508  *
509  * <p>
510  * Basic order of library locations
511  * <pre>
512  * User locations:
513  * - current working directory + {@link #os_and_arch}
514  * - iterate through paths within 'java.library.path', adding {@link #os_and_arch} to each
515  * - current working directory
516  * - iterate through paths within 'java.library.path'
517  *
518  * System locations:
519  * - optional OSX path
520  * - iterate through paths within 'sun.boot.library.path'
521  * </pre>
522  * </p>
523  *
524  * <p>
525  * If the above fails, {@link System#loadLibrary(String)} is called using the plain {@code libBaseName},
526  * exhausting all simple locations and methods.
527  * </p>
528  *
529  * <p>
530  * Example:
531  * <pre>
532  /usr/local/projects/direct_bt/dist-amd64/linux-amd64/libdirect_bt.so (addPath cwd.os_and_arch)
533  /usr/local/projects/direct_bt/dist-amd64/lib/linux-amd64/libdirect_bt.so (addPath java-user-libpath.os_and_arch:0)
534  /usr/local/projects/direct_bt/dist-amd64/libdirect_bt.so (addPath cwd)
535  /usr/local/projects/direct_bt/dist-amd64/lib/libdirect_bt.so (addPath java-user-libpath:0)
536  /usr/lib/jvm/java-14-openjdk-amd64/lib/libdirect_bt.so (addPath java-boot-libpath:0)
537  * </pre>
538  *
539  * @param libBaseName library basename without prefix (like 'lib') or suffix like '.so'.
540  * @param cl
541  * @param t holder to store the last Throwable, if any
542  * @return {@code true} if successful, otherwise {@code false}.
543  */
544  static boolean loadLibrary(final String libBaseName, final ClassLoader cl, final Throwable[] t) {
545  if( BTFactory.DEBUG ) {
546  System.err.println();
547  System.err.println("PlatformToolkit.loadLibrary: libBaseName "+libBaseName+":");
548  }
549  final List<String> possiblePaths = enumerateLibraryPaths(libBaseName, true /* searchSystemPath */, false /* searchSystemPathFirst */, cl);
550  if( BTFactory.DEBUG ) {
551  System.err.println();
552  }
553 
554  // Iterate down these and see which one if any we can actually find.
555  for (final Iterator<String> iter = possiblePaths.iterator(); iter.hasNext(); ) {
556  final String path = iter.next();
557  try {
558  System.load(path);
559  if( BTFactory.DEBUG ) {
560  System.err.println(" "+path+" success");
561  }
562  return true;
563  } catch (final Throwable t0) {
564  if( BTFactory.DEBUG ) {
565  System.err.println(" "+path+" failed: "+t0.getMessage());
566  }
567  t[0] = t0;
568  }
569  }
570 
571  // Fall back to loadLibrary
572  try {
573  System.loadLibrary(libBaseName);
574  if( BTFactory.DEBUG ) {
575  System.err.println(" "+libBaseName+" success");
576  }
577  return true;
578  } catch (final Throwable t0) {
579  if( BTFactory.DEBUG ) {
580  System.err.println(" "+libBaseName+" failed: "+t0.getMessage());
581  }
582  t[0] = t0;
583  }
584  return false;
585  }
586 }
org.direct_bt.PlatformToolkit.ABIType.EABI_GNU_ARMEL
EABI_GNU_ARMEL
ARM GNU-EABI ARMEL -mfloat-abi=softfp.
Definition: PlatformToolkit.java:195
org.direct_bt.PlatformToolkit.CPUType.query
static final CPUType query(final String cpuABILower)
Definition: PlatformToolkit.java:130
org.direct_bt.PlatformToolkit.CPUType.family
final CPUFamily family
Definition: PlatformToolkit.java:107
org.direct_bt.PlatformToolkit.CPUType.ARM64
ARM64
ARM64 default (64bit), usually little endian.
Definition: PlatformToolkit.java:90
org.direct_bt.PlatformToolkit.CPUType.ARMv6
ARMv6
ARM11, usually little endian.
Definition: PlatformToolkit.java:72
org.direct_bt.PlatformToolkit.OSType
Definition: PlatformToolkit.java:43
org.direct_bt.PlatformToolkit.CPUType.X86_64
X86_64
X86 64bit, little endian.
Definition: PlatformToolkit.java:94
org.direct_bt.PlatformToolkit.ABIType.query
static final ABIType query(final CPUType cpuType, final String cpuABILower)
Definition: PlatformToolkit.java:219
org.direct_bt.PlatformToolkit.CPUType.X86_32
X86_32
X86 32bit, little endian.
Definition: PlatformToolkit.java:78
org.direct_bt.PlatformToolkit.CPUFamily.MIPS
MIPS
Mips.
Definition: PlatformToolkit.java:58
org.direct_bt.PlatformToolkit.CPUType.IA64
IA64
Itanium 64bit default, little endian.
Definition: PlatformToolkit.java:100
org.direct_bt.PlatformToolkit.CPUType.isCompatible
final boolean isCompatible(final CPUType other)
Returns.
Definition: PlatformToolkit.java:119
org.direct_bt.PlatformToolkit.CPUType.is32Bit
final boolean is32Bit
Definition: PlatformToolkit.java:108
org.direct_bt.PlatformToolkit.CPUFamily.IA64
IA64
Itanium.
Definition: PlatformToolkit.java:62
org.direct_bt.PlatformToolkit.CPUType.SPARC_32
SPARC_32
SPARC 32bit, big endian.
Definition: PlatformToolkit.java:86
org.direct_bt.PlatformToolkit.CPUFamily.PA_RISC
PA_RISC
PA RISC.
Definition: PlatformToolkit.java:60
org.direct_bt.PlatformToolkit.ABIType
Definition: PlatformToolkit.java:192
org.direct_bt.PlatformToolkit.CPUType.PPC
PPC
PPC 32bit default, usually big endian.
Definition: PlatformToolkit.java:80
org.direct_bt.PlatformToolkit.CPUType.SPARCV9_64
SPARCV9_64
SPARC 64bit, big endian.
Definition: PlatformToolkit.java:102
org.direct_bt.PlatformToolkit.CPUType.ARMv5
ARMv5
ARM7EJ, ARM9E, ARM10E, XScale, usually little endian.
Definition: PlatformToolkit.java:70
org.direct_bt.PlatformToolkit.OSType.WINDOWS
WINDOWS
Definition: PlatformToolkit.java:44
org.direct_bt.PlatformToolkit.CPUFamily.SuperH
SuperH
Hitachi SuperH.
Definition: PlatformToolkit.java:64
org.direct_bt.PlatformToolkit.CPUType.PPC64
PPC64
PPC 64bit default, usually big endian.
Definition: PlatformToolkit.java:96
org.direct_bt.PlatformToolkit.CPUType.SuperH
SuperH
Hitachi SuperH 32bit default, ??? endian.
Definition: PlatformToolkit.java:84
org.direct_bt.PlatformToolkit.CPUFamily.ARM64
ARM64
ARM 64bit.
Definition: PlatformToolkit.java:52
org.direct_bt.PlatformToolkit.CPUFamily.PPC
PPC
Power PC.
Definition: PlatformToolkit.java:54
org.direct_bt.PlatformToolkit.CPUType.ARMv8_A
ARMv8_A
ARM AArch64 (64bit), usually little endian.
Definition: PlatformToolkit.java:92
org.direct_bt.PlatformToolkit.CPUType.ARMv7
ARMv7
ARM Cortex, usually little endian.
Definition: PlatformToolkit.java:74
org.direct_bt.PlatformToolkit.CPUType
Definition: PlatformToolkit.java:66
org.direct_bt.PlatformToolkit.CPUType.CPUType
CPUType(final CPUFamily type, final boolean is32Bit)
Definition: PlatformToolkit.java:110
org.direct_bt.PlatformToolkit.CPUType.PA_RISC2_0
PA_RISC2_0
PA_RISC2_0 64bit, ??? endian.
Definition: PlatformToolkit.java:104
org.direct_bt.PlatformToolkit.CPUFamily.X86
X86
AMD/Intel.
Definition: PlatformToolkit.java:48
org.direct_bt.PlatformToolkit.CPUFamily
Definition: PlatformToolkit.java:46
org.direct_bt.PlatformToolkit.CPUFamily.ARM32
ARM32
ARM 32bit.
Definition: PlatformToolkit.java:50
org.direct_bt.PlatformToolkit.ABIType.ABIType
ABIType(final int id)
Definition: PlatformToolkit.java:203
org.direct_bt.PlatformToolkit.CPUType.MIPS_32
MIPS_32
MIPS 32bit, big endian (mips) or little endian (mipsel)
Definition: PlatformToolkit.java:82
org.direct_bt.PlatformToolkit.ABIType.EABI_GNU_ARMHF
EABI_GNU_ARMHF
ARM GNU-EABI ARMHF -mfloat-abi=hard.
Definition: PlatformToolkit.java:197
org.direct_bt.PlatformToolkit.CPUFamily.SPARC
SPARC
SPARC.
Definition: PlatformToolkit.java:56
org.direct_bt.PlatformToolkit.CPUType.MIPS_64
MIPS_64
MIPS 64bit, big endian (mips64) or little endian (mipsel64) ?
Definition: PlatformToolkit.java:98
org.direct_bt.PlatformToolkit.ABIType.id
final int id
Definition: PlatformToolkit.java:201
org.direct_bt.PlatformToolkit.ABIType.EABI_AARCH64
EABI_AARCH64
ARM EABI AARCH64 (64bit)
Definition: PlatformToolkit.java:199
org.direct_bt.PlatformToolkit.ABIType.isCompatible
final boolean isCompatible(final ABIType other)
Returns.
Definition: PlatformToolkit.java:211
org.direct_bt.PlatformToolkit.CPUType.ARM
ARM
ARM 32bit default, usually little endian.
Definition: PlatformToolkit.java:68
org.direct_bt.PlatformToolkit.ABIType.GENERIC_ABI
GENERIC_ABI
Definition: PlatformToolkit.java:193