From harmony-commits-return-280-apmail-incubator-harmony-commits-archive=incubator.apache.org@incubator.apache.org Thu Dec 01 06:18:20 2005 Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 47079 invoked from network); 1 Dec 2005 06:18:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Dec 2005 06:18:17 -0000 Received: (qmail 99626 invoked by uid 500); 1 Dec 2005 06:15:22 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 98564 invoked by uid 500); 1 Dec 2005 06:13:27 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 97963 invoked by uid 99); 1 Dec 2005 06:12:42 -0000 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 30 Nov 2005 22:11:20 -0800 Received: (qmail 43610 invoked by uid 65534); 1 Dec 2005 06:10:58 -0000 Message-ID: <20051201061058.43609.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r350181 [37/198] - in /incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core: ./ depends/ depends/files/ depends/jars/ depends/libs/ depends/libs/linux.IA32/ depends/libs/win.IA32/ depends/oss/ depends/oss/linux.IA32/ depends/oss/win.I... Date: Thu, 01 Dec 2005 06:04:00 -0000 To: harmony-commits@incubator.apache.org From: geirm@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/doc/vm_doc/html/hygp_8c.html URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/doc/vm_doc/html/hygp_8c.html?rev=350181&view=auto ============================================================================== --- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/doc/vm_doc/html/hygp_8c.html (added) +++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/doc/vm_doc/html/hygp_8c.html Wed Nov 30 21:29:27 2005 @@ -0,0 +1,369 @@ + + +Harmony Class Library Porting: native-src/win.IA32/port/hygp.c File Reference + + + + + +

hygp.c File Reference


Detailed Description

+Provides platform-neutral signal handling functions. +

+The hygp_register_handler function is partially dependent on internal VM structures, and must be called with NULL as a third (userData) parameter.
+
+ +

+#include "hyport.h"
+#include "hycomp.h"
+#include "gp.h"
+ + + + + + + + + + + + + + + + + + + + + +

Functions

UDATA VMCALL hygp_protect (struct HyPortLibrary *portLibrary, protected_fn fn, void *arg)
 Kicks off the new thread by calling the function provided in protected_fn fn.
void VMCALL hygp_register_handler (struct HyPortLibrary *portLibrary, handler_fn fn, void *aUserData)
 Sets the function that is responsible for preserving/outputting the state of the vm and initiating a graceful shutdown resulting from a gp.
U_32 VMCALL hygp_info (struct HyPortLibrary *portLibrary, void *info, U_32 category, I_32 index, const char **name, void **value)
 Provides the name and value, specified by category/index of the gp information in info.
U_32 VMCALL hygp_info_count (struct HyPortLibrary *portLibrary, void *info, U_32 category)
 Returns the number of items that exist in the category specified, or zero if the category is undefined.
void VMCALL hygp_shutdown (struct HyPortLibrary *portLibrary)
 PortLibrary shutdown.
I_32 VMCALL hygp_startup (struct HyPortLibrary *portLibrary)
 PortLibrary startup.
+


Function Documentation

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
U_32 VMCALL hygp_info struct HyPortLibrary portLibrary,
void *  info,
U_32  category,
I_32  index,
const char **  name,
void **  value
+
+ + + + + +
+   + + +

+Provides the name and value, specified by category/index of the gp information in info. +

+Returns the kind of information found at category/index specified, or undefined if the category/index are invalid. The number of items in the category specified must equal the count hygp_info_count returns for that category.

+

Parameters:
+ + + + + + + +
[in] portLibrary The port library
[in] info struct containing all available signal information. Normally includes register values, name of module where crash occured and its base address.
[in] category the category of signal information that you are querying.
[in] index the index of the item in the specified category. The number of items for each category are defined in the sourceTemplate.
[out] name the name of the item at the specified index.
[out] value the value of the item at the specified index
+
+
Returns:
the kind of info at the specified index. For example, this allows the caller to determine whether the item placed in **value corresponds to a 32/64-bit integer or a pointer to a string.
+
Note:
The program counter and module name also have negative indexes as defined by HYGP_CONTROL_PC and HYGP_MODULE_NAME respectively.

+Above allows the handler function registered in hygp_register_handler to distinguish (and use) them from the other gp items.

+The caller is responsible for allocating and freeing any buffers used by **name, **value.

+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
U_32 VMCALL hygp_info_count struct HyPortLibrary portLibrary,
void *  info,
U_32  category
+
+ + + + + +
+   + + +

+Returns the number of items that exist in the category specified, or zero if the category is undefined. +

+

Parameters:
+ + + + +
[in] portLibrary The port library
[in] info struct containing all available signal information. Normally includes register values, name of module where crash occured and its base address.
[in] category the category in which we want to find the number of items that exist.
+
+
Note:
Return value must agree with the number of items that hygp_info makes available for the category specified.
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
UDATA VMCALL hygp_protect struct HyPortLibrary portLibrary,
protected_fn  fn,
void *  arg
+
+ + + + + +
+   + + +

+Kicks off the new thread by calling the function provided in protected_fn fn. +

+All threads spawned by the vm start here and all OS signals that will be handled by fn must be registered to the OS here. Upon receiving a signal from the OS, fn is responsible for calling the function specified in hygp_register_handler if it is determined that a shutdown is required.

+

Parameters:
+ + + + +
[in] portLibrary The port library
[in] fn the function that will be used to kick off the thread
[in] arg arguments to protected_fn fn
+
+
Returns:
the return value of the function provided in fn
+
Note:
it is a good idea to save the portLibrary in case a registered exception handler cannot be found
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void VMCALL hygp_register_handler struct HyPortLibrary portLibrary,
handler_fn  fn,
void *  aUserData
+
+ + + + + +
+   + + +

+Sets the function that is responsible for preserving/outputting the state of the vm and initiating a graceful shutdown resulting from a gp. +

+

Parameters:
+ + + + +
[in] portLibrary The port library
[in] fn function responsible for preserving/outputting the state of the vm and initiating a graceful shutdown resulting from a gp.
[in] aUserData The HyJavaVM or NULL for non-HY consumers.
+
+
Note:
vmGPHandler in gphandle.c is currently the only function used for handling gps.

+fn is not called by the OS but by the gp handler function specified in the call to hygp_protect gp module

+above occurs after the OS has passed a signal along to us and it is determined that a shutdown is required.

+
+

+ + + + +
+ + + + + + + + + +
void VMCALL hygp_shutdown struct HyPortLibrary portLibrary  ) 
+
+ + + + + +
+   + + +

+PortLibrary shutdown. +

+This function is called during shutdown of the portLibrary. Any resources that were created by hygp_startup should be destroyed here.

+

Parameters:
+ + +
[in] portLibrary The port library
+
+
Note:
Most implementations will be empty.
+
+

+ + + + +
+ + + + + + + + + +
I_32 VMCALL hygp_startup struct HyPortLibrary portLibrary  ) 
+
+ + + + + +
+   + + +

+PortLibrary startup. +

+This function is called during startup of the portLibrary. Any resources that are required for the shared library operation may be created here. All resources created here should be destroyed in hygp_shutdown.

+

Parameters:
+ + +
[in] portLibrary The port library
+
+
Returns:
0 on success, negative error code on failure. Error code values returned are
    +
  • HYPORT_ERROR_STARTUP_GP
  • +
+
+
Note:
Most implementations will simply return success.
+
+


+
+ + (c) Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + +
+ + Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/doc/vm_doc/html/hyipcmutex_8c.html URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/doc/vm_doc/html/hyipcmutex_8c.html?rev=350181&view=auto ============================================================================== --- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/doc/vm_doc/html/hyipcmutex_8c.html (added) +++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/doc/vm_doc/html/hyipcmutex_8c.html Wed Nov 30 21:29:27 2005 @@ -0,0 +1,215 @@ + + +Harmony Class Library Porting: native-src/win.IA32/port/hyipcmutex.c File Reference + + + + + +

hyipcmutex.c File Reference


Detailed Description

+Shared Resource Mutex. +

+The HYIPCMutex is used to protect a shared resource from simultaneous access by processes or threads executing in the same or different VMs. Each process/thread must request and wait for the ownership of the shared resource before it can use that resource. It must also release the ownership of the resource as soon as it has finished using it so that other processes competing for the same resource are not delayed. +

+#include <windows.h>
+#include "hyport.h"
+ + + + + + + + + + + + + + + +

Functions

I_32 VMCALL hyipcmutex_acquire (struct HyPortLibrary *portLibrary, const char *name)
 Acquires a named mutex for the calling process.
I_32 VMCALL hyipcmutex_release (struct HyPortLibrary *portLibrary, const char *name)
 Releases a named Mutex from the calling process.
void VMCALL hyipcmutex_shutdown (struct HyPortLibrary *portLibrary)
 PortLibrary shutdown.
I_32 VMCALL hyipcmutex_startup (struct HyPortLibrary *portLibrary)
 PortLibrary startup.
+


Function Documentation

+

+ + + + +
+ + + + + + + + + + + + + + + + + + +
I_32 VMCALL hyipcmutex_acquire struct HyPortLibrary portLibrary,
const char *  name
+
+ + + + + +
+   + + +

+Acquires a named mutex for the calling process. +

+If a Mutex with the same Name already exists, the function opens the existing Mutex and tries to lock it. If another process already has the Mutex locked, the function will block indefinetely. If there is no Mutex with the same Name, the function will create it and lock it for the calling process of this function.

+

Parameters:
+ + + +
[in] portLibrary The port library
[in] name Mutex to be acquired
+
+
Returns:
0 on success, -1 on error.
+
Note:
The Mutex must be explicitly released by calling the hyipcmutex_release function as soon as the lock is no longer required.
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + +
I_32 VMCALL hyipcmutex_release struct HyPortLibrary portLibrary,
const char *  name
+
+ + + + + +
+   + + +

+Releases a named Mutex from the calling process. +

+If a Mutex with the same Name already exists, the function opens the existing Mutex and tries to unlock it. This function will fail if a Mutex with the given Name is not found or if the Mutex cannot be unlocked.

+

Parameters:
+ + + +
[in] portLibrary The port library
[in] name Mutex to be released.
+
+
Returns:
0 on success, -1 on error.
+
Note:
Callers of this function must have called the function hyipcmutex_acquire prior to calling this function.
+
+

+ + + + +
+ + + + + + + + + +
void VMCALL hyipcmutex_shutdown struct HyPortLibrary portLibrary  ) 
+
+ + + + + +
+   + + +

+PortLibrary shutdown. +

+This function is called during shutdown of the portLibrary. Any resources that were created by hyipcmutex_startup should be destroyed here.

+

Parameters:
+ + +
[in] portLibrary The port library
+
+
Note:
Most implementations will be empty.
+
+

+ + + + +
+ + + + + + + + + +
I_32 VMCALL hyipcmutex_startup struct HyPortLibrary portLibrary  ) 
+
+ + + + + +
+   + + +

+PortLibrary startup. +

+This function is called during startup of the portLibrary. Any resources that are required for the IPC mutex operations may be created here. All resources created here should be destroyed in hyipcmutex_shutdown.

+

Parameters:
+ + +
[in] portLibrary The port library
+
+
Returns:
0 on success, negative error code on failure. Error code values returned are
    +
  • HYPORT_ERROR_STARTUP_IPCMUTEX
  • +
+
+
Note:
Most implementations will simply return success.
+
+


+
+ + (c) Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + +
+ + Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/doc/vm_doc/html/hymem_8c.html URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/doc/vm_doc/html/hymem_8c.html?rev=350181&view=auto ============================================================================== --- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/doc/vm_doc/html/hymem_8c.html (added) +++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/doc/vm_doc/html/hymem_8c.html Wed Nov 30 21:29:27 2005 @@ -0,0 +1,338 @@ + + +Harmony Class Library Porting: native-src/win.IA32/port/hymem.c File Reference + + + + + +

hymem.c File Reference


Detailed Description

+Memory Utilities. +

+ +

+#include <windows.h>
+#include "hyport.h"
+#include "portpriv.h"
+#include "hyportpg.h"
+#include "ut_hyprt.h"
+ + + + + + + + + + + + + + + + + + + + + +

Functions

void *VMCALL hymem_allocate_memory (struct HyPortLibrary *portLibrary, UDATA byteAmount)
 Allocate memory.
void VMCALL hymem_free_memory (struct HyPortLibrary *portLibrary, void *memoryPointer)
 Deallocate memory.
void *VMCALL hymem_reallocate_memory (struct HyPortLibrary *portLibrary, void *memoryPointer, UDATA byteAmount)
 Re-allocate memory.
void VMCALL hymem_shutdown (struct HyPortLibrary *portLibrary)
 PortLibrary shutdown.
I_32 VMCALL hymem_startup (struct HyPortLibrary *portLibrary, UDATA portGlobalSize)
 PortLibrary startup.
void *VMCALL hymem_allocate_memory_callSite (struct HyPortLibrary *portLibrary, UDATA byteAmount, char *callSite)
 Allocate memory.
+


Function Documentation

+

+ + + + +
+ + + + + + + + + + + + + + + + + + +
void* VMCALL hymem_allocate_memory struct HyPortLibrary portLibrary,
UDATA  byteAmount
+
+ + + + + +
+   + + +

+Allocate memory. +

+

Parameters:
+ + + +
[in] portLibrary The port library
[in] byteAmount Number of bytes to allocate.
+
+
Returns:
pointer to memory on success, NULL on error.

+Memory is not guaranteed to be zeroed as part of this call

+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void* VMCALL hymem_allocate_memory_callSite struct HyPortLibrary portLibrary,
UDATA  byteAmount,
char *  callSite
+
+ + + + + +
+   + + +

+Allocate memory. +

+

Parameters:
+ + + + +
[in] portLibrary The port library
[in] byteAmount Number of bytes to allocate.
[in] callSite String describing callsite, usually file and line number.
+
+
Returns:
pointer to memory on success, NULL on error.
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + +
void VMCALL hymem_free_memory struct HyPortLibrary portLibrary,
void *  memoryPointer
+
+ + + + + +
+   + + +

+Deallocate memory. +

+

Parameters:
+ + + +
[in] portLibrary The port library
[in] memoryPointer Base address of memory to be deallocated.
+
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void* VMCALL hymem_reallocate_memory struct HyPortLibrary portLibrary,
void *  memoryPointer,
UDATA  byteAmount
+
+ + + + + +
+   + + +

+Re-allocate memory. +

+

Parameters:
+ + + + +
[in] portLibrary The port library
[in] memoryPointer Base address of memory to be re-allocated.
[in] byteAmount Number of bytes to re-allocated.
+
+
Returns:
pointer to memory on success, NULL on error.
+
+

+ + + + +
+ + + + + + + + + +
void VMCALL hymem_shutdown struct HyPortLibrary portLibrary  ) 
+
+ + + + + +
+   + + +

+PortLibrary shutdown. +

+This function is called during shutdown of the portLibrary. Any resources that were created by hymem_startup should be destroyed here.

+

Parameters:
+ + +
[in] portLibrary The port library
+
+
Note:
Must deallocate portGlobals.

+Most implementations will just deallocate portGlobals.

+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + +
I_32 VMCALL hymem_startup struct HyPortLibrary portLibrary,
UDATA  portGlobalSize
+
+ + + + + +
+   + + +

+PortLibrary startup. +

+This function is called during startup of the portLibrary. Any resources that are required for the memory operations may be created here. All resources created here should be destroyed in hymem_shutdown.

+

Parameters:
+ + + +
[in] portLibrary The port library
[in] portGlobalSize Size of the global data structure to allocate
+
+
Returns:
0 on success, negative error code on failure. Error code values returned are
    +
  • HYPORT_ERROR_STARTUP_MEM
  • +
+
+
Note:
Must allocate portGlobals.

+Most implementations will just allocate portGlobals.

+
+


+
+ + (c) Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + +
+ + Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/doc/vm_doc/html/hymmap_8c.html URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/doc/vm_doc/html/hymmap_8c.html?rev=350181&view=auto ============================================================================== --- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/doc/vm_doc/html/hymmap_8c.html (added) +++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/doc/vm_doc/html/hymmap_8c.html Wed Nov 30 21:29:27 2005 @@ -0,0 +1,254 @@ + + +Harmony Class Library Porting: native-src/win.IA32/port/hymmap.c File Reference + + + + + +

hymmap.c File Reference


Detailed Description

+Memory map. +

+This module provides memory mapping facilities that allow a user to map files into the virtual address space of the process. There are various options that can be used when mapping a file into memory, such as copy on write. Not all of these options are available on all platforms, hymmap_capabilities provides the list of supported options. Note also that on some platforms memory mapping facilites do not exist at all. On these platforms the API will still be available, but will simply read the file into allocated memory. +

+#include <windows.h>
+#include "hyport.h"
+ + + + + + + + + + + + + + + + + + +

Functions

void *VMCALL hymmap_map_file (struct HyPortLibrary *portLibrary, const char *path, void **handle)
 Map a file into memory.
void VMCALL hymmap_unmap_file (struct HyPortLibrary *portLibrary, void *handle)
 UnMap previously mapped memory.
void VMCALL hymmap_shutdown (struct HyPortLibrary *portLibrary)
 PortLibrary shutdown.
I_32 VMCALL hymmap_startup (struct HyPortLibrary *portLibrary)
 PortLibrary startup.
I_32 VMCALL hymmap_capabilities (struct HyPortLibrary *portLibrary)
 Check the capabilities available for HYMMAP at runtime for the current platform.
+


Function Documentation

+

+ + + + +
+ + + + + + + + + +
I_32 VMCALL hymmap_capabilities struct HyPortLibrary portLibrary  ) 
+
+ + + + + +
+   + + +

+Check the capabilities available for HYMMAP at runtime for the current platform. +

+

Parameters:
+ + +
[in] portLibrary The port library
+
+
Returns:
a bit map containing the capabilites supported by the hymmap sub component of the port library. Possible bit values: HYPORT_MMAP_CAPABILITY_COPYONWRITE - if not present, platform is not capable of "copy on write" memory mapping.
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void* VMCALL hymmap_map_file struct HyPortLibrary portLibrary,
const char *  path,
void **  handle
+
+ + + + + +
+   + + +

+Map a file into memory. +

+

Parameters:
+ + + + +
[in] portLibrary The port library
[in] path - the path of the file to mapped into memory.
[out] handle - updates *handle with the memory map handle, this handle is later passed to unmap.
+
+
Returns:
pointer to newly mapped memory on success, NULL on error.
+
+

+ + + + +
+ + + + + + + + + +
void VMCALL hymmap_shutdown struct HyPortLibrary portLibrary  ) 
+
+ + + + + +
+   + + +

+PortLibrary shutdown. +

+

Parameters:
+ + +
[in] portLibrary The port library
+
+This function is called during shutdown of the portLibrary. Any resources that were created by hymmap_startup should be destroyed here.
+

+ + + + +
+ + + + + + + + + +
I_32 VMCALL hymmap_startup struct HyPortLibrary portLibrary  ) 
+
+ + + + + +
+   + + +

+PortLibrary startup. +

+This function is called during startup of the portLibrary. Any resources that are required for the memory mapping operations may be created here. All resources created here should be destroyed in hymmap_shutdown.

+

Parameters:
+ + +
[in] portLibrary The port library
+
+
Returns:
0 on success, negative error code on failure. Error code values returned are
    +
  • HYPORT_ERROR_STARTUP_MMAP
  • +
+
+
Note:
Most implementations will simply return success.
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + +
void VMCALL hymmap_unmap_file struct HyPortLibrary portLibrary,
void *  handle
+
+ + + + + +
+   + + +

+UnMap previously mapped memory. +

+

Parameters:
+ + + +
[in] portLibrary The port library
[in] handle - the handle from the mmap_map_file.
+
+
+


+
+ + (c) Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + +
+ +