hotspot/src/share/vm/runtime/hpi.hpp
author xdono
Tue, 28 Jul 2009 12:12:40 -0700
changeset 3261 c7d5aae8d3f7
parent 2358 7c8346929fc6
child 5547 f4b087cbb361
permissions -rw-r--r--
6862919: Update copyright year Summary: Update copyright for files that have been modified in 2009, up to 07/09 Reviewed-by: tbell, ohair
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
3261
c7d5aae8d3f7 6862919: Update copyright year
xdono
parents: 2358
diff changeset
     2
 * Copyright 1998-2009 Sun Microsystems, Inc.  All Rights Reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    19
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    20
 * CA 95054 USA or visit www.sun.com if you need additional information or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    21
 * have any questions.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
// C++ wrapper to HPI.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
class hpi : AllStatic {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
  static GetInterfaceFunc       _get_interface;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
  static HPI_FileInterface*     _file;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
  static HPI_SocketInterface*   _socket;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
  static HPI_LibraryInterface*  _library;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
  static HPI_SystemInterface*   _system;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
  static void initialize_get_interface(vm_calls_t *callbacks);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
  // Load and initialize everything except sockets.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
  static jint initialize();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
  // Socket library needs to be lazy intialized because eagerly
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
  // loading Winsock is known to cause "connect to your ISP"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
  // dialog to show up.  Or so goes the legend.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
  static jint initialize_socket_library();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
  // HPI_FileInterface
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
  static inline char*  native_path(char *path);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
  static inline int    file_type(const char *path);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
  static inline int    open(const char *name, int mode, int perm);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
  static inline int    close(int fd);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
  static inline jlong  lseek(int fd, jlong off, int whence);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
  static inline int    ftruncate(int fd, jlong length);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
  static inline int    fsync(int fd);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
  static inline int    available(int fd, jlong *bytes);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
  static inline size_t read(int fd, void *buf, unsigned int nBytes);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
  static inline size_t write(int fd, const void *buf, unsigned int nBytes);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
  static inline int    fsize(int fd, jlong *size);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
  // HPI_SocketInterface
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
  static inline int    socket(int domain, int type, int protocol);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
  static inline int    socket_close(int fd);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
  static inline int    socket_shutdown(int fd, int howto);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
  static inline int    recv(int fd, char *buf, int nBytes, int flags);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
  static inline int    send(int fd, char *buf, int nBytes, int flags);
768
d0bebc7eefc2 6718676: putback for 6604014 is incomplete
never
parents: 1
diff changeset
    69
  // Variant of send that doesn't support interruptible I/O
d0bebc7eefc2 6718676: putback for 6604014 is incomplete
never
parents: 1
diff changeset
    70
  static inline int    raw_send(int fd, char *buf, int nBytes, int flags);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  static inline int    timeout(int fd, long timeout);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
  static inline int    listen(int fd, int count);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
  static inline int    connect(int fd, struct sockaddr *him, int len);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
  static inline int    bind(int fd, struct sockaddr *him, int len);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
  static inline int    accept(int fd, struct sockaddr *him, int *len);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
  static inline int    recvfrom(int fd, char *buf, int nbytes, int flags,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
                                struct sockaddr *from, int *fromlen);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
  static inline int    get_sock_name(int fd, struct sockaddr *him, int *len);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
  static inline int    sendto(int fd, char *buf, int len, int flags,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
                              struct sockaddr *to, int tolen);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
  static inline int    socket_available(int fd, jint *pbytes);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
  static inline int    get_sock_opt(int fd, int level, int optname,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
                              char *optval, int* optlen);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  static inline int    set_sock_opt(int fd, int level, int optname,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
                              const char *optval, int optlen);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
  static inline int    get_host_name(char* name, int namelen);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
  static inline struct hostent*  get_host_by_addr(const char* name, int len, int type);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
  static inline struct hostent*  get_host_by_name(char* name);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
  static inline struct protoent* get_proto_by_name(char* name);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
  // HPI_LibraryInterface
2358
7c8346929fc6 6819213: revive sun.boot.library.path
phh
parents: 768
diff changeset
    93
  static inline void   dll_build_name(char *buf, int buf_len, const char* path,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
                                      const char *name);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
  static inline void*  dll_load(const char *name, char *ebuf, int ebuflen);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
  static inline void   dll_unload(void *lib);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
  static inline void*  dll_lookup(void *lib, const char *name);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
  // HPI_SystemInterface
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
  static inline int    lasterror(char *buf, int len);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
// Macros that provide inline bodies for the functions.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
#define HPIDECL(name, names, intf, func, ret_type, ret_fmt, arg_type, arg_print, arg)   \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
  inline ret_type hpi::name arg_type {        \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
    if (TraceHPI) {                           \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
      tty->print("hpi::" names "(");          \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
      tty->print arg_print ;                  \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
      tty->print(") = ");                     \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
    }                                         \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
    ret_type result = (*intf->func) arg ;     \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
    if (TraceHPI) {                           \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
      tty->print_cr(ret_fmt, result);         \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
    }                                         \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
    return result;                            \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
// Macro to facilitate moving HPI functionality into the vm.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
// See bug 6348631.  The only difference between this macro and
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
// HPIDECL is that we call a vm method rather than use the HPI
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
// transfer vector.  Ultimately, we'll replace HPIDECL with
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
// VM_HPIDECL for all hpi methods.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
#define VM_HPIDECL(name, names, func, ret_type, ret_fmt, arg_type,arg_print, arg)   \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
  inline ret_type hpi::name arg_type {        \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
    if (TraceHPI) {                           \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
      tty->print("hpi::" names "(");          \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
      tty->print arg_print ;                  \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
      tty->print(") = ");                     \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
    }                                         \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
    ret_type result = func arg ;              \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
    if (TraceHPI) {                           \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
      tty->print_cr(ret_fmt, result);         \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
    }                                         \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
    return result;                            \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
2358
7c8346929fc6 6819213: revive sun.boot.library.path
phh
parents: 768
diff changeset
   140
#define VM_HPIDECL_VOID(name, names, func, arg_type, arg_print, arg)   \
7c8346929fc6 6819213: revive sun.boot.library.path
phh
parents: 768
diff changeset
   141
  inline void  hpi::name arg_type {           \
7c8346929fc6 6819213: revive sun.boot.library.path
phh
parents: 768
diff changeset
   142
    if (TraceHPI) {                           \
7c8346929fc6 6819213: revive sun.boot.library.path
phh
parents: 768
diff changeset
   143
      tty->print("hpi::" names "(");          \
7c8346929fc6 6819213: revive sun.boot.library.path
phh
parents: 768
diff changeset
   144
      tty->print arg_print;                   \
7c8346929fc6 6819213: revive sun.boot.library.path
phh
parents: 768
diff changeset
   145
      tty->print(") = ");                     \
7c8346929fc6 6819213: revive sun.boot.library.path
phh
parents: 768
diff changeset
   146
    }                                         \
7c8346929fc6 6819213: revive sun.boot.library.path
phh
parents: 768
diff changeset
   147
    func arg;                                 \
7c8346929fc6 6819213: revive sun.boot.library.path
phh
parents: 768
diff changeset
   148
  }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
#define HPIDECL_VOID(name, names, intf, func, arg_type, arg_print, arg) \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
  inline void hpi::name arg_type {            \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
    if (TraceHPI) {                           \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
      tty->print("hpi::" names "(");          \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
      tty->print arg_print ;                  \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
      tty->print_cr(") = void");              \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
    }                                         \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
    (*intf->func) arg ;                       \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
// The macro calls below realize into
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
//          inline char * hpi::native_path(...) {  inlined_body; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
// etc.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
// HPI_FileInterface
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
HPIDECL(native_path, "native_path", _file, NativePath, char *, "%s",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
        (char *path),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
        ("path = %s", path),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
        (path));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
HPIDECL(file_type, "file_type", _file, FileType, int, "%d",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
        (const char *path),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
        ("path = %s", path),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
        (path));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
HPIDECL(open, "open", _file, Open, int, "%d",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
        (const char *name, int mode, int perm),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
        ("name = %s, mode = %d, perm = %d", name, mode, perm),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
        (name, mode, perm));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
HPIDECL(lseek, "seek", _file, Seek, jlong, "(a jlong)",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
        (int fd, jlong off, int whence),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
        ("fd = %d, off = (a jlong), whence = %d", fd, /* off, */ whence),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
        (fd, off, whence));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
HPIDECL(ftruncate, "ftruncate", _file, SetLength, int, "%d",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
        (int fd, jlong length),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
        ("fd = %d, length = (a jlong)", fd /*, length */),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
        (fd, length));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
HPIDECL(fsync, "fsync", _file, Sync, int, "%d",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
        (int fd),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
        ("fd = %d", fd),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
        (fd));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
HPIDECL(available, "available", _file, Available, int, "%d",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
        (int fd, jlong *bytes),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
        ("fd = %d, bytes = %p", fd, bytes),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
        (fd, bytes));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
HPIDECL(fsize, "fsize", _file, FileSizeFD, int, "%d",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
        (int fd, jlong *size),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
        ("fd = %d, size = %p", fd, size),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
        (fd, size));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
// HPI_LibraryInterface
2358
7c8346929fc6 6819213: revive sun.boot.library.path
phh
parents: 768
diff changeset
   208
VM_HPIDECL_VOID(dll_build_name, "dll_build_name", os::dll_build_name,
7c8346929fc6 6819213: revive sun.boot.library.path
phh
parents: 768
diff changeset
   209
               (char *buf, int buf_len, const char *path, const char *name),
7c8346929fc6 6819213: revive sun.boot.library.path
phh
parents: 768
diff changeset
   210
               ("buf = %p, buflen = %d, path = %s, name = %s",
7c8346929fc6 6819213: revive sun.boot.library.path
phh
parents: 768
diff changeset
   211
                buf, buf_len, path, name),
7c8346929fc6 6819213: revive sun.boot.library.path
phh
parents: 768
diff changeset
   212
               (buf, buf_len, path, name));
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
VM_HPIDECL(dll_load, "dll_load", os::dll_load,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
        void *, "(void *)%p",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
        (const char *name, char *ebuf, int ebuflen),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
        ("name = %s, ebuf = %p, ebuflen = %d", name, ebuf, ebuflen),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
        (name, ebuf, ebuflen));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
HPIDECL_VOID(dll_unload, "dll_unload", _library, UnloadLibrary,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
             (void *lib),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
             ("lib = %p", lib),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
             (lib));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
HPIDECL(dll_lookup, "dll_lookup", _library, FindLibraryEntry, void *, "%p",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
        (void *lib, const char *name),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
        ("lib = %p, name = %s", lib, name),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
        (lib, name));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
// HPI_SystemInterface
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
HPIDECL(lasterror, "lasterror", _system, GetLastErrorString, int, "%d",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
        (char *buf, int len),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
        ("buf = %p, len = %d", buf, len),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
        (buf, len));