summaryrefslogtreecommitdiffstats
path: root/src/java/jogamp/common/os/MachineDescriptionRuntime.java
Commit message (Collapse)AuthorAgeFilesLines
* Bug 1126 - Remove static query requirement of MachineDescriptor, find ↵Sven Gothel2015-02-021-156/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | matching StaticConfig at runtime; Fix PPC (Bug 1056) and MIPSLE (Bug 1014) issues. Currently the StaticConfig is being queried via the key[OSType, CPUType ..] as pre-determined by Java properties or the ELF parser. This adds complication to maintain different platforms and the key query might not even be sufficient. The MachineDescriptor's StaticConfig only purpose shall be to speed-up native data size and offset/alignment retrieval. This is done by using the StaticConfig index within all StaticConfig[]s as a lookup-index for the precomputed struct's size and offset tables. +++ Solution: Rename: MachineDescriptor -> MachineDataInfo Rename: MachineDescriptorRuntime -> MachineDataInfoRuntime After having defined os.and.arch (OSType, CPUType and ABIType) w/ the optional help of the now self containing ELF Reader (Bug 1125), the native gluegen-rt library gets loaded enabling JNI methods. It is satisfactory to retrieve MachineDataInfo at runtime w/ JNI and find the matching/compatible StaticConfig. Only in case none is found, the program needs to abort. Otherwise the found MachineDataInfo.StaticConfig and MachineDataInfo are stored for further use (see above). This removes above complication and key to StaticConfig mapping. New platforms simply need to add a new unique entry into the StaticConfig[] table. ++ Also fixes Bug 1056 (PPC), thanks to tmancill [@] debian [.] org, and Bug 1014 (MIPSLE), thanks to Dejan Latinovic. Parts of the patch for Bug 1014 from Dejan Latinovic are included. also solved by this change set.
* Bug 1125 - Make ELF Reader 'jogamp.common.os.elf' StatelessSven Gothel2015-02-011-23/+10
| | | | | | | | | | | | | | | | | | | | | | | | | ELF Reader 'jogamp.common.os.elf' currently uses Platform's pre-determined OS_TYPE and CPUType. It also uses the host platforms MachineDescription, hence can not read ELF files from other machines. This also forbids Platform to determine CPUType etc w/o having a valid 'os.arch' property. +++ ElfHeader should be split in - ElfHeaderPart1 (CPUType independent) - ElfHeaderPart2 (CPUType dependent) Fix shall make the ELF Reader self containing by only using ELF CPUType data, etc. This requires customization of struct parsing, where MachineDescription.Static index shall be - defined in ElfHeaderPart1 using e_Ident's CPUType. - used in ElfHeaderPart2 and all its struct types.
* Bug 1122: Refine AArch64 and OSType/32Bit incl. MachineDescriptionSven Gothel2015-01-301-27/+5
| | | | | | | | | | | | Android: - Detect ABIType.EABI_GNU_ARMHF via 'armeabi-v7a-hard' Platform.CPUType: - contains is32Bit now MachineDescription: - Rename *x86_64_unix* -> *lp64_unix*, reflecting universal __LP64__ mode - Remove is32Bit, which is determined by CPUType
* Bug 1122: Add AArch64 support (Android, GNU/Linux and in general)Sven Gothel2015-01-301-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add AArch64 detection via - Elf Parser - Android properties - Java properties - Android: Validate CPUType.Family _and_ ABIType - MachineDescription - Remove redundant Type ID and its field - Reuse X86_64_UNIX for AArch64 (static config) New ARCH 'aarch64' for ant: <os arch> armv8a aarch64 New CPUType.ARM64 (ARM): java: os.arch aarch64 arm64 New CPUType.ARMv8_A (ARM): java: os.arch armv8-a arm64-v8a New ABIType: EABI_AARCH64
* Code Clean-Up based on our Recommended Settings (jogamp-scripting ↵Sven Gothel2014-07-031-2/+2
| | | | | | | | | | | | | | | c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74) Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74) - Change non static accesses to static members using declaring type - Change indirect accesses to static members to direct accesses (accesses through subtypes) - Add final modifier to private fields - Add final modifier to method parameters - Add final modifier to local variables - Remove unnecessary casts - Remove unnecessary '$NON-NLS$' tags - Remove trailing white spaces on all lines
* Bug 856 - Android: Support dual ABI (x86 i686 *and* ARMv7arm), i.e. pick ↵Sven Gothel2014-01-241-21/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'best' ABI - Use 'os.arch' as a prelim CPUType for MachineDescription - Always attempt to load a binary and parse it's elf header - Linux: self-exe - Android: gluegen-rt library - Other: java lib - Always use details (ABI) if ARM - Android: Check CPU_TYPE and CPU_TYPE2 // FIXME / HACK: // We use sCPUType for MachineDescriptionRuntime.getStatic() // until we have determined the final CPU_TYPE, etc. // MachineDescriptionRuntime gets notified via MachineDescriptionRuntime.notifyPropsInitialized() below. // // We could use Elf Ehdr's machine value to determine the bit-size // used for it's offset table! // However, 'os.arch' should be a good guess for this task. Tested manually on - Linux x86, x86_64, armhf (raspi) - Android intel and arm - Windows x86_64 - OSX x86_64
* gluegen: remove trailing whitespaceHarvey Harrison2013-10-171-23/+23
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* Fix Bug 749: Add Support for Solaris SPARC 32bitBritta Eckhardt2013-06-131-12/+17
|
* Fix Platform static initialization interdependencies w/ GlueGen native ↵Sven Gothel2012-06-181-7/+7
| | | | | | | | | | | | library loading Some Platform field declarations and it's static initialization has been delegated to it's new abstract super class PlatformPropsImpl to solve static initialization interdependencies w/ the GlueGen native library loading and it's derived information {@link #getMachineDescription()}, {@link #is32Bit()}, ..<br> This mechanism is preferred in this case to avoid synchronization and locking and allow better performance accessing the mentioned fields/methods.
* MachineDescriptor Static: Add Mac-OsX 32bit gcc4 special case with ↵Sven Gothel2011-10-241-0/+2
| | | | sizeof(long double) == 8
* gluegen-rt lib loading: Moved to Platform static init incl. ↵Sven Gothel2011-09-221-4/+23
| | | | | | | | | | | | | | | | TempJarCache.bootstrapNativeLib(..) usage - Moving to Platform solves former interdependencies between GlueGenJNILibLoader/Platform - TempJarCache is being setup w/ bootstraping the gluegen-rt native lib jar file. Interesting here is that when using Oracle's JRE w/ Applets/JNLP the current dbg output is: gluegen-rt: url-root http://risa/deployment/test/jau02s/jar/ gluegen-rt: nativeJarURL jar:http://risa/deployment/test/jau02s/jar/gluegen-rt-natives-linux-amd64.jar!/ gluegen-rt: nativeJar /home/sven/.java/deployment/cache/6.0/49/3c6d1e31-2c90f42e IE the JRE implementation already deduces the online link to the Applet/JNLP cache. This makes the implementation much simpler, ie. same for application and Applets/JNLP. Have to verify w/ other Java impl. sure - and add same logic for the JOGL part.
* Unify JNI Library Loading into JNILibLoaderBase and use it for the ↵Sven Gothel2011-09-211-2/+2
| | | | | | | | gluegen-rt native lib as well - removed redundance - move proper JNLPAppletLauncher custom libloader code into JNILibLoaderBase - prepares for new JAR temp cache ..
* Remove redundant: NativeLibrary.ensureNativeLibLoaded()Sven Gothel2011-09-201-1/+2
|
* Fix Android apk activity; Add apk VersionName; Add jar manifest to apkSven Gothel2011-07-281-1/+0
| | | | | | | | | | | | | | | | - build: - exclude android packages if !isAndroid - aapt: - Use individual AndroidManifest xml files - optional: incl. our JAR manifest file to support detailed version info - use def. GluegenVersionActivity - APK VersionName: Retrieve and show - package/extension names: - gluegen.jar/apk: com.jogamp.gluegen - gluegen-rt.jar/apk: com.jogamp.common
* Android: Remove native (fake) detectionSven Gothel2011-07-241-11/+0
|
* Android integration / cross-test ; Enhance PlatformSven Gothel2011-07-241-0/+12
| | | | | | | | | | | - android minor build fix - started dex'ing (gluegen-rt.apk, more to come for full junit tests) - android remote dalvikvm launch works (crosstest-java-android-armv7-rel.sh) - android detection, incl version (reflection) - Platform: - Add JAVA_VM_NAME and JAVA_VM_RUNIME - OSType maybe ANDROID, where the OS name (String) is Linux ! (ok ?)
* GlueGen proper size / alignment of primitive and compound types usage [2/2] ↵Sven Gothel2011-07-211-31/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | - Fin MachineDesction == MD MD.StaticConfig: - enum for all supported static configs (ID -> MD) - verified at runtime: test runtime queried-MD versus static-MD, hard fail if not compatible (size/alignment) SizeThunk primitive sizes: - Add notion of fixed native size (eg. int64_t) and otherwise (eg. long) java struct 'wrappers' code generation: - single class using size/offset arrays of all MachineDescription configurations - at runtime the array idx is queried in static block - type aligment for not fixed-native-size types (SizeThunk, undef long/int) via StructAccessor junit test: - add float test - fix native code - add java (create, write) -> native (verify) test works (tested) on: linux 32/64 and windows 32/64
* Cleanup: Platform CPU enum, MachineDescription,Sven Gothel2011-07-201-16/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Platform: - enum CPUFamily is part of CPUType - DALVIK -> ANDROID - ARM: ARM + ARMv[567] MachineDescription - self contained - static size/alignment Config (enum) for unix32, unix64, win32, win64 and armeabi - add 'long double' - Removed MachineDescription32Bit, MachineDescription64Bit - createStatic(..) uses OS/CPU to fetch best match if not at runtime FIXES: JavaEmitter's struct-emit: Proper 32/64 struct sizes TODO: StructAccessor's mapping to <Type>Buffer w/ index os sizeof(<Type>) doesn't work, since offset may not be multiple of sizeof(<Type>)! i.e. typedef struct { int8_t bits1; // +1 - 0 // +3 (p32) int32_t id; // +4 - 4 int8_t bits2; // +1 - 8 // +3 (p32) - int64_t long0; // +8 - 12 so "longBuffer.get(<type-sized index>)" is invalid, but "byteBuffer.getLong(<byte index>)" must be done. The actual impl. doesn't matter, hence dropping the other nio type mappings is good.
* GlueGen: Alignment Cleanup ..Sven Gothel2011-07-171-8/+4
| | | | | | | | | | - SizeThunk - rename: compute -> computeSize - add: computeAlignment - merge types: char -> int8, short -> int16 - 'int' and 'long' may differ -
* GlueGen proper size / alignment of primitive and compound types usage [1/2] ↵Sven Gothel2011-07-171-0/+120
- Preparation. Fix commit f733203dfbd034a6b1aa3eb2cd616437c982c435, adding missing file src/java/jogamp/common/os/MachineDescriptionRuntime.java