27 #ifndef WITH_JAVA_RUNTIME_LIBRARY_OPENJDK_7
74 const char* boot_library_path = properties.
get(
"sun.boot.library.path");
79 buf.
write(boot_library_path);
80 buf.
write(
"/native_threads/libhpi.so");
88 void* handle = nl.open();
92 os::abort(
"HPI::initialize: HPI open failed");
95 void* dll_initialize =
os::dlsym(handle,
"DLL_Initialize");
97 jint (JNICALL *DLL_Initialize)(GetInterfaceFunc*,
void*);
98 DLL_Initialize = (jint (JNICALL *)(GetInterfaceFunc*,
void*)) (uintptr_t) dll_initialize;
105 vm_abort(
"hpi_init: HPI DLL_Initialize failed");
112 log_println(
"HPI::initialize: HPI loaded successfully");
121 result = (*_get_interface)((
void**) (uintptr_t) &
_file,
"File", 1);
124 os::abort(
"hpi_init: Can't find HPI_FileInterface");
126 result = (*_get_interface)((
void**) (uintptr_t) &
_library,
"Library", 1);
129 os::abort(
"hpi_init: Can't find HPI_LibraryInterface");
131 result = (*_get_interface)((
void**) (uintptr_t) &
_system,
"System", 1);
134 os::abort(
"hpi_init: Can't find HPI_SystemInterface");
144 int result = (*_get_interface)((
void**) (uintptr_t) &
_socket,
"Socket", 1);
148 log_println(
"HPI::initialize_socket_library: Can't find HPI_SocketInterface");
HPI_SystemInterface * _system
Utf8String utf8_str()
get utf-8 string contents of buffer as utf8-string
HPI()
Initialize the Host Porting Interface (HPI).
const char * c_str()
get contents of buffer as zero-terminated c-style-string This strings lifetime is tied to it's buffer...
void log_println(const char *text,...)
#define TRACESUBSYSTEMINITIALIZATION(text)
void vm_abort(const char *text,...)
HPI_LibraryInterface * _library
static void * dlsym(void *handle, const char *symbol)
NativeLibraries & get_nativelibraries()
static vm_calls_t callbacks
HPI_FileInterface * _file
static char * dlerror(void)
Properties & get_properties()
GetInterfaceFunc _get_interface
Represents a native library.
void add(NativeLibrary &library)
Add the given native library to the native libraries table.
Table containing all loaded native libraries.
HPI_SocketInterface * _socket
int initialize_socket_library()
Initialize the Host Porting Interface (HPI) socket library.
const char * get(const char *key)
Get a property entry from the internal property map.
Represent an instance of a VM.
static VM * get_current()