48 #ifdef TARGET_OS_FAMILY_bsd |
48 #ifdef TARGET_OS_FAMILY_bsd |
49 # include "jvm_bsd.h" |
49 # include "jvm_bsd.h" |
50 # include <setjmp.h> |
50 # include <setjmp.h> |
51 #endif |
51 #endif |
52 |
52 |
|
53 class AgentLibrary; |
|
54 |
53 // os defines the interface to operating system; this includes traditional |
55 // os defines the interface to operating system; this includes traditional |
54 // OS services (time, I/O) as well as other functionality with system- |
56 // OS services (time, I/O) as well as other functionality with system- |
55 // dependent code. |
57 // dependent code. |
56 |
58 |
57 typedef void (*dll_func)(...); |
59 typedef void (*dll_func)(...); |
330 static bool get_page_info(char *start, page_info* info); |
332 static bool get_page_info(char *start, page_info* info); |
331 static char* scan_pages(char *start, char* end, page_info* page_expected, page_info* page_found); |
333 static char* scan_pages(char *start, char* end, page_info* page_expected, page_info* page_found); |
332 |
334 |
333 static char* non_memory_address_word(); |
335 static char* non_memory_address_word(); |
334 // reserve, commit and pin the entire memory region |
336 // reserve, commit and pin the entire memory region |
335 static char* reserve_memory_special(size_t size, char* addr = NULL, |
337 static char* reserve_memory_special(size_t size, size_t alignment, |
336 bool executable = false); |
338 char* addr, bool executable); |
337 static bool release_memory_special(char* addr, size_t bytes); |
339 static bool release_memory_special(char* addr, size_t bytes); |
338 static void large_page_init(); |
340 static void large_page_init(); |
339 static size_t large_page_size(); |
341 static size_t large_page_size(); |
340 static bool can_commit_large_page_memory(); |
342 static bool can_commit_large_page_memory(); |
341 static bool can_execute_large_page_memory(); |
343 static bool can_execute_large_page_memory(); |
539 static void* dll_lookup(void* handle, const char* name); |
541 static void* dll_lookup(void* handle, const char* name); |
540 |
542 |
541 // Unload library |
543 // Unload library |
542 static void dll_unload(void *lib); |
544 static void dll_unload(void *lib); |
543 |
545 |
|
546 // Return the handle of this process |
|
547 static void* get_default_process_handle(); |
|
548 |
|
549 // Check for static linked agent library |
|
550 static bool find_builtin_agent(AgentLibrary *agent_lib, const char *syms[], |
|
551 size_t syms_len); |
|
552 |
|
553 // Find agent entry point |
|
554 static void *find_agent_function(AgentLibrary *agent_lib, bool check_lib, |
|
555 const char *syms[], size_t syms_len); |
|
556 |
544 // Print out system information; they are called by fatal error handler. |
557 // Print out system information; they are called by fatal error handler. |
545 // Output format may be different on different platforms. |
558 // Output format may be different on different platforms. |
546 static void print_os_info(outputStream* st); |
559 static void print_os_info(outputStream* st); |
547 static void print_os_info_brief(outputStream* st); |
560 static void print_os_info_brief(outputStream* st); |
548 static void print_cpu_info(outputStream* st); |
561 static void print_cpu_info(outputStream* st); |
814 // Used at creation if requested by the diagnostic flag PauseAtStartup. |
827 // Used at creation if requested by the diagnostic flag PauseAtStartup. |
815 // Causes the VM to wait until an external stimulus has been applied |
828 // Causes the VM to wait until an external stimulus has been applied |
816 // (for Unix, that stimulus is a signal, for Windows, an external |
829 // (for Unix, that stimulus is a signal, for Windows, an external |
817 // ResumeThread call) |
830 // ResumeThread call) |
818 static void pause(); |
831 static void pause(); |
|
832 |
|
833 // Builds a platform dependent Agent_OnLoad_<libname> function name |
|
834 // which is used to find statically linked in agents. |
|
835 static char* build_agent_function_name(const char *sym, const char *cname, |
|
836 bool is_absolute_path); |
819 |
837 |
820 class SuspendedThreadTaskContext { |
838 class SuspendedThreadTaskContext { |
821 public: |
839 public: |
822 SuspendedThreadTaskContext(Thread* thread, void *ucontext) : _thread(thread), _ucontext(ucontext) {} |
840 SuspendedThreadTaskContext(Thread* thread, void *ucontext) : _thread(thread), _ucontext(ucontext) {} |
823 Thread* thread() const { return _thread; } |
841 Thread* thread() const { return _thread; } |