1 /*
2 * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 //
26 // C++ wrapper to HPI.
27 //
28
29 class hpi : AllStatic {
30
31 private:
32 static GetInterfaceFunc _get_interface;
33 static HPI_FileInterface* _file;
34 static HPI_SocketInterface* _socket;
35 static HPI_LibraryInterface* _library;
36 static HPI_SystemInterface* _system;
37
38 private:
39 static void initialize_get_interface(vm_calls_t *callbacks);
40
41 public:
42 // Load and initialize everything except sockets.
43 static jint initialize();
44
215 void *, "(void *)%p",
216 (const char *name, char *ebuf, int ebuflen),
217 ("name = %s, ebuf = %p, ebuflen = %d", name, ebuf, ebuflen),
218 (name, ebuf, ebuflen));
219
220 HPIDECL_VOID(dll_unload, "dll_unload", _library, UnloadLibrary,
221 (void *lib),
222 ("lib = %p", lib),
223 (lib));
224
225 HPIDECL(dll_lookup, "dll_lookup", _library, FindLibraryEntry, void *, "%p",
226 (void *lib, const char *name),
227 ("lib = %p, name = %s", lib, name),
228 (lib, name));
229
230 // HPI_SystemInterface
231 HPIDECL(lasterror, "lasterror", _system, GetLastErrorString, int, "%d",
232 (char *buf, int len),
233 ("buf = %p, len = %d", buf, len),
234 (buf, len));
|
1 /*
2 * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_RUNTIME_HPI_HPP
26 #define SHARE_VM_RUNTIME_HPI_HPP
27
28 #include "prims/hpi_imported.h"
29 #include "runtime/os.hpp"
30 #include "utilities/globalDefinitions.hpp"
31 #include "utilities/top.hpp"
32
33 //
34 // C++ wrapper to HPI.
35 //
36
37 class hpi : AllStatic {
38
39 private:
40 static GetInterfaceFunc _get_interface;
41 static HPI_FileInterface* _file;
42 static HPI_SocketInterface* _socket;
43 static HPI_LibraryInterface* _library;
44 static HPI_SystemInterface* _system;
45
46 private:
47 static void initialize_get_interface(vm_calls_t *callbacks);
48
49 public:
50 // Load and initialize everything except sockets.
51 static jint initialize();
52
223 void *, "(void *)%p",
224 (const char *name, char *ebuf, int ebuflen),
225 ("name = %s, ebuf = %p, ebuflen = %d", name, ebuf, ebuflen),
226 (name, ebuf, ebuflen));
227
228 HPIDECL_VOID(dll_unload, "dll_unload", _library, UnloadLibrary,
229 (void *lib),
230 ("lib = %p", lib),
231 (lib));
232
233 HPIDECL(dll_lookup, "dll_lookup", _library, FindLibraryEntry, void *, "%p",
234 (void *lib, const char *name),
235 ("lib = %p, name = %s", lib, name),
236 (lib, name));
237
238 // HPI_SystemInterface
239 HPIDECL(lasterror, "lasterror", _system, GetLastErrorString, int, "%d",
240 (char *buf, int len),
241 ("buf = %p, len = %d", buf, len),
242 (buf, len));
243
244 #endif // SHARE_VM_RUNTIME_HPI_HPP
|