1.1 --- a/src/share/vm/runtime/os.hpp Wed Aug 06 11:57:31 2008 -0400 1.2 +++ b/src/share/vm/runtime/os.hpp Thu Aug 21 23:36:31 2008 -0400 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. 1.6 + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -205,7 +205,11 @@ 1.11 static bool commit_memory(char* addr, size_t size, size_t alignment_hint); 1.12 static bool uncommit_memory(char* addr, size_t bytes); 1.13 static bool release_memory(char* addr, size_t bytes); 1.14 - static bool protect_memory(char* addr, size_t bytes); 1.15 + 1.16 + enum ProtType { MEM_PROT_NONE, MEM_PROT_READ, MEM_PROT_RW, MEM_PROT_RWX }; 1.17 + static bool protect_memory(char* addr, size_t bytes, ProtType prot, 1.18 + bool is_committed = false); 1.19 + 1.20 static bool guard_memory(char* addr, size_t bytes); 1.21 static bool unguard_memory(char* addr, size_t bytes); 1.22 static char* map_memory(int fd, const char* file_name, size_t file_offset, 1.23 @@ -398,6 +402,10 @@ 1.24 static const char* get_temp_directory(); 1.25 static const char* get_current_directory(char *buf, int buflen); 1.26 1.27 + // Builds a platform-specific full library path given a ld path and lib name 1.28 + static void dll_build_name(char* buffer, size_t size, 1.29 + const char* pathname, const char* fname); 1.30 + 1.31 // Symbol lookup, find nearest function name; basically it implements 1.32 // dladdr() for all platforms. Name of the nearest function is copied 1.33 // to buf. Distance from its base address is returned as offset. 1.34 @@ -421,6 +429,9 @@ 1.35 // same architecture as Hotspot is running on 1.36 static void* dll_load(const char *name, char *ebuf, int ebuflen); 1.37 1.38 + // lookup symbol in a shared library 1.39 + static void* dll_lookup(void* handle, const char* name); 1.40 + 1.41 // Print out system information; they are called by fatal error handler. 1.42 // Output format may be different on different platforms. 1.43 static void print_os_info(outputStream* st);