harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r350181 [142/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....
Date Thu, 01 Dec 2005 06:04:00 GMT
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/linux.IA32/include/hyporterror.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/linux.IA32/include/hyporterror.h?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/linux.IA32/include/hyporterror.h
(added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/linux.IA32/include/hyporterror.h
Wed Nov 30 21:29:27 2005
@@ -0,0 +1,217 @@
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @file
+ * @ingroup Port
+ * @brief Port Library Error Codes
+ *
+ * When an error is reported by the operating system the port library must translate this
OS specific error code to a 
+ * portable error code.  All portable error codes are negative numbers.  Not every module
of the port library will have
+ * error codes dedicated to it's own use, some will use the generic portable error code values.
+ *
+ * Errors reported by the OS may be recorded by calling the port library functions @ref hyerror.c::hyerror_set_last_error
"hyerror_set_last_error()"
+ * or @ref hyerror.c::hyerror_set_last_error_with_message "hyerror_set_last_error_with_message()".
 The mapping of the OS specific error
+ * code to a portable error code is the responsibility of the calling module.
+ */
+#if !defined(hyporterror_h)
+#define hyporterror_h
+
+/**
+ * @name Generic Errors
+ * Generic error codes for modules that do not have their own specific errors.  Where possible
it is recommended that all
+ * modules that return error codes have their own set
+ *
+ * @internal HYPORT_ERROR* range from -1 to -99 avoid overlap
+ * @{
+ */
+#define HYPORT_ERROR_BASE -1
+#define HYPORT_ERROR_OPFAILED HYPORT_ERROR_BASE
+#define HYPORT_ERROR_EOF HYPORT_ERROR_BASE-1
+#define HYPORT_ERROR_NOPERMISSION HYPORT_ERROR_BASE-2
+#define HYPORT_ERROR_NOTFOUND HYPORT_ERROR_BASE-3
+#define HYPORT_ERROR_NAMETOOLONG HYPORT_ERROR_BASE-4
+#define HYPORT_ERROR_DISKFULL HYPORT_ERROR_BASE-5
+#define HYPORT_ERROR_EXIST HYPORT_ERROR_BASE-6
+#define HYPORT_ERROR_NOTEXIST HYPORT_ERROR_BASE-7
+#define HYPORT_ERROR_SYSTEMFULL HYPORT_ERROR_BASE-8
+#define HYPORT_ERROR_NOENT HYPORT_ERROR_BASE-9
+#define HYPORT_ERROR_DIRECTORY HYPORT_ERROR_BASE-10
+#define HYPORT_ERROR_NOTDIRECTORY HYPORT_ERROR_BASE-11
+#define HYPORT_ERROR_LOOP HYPORT_ERROR_BASE-12
+#define HYPORT_ERROR_BADF HYPORT_ERROR_BASE-13
+#define HYPORT_ERROR_WOULDBLOCK HYPORT_ERROR_BASE-14
+#define HYPORT_ERROR_INVALID HYPORT_ERROR_BASE-15
+/** @} */
+/** 
+ * @name Port Library startup failure code
+ * Failures related to the initialization and startup of the port library.
+ *
+ * @internal HYPORT_ERROR_STARTUP* range from -100 to -149 to avoid overlap
+ * @{
+ */
+#define HYPORT_ERROR_STARTUP_BASE -100
+#define HYPORT_ERROR_STARTUP_THREAD (HYPORT_ERROR_STARTUP_BASE)
+#define HYPORT_ERROR_STARTUP_MEM (HYPORT_ERROR_STARTUP_BASE -1)
+#define HYPORT_ERROR_STARTUP_TLS (HYPORT_ERROR_STARTUP_BASE -2)
+#define HYPORT_ERROR_STARTUP_TLS_ALLOC (HYPORT_ERROR_STARTUP_BASE -3)
+#define HYPORT_ERROR_STARTUP_TLS_MUTEX (HYPORT_ERROR_STARTUP_BASE -4)
+#define HYPORT_ERROR_STARTUP_CPU (HYPORT_ERROR_STARTUP_BASE -5)
+#define HYPORT_ERROR_STARTUP_VMEM (HYPORT_ERROR_STARTUP_BASE -6)
+#define HYPORT_ERROR_STARTUP_FILE (HYPORT_ERROR_STARTUP_BASE -7)
+#define HYPORT_ERROR_STARTUP_TTY (HYPORT_ERROR_STARTUP_BASE -8)
+#define HYPORT_ERROR_STARTUP_TTY_HANDLE (HYPORT_ERROR_STARTUP_BASE -9)
+#define HYPORT_ERROR_STARTUP_TTY_CONSOLE (HYPORT_ERROR_STARTUP_BASE -10)
+#define HYPORT_ERROR_STARTUP_MMAP (HYPORT_ERROR_STARTUP_BASE -11)
+#define HYPORT_ERROR_STARTUP_IPCMUTEX (HYPORT_ERROR_STARTUP_BASE -12)
+#define HYPORT_ERROR_STARTUP_NLS (HYPORT_ERROR_STARTUP_BASE -13)
+#define HYPORT_ERROR_STARTUP_SOCK (HYPORT_ERROR_STARTUP_BASE -14)
+#define HYPORT_ERROR_STARTUP_TIME (HYPORT_ERROR_STARTUP_BASE -15)
+#define HYPORT_ERROR_STARTUP_GP (HYPORT_ERROR_STARTUP_BASE -16)
+#define HYPORT_ERROR_STARTUP_EXIT (HYPORT_ERROR_STARTUP_BASE -17)
+#define HYPORT_ERROR_STARTUP_SYSINFO (HYPORT_ERROR_STARTUP_BASE -18)
+#define HYPORT_ERROR_STARTUP_SL (HYPORT_ERROR_STARTUP_BASE -19)
+#define HYPORT_ERROR_STARTUP_STR (HYPORT_ERROR_STARTUP_BASE -20)
+#define HYPORT_ERROR_STARTUP_SHSEM (HYPORT_ERROR_STARTUP_BASE -21)
+#define HYPORT_ERROR_STARTUP_SHMEM (HYPORT_ERROR_STARTUP_BASE -22)
+#define HYPORT_ERROR_STARTUP_ERROR (HYPORT_ERROR_STARTUP_BASE -23)
+#define HYPORT_ERROR_STARTUP_SIGNAL (HYPORT_ERROR_STARTUP_BASE -24)
+/** @} */
+/**
+ * @name Shared Semaphore Errors
+ * Error codes for shared semaphore operations.
+ *
+ * @internal HYPORT_ERROR_SHSEM* range from at -150 to 159 to avoid overlap 
+ * @{
+ */
+#define HYPORT_ERROR_SHSEM_BASE -150
+#define HYPORT_ERROR_SHSEM_OPFAILED (HYPORT_ERROR_SHSEM_BASE)
+#define HYPORT_ERROR_SHSEM_HANDLE_INVALID (HYPORT_ERROR_SHSEM_BASE-1)
+#define HYPORT_ERROR_SHSEM_SEMSET_INVALID (HYPORT_ERROR_SHSEM_BASE-2)
+#define HYPORT_ERROR_SHSEM_NOT_EXIST (HYPORT_ERROR_SHSEM_BASE-3)
+#define HYPORT_ERROR_SHSEM_NOPERMISSION (HYPORT_ERROR_SHSEM_BASE-4)
+#define HYPORT_ERROR_SHSEM_INVALID_INPUT	(HYPORT_ERROR_SHSEM_BASE-5)
+#define HYPORT_ERROR_SHSEM_NOSPACE (HYPORT_ERROR_SHSEM_BASE-6)
+#define HYPORT_ERROR_SHSEM_ALREADY_EXIST (HYPORT_ERROR_SHSEM_BASE-7)
+#define HYPORT_ERROR_SHSEM_DATA_DIRECTORY_FAILED (HYPORT_ERROR_SHSEM_BASE-8)
+/** @} */
+/**
+ * @name Shared Memory Errors
+ * Error codes for shared memory semaphore operations.
+ *
+ * @internal HYPORT_ERROR_SHMEM* range from at -160 to -169 to avoid overlap 
+ * @{
+ */
+#define HYPORT_ERROR_SHMEM_BASE -160
+#define HYPORT_ERROR_SHMEM_OPFAILED (HYPORT_ERROR_SHMEM_BASE)
+#define HYPORT_ERROR_SHMEM_HANDLE_INVALID (HYPORT_ERROR_SHMEM_BASE-1)
+#define HYPORT_ERROR_SHMEM_NOT_EXIST (HYPORT_ERROR_SHMEM_BASE-2)
+#define HYPORT_ERROR_SHMEM_NOPERMISSION (HYPORT_ERROR_SHMEM_BASE-3)
+#define HYPORT_ERROR_SHMEM_INVALID_INPUT	(HYPORT_ERROR_SHMEM_BASE-4)
+#define HYPORT_ERROR_SHMEM_NOSPACE (HYPORT_ERROR_SHMEM_BASE-5)
+#define HYPORT_ERROR_SHMEM_ALREADY_EXIST (HYPORT_ERROR_SHMEM_BASE-6)
+#define HYPORT_ERROR_SHMEM_TOOBIG (HYPORT_ERROR_SHMEM_BASE-7)
+#define HYPORT_ERROR_SHMEM_ATTACH_FAILED (HYPORT_ERROR_SHMEM_BASE-8)
+#define HYPORT_ERROR_SHMEM_DATA_DIRECTORY_FAILED (HYPORT_ERROR_SHMEM_BASE-9)
+/** @} */
+/* -170 to -199 available for use */
+/**
+ * @name Socket Errors
+ * Error codes for socket operations
+ *
+ * @internal HYPORT_ERROR_SOCKET* range from -200 to -299 avoid overlap
+ * @{
+ */
+#define HYPORT_ERROR_SOCKET_BASE -200
+#define HYPORT_ERROR_SOCKET_BADSOCKET HYPORT_ERROR_SOCKET_BASE						/* generic error */
+#define HYPORT_ERROR_SOCKET_NOTINITIALIZED HYPORT_ERROR_SOCKET_BASE-1					/* socket library
uninitialized */
+#define HYPORT_ERROR_SOCKET_BADAF HYPORT_ERROR_SOCKET_BASE-2								/* bad address family
*/
+#define HYPORT_ERROR_SOCKET_BADPROTO HYPORT_ERROR_SOCKET_BASE-3						/* bad protocol */
+#define HYPORT_ERROR_SOCKET_BADTYPE HYPORT_ERROR_SOCKET_BASE-4							/* bad type */
+#define HYPORT_ERROR_SOCKET_SYSTEMBUSY HYPORT_ERROR_SOCKET_BASE-5					/* system busy handling
requests */
+#define HYPORT_ERROR_SOCKET_SYSTEMFULL HYPORT_ERROR_SOCKET_BASE-6					/* too many sockets
*/
+#define HYPORT_ERROR_SOCKET_NOTCONNECTED HYPORT_ERROR_SOCKET_BASE-7				/* socket is not connected
*/
+#define HYPORT_ERROR_SOCKET_INTERRUPTED	HYPORT_ERROR_SOCKET_BASE-8					/* the call was cancelled
*/
+#define HYPORT_ERROR_SOCKET_TIMEOUT	HYPORT_ERROR_SOCKET_BASE-9							/* the operation timed
out */
+#define HYPORT_ERROR_SOCKET_CONNRESET HYPORT_ERROR_SOCKET_BASE-10					/* the connection was
reset */
+#define HYPORT_ERROR_SOCKET_WOULDBLOCK	 HYPORT_ERROR_SOCKET_BASE-11			/* the socket is marked
as nonblocking operation would block */
+#define HYPORT_ERROR_SOCKET_ADDRNOTAVAIL HYPORT_ERROR_SOCKET_BASE-12				/* address not available
*/
+#define HYPORT_ERROR_SOCKET_ADDRINUSE HYPORT_ERROR_SOCKET_BASE-13					/* address already
in use */
+#define HYPORT_ERROR_SOCKET_NOTBOUND HYPORT_ERROR_SOCKET_BASE-14						/* the socket is not
bound */
+#define HYPORT_ERROR_SOCKET_UNKNOWNSOCKET HYPORT_ERROR_SOCKET_BASE-15		/* resolution of fileDescriptor
to socket failed */
+#define HYPORT_ERROR_SOCKET_INVALIDTIMEOUT HYPORT_ERROR_SOCKET_BASE-16			/* the specified
timeout is invalid */
+#define HYPORT_ERROR_SOCKET_FDSETFULL HYPORT_ERROR_SOCKET_BASE-17					/* Unable to create
an FDSET */
+#define HYPORT_ERROR_SOCKET_TIMEVALFULL HYPORT_ERROR_SOCKET_BASE-18					/* Unable to create
a TIMEVAL */
+#define HYPORT_ERROR_SOCKET_REMSOCKSHUTDOWN HYPORT_ERROR_SOCKET_BASE-19	/* The remote socket
has shutdown gracefully */
+#define HYPORT_ERROR_SOCKET_NOTLISTENING HYPORT_ERROR_SOCKET_BASE-20				/* listen() was not
invoked prior to accept() */
+#define HYPORT_ERROR_SOCKET_NOTSTREAMSOCK HYPORT_ERROR_SOCKET_BASE-21			/* The socket does
not support connection-oriented service */
+#define HYPORT_ERROR_SOCKET_ALREADYBOUND HYPORT_ERROR_SOCKET_BASE-22			/* The socket is already
bound to an address */
+#define HYPORT_ERROR_SOCKET_NBWITHLINGER HYPORT_ERROR_SOCKET_BASE-23				/* The socket is
marked non-blocking & SO_LINGER is non-zero */
+#define HYPORT_ERROR_SOCKET_ISCONNECTED HYPORT_ERROR_SOCKET_BASE-24				/* The socket is already
connected */
+#define HYPORT_ERROR_SOCKET_NOBUFFERS HYPORT_ERROR_SOCKET_BASE-25					/* No buffer space
is available */
+#define HYPORT_ERROR_SOCKET_HOSTNOTFOUND HYPORT_ERROR_SOCKET_BASE-26			/* Authoritative Answer
Host not found */
+#define HYPORT_ERROR_SOCKET_NODATA HYPORT_ERROR_SOCKET_BASE-27							/* Valid name, no data
record of requested type */
+#define HYPORT_ERROR_SOCKET_BOUNDORCONN HYPORT_ERROR_SOCKET_BASE-28				/* The socket has
not been bound or is already connected */
+#define HYPORT_ERROR_SOCKET_OPNOTSUPP HYPORT_ERROR_SOCKET_BASE-29					/* The socket does
not support the operation */
+#define HYPORT_ERROR_SOCKET_OPTUNSUPP HYPORT_ERROR_SOCKET_BASE-30					/* The socket option
is not supported */
+#define HYPORT_ERROR_SOCKET_OPTARGSINVALID HYPORT_ERROR_SOCKET_BASE-31			/* The socket option
arguments are invalid */
+#define HYPORT_ERROR_SOCKET_SOCKLEVELINVALID HYPORT_ERROR_SOCKET_BASE-32		/* The socket level
is invalid */
+#define HYPORT_ERROR_SOCKET_TIMEOUTFAILURE HYPORT_ERROR_SOCKET_BASE-33			
+#define HYPORT_ERROR_SOCKET_SOCKADDRALLOCFAIL HYPORT_ERROR_SOCKET_BASE-34	/* Unable to allocate
the sockaddr structure */
+#define HYPORT_ERROR_SOCKET_FDSET_SIZEBAD HYPORT_ERROR_SOCKET_BASE-35				/* The calculated
maximum size of the file descriptor set is bad */
+#define HYPORT_ERROR_SOCKET_UNKNOWNFLAG HYPORT_ERROR_SOCKET_BASE-36				/* The flag is unknown
*/
+#define HYPORT_ERROR_SOCKET_MSGSIZE HYPORT_ERROR_SOCKET_BASE-37						/* The datagram was
too big to fit the specified buffer & was truncated. */
+#define HYPORT_ERROR_SOCKET_NORECOVERY HYPORT_ERROR_SOCKET_BASE-38				/* The operation failed
with no recovery possible */
+#define HYPORT_ERROR_SOCKET_ARGSINVALID HYPORT_ERROR_SOCKET_BASE-39					/* The arguments
are invalid */
+#define HYPORT_ERROR_SOCKET_BADDESC HYPORT_ERROR_SOCKET_BASE-40						/* The socket argument
is not a valid file descriptor */
+#define HYPORT_ERROR_SOCKET_NOTSOCK HYPORT_ERROR_SOCKET_BASE-41						/* The socket argument
is not a socket */
+#define HYPORT_ERROR_SOCKET_HOSTENTALLOCFAIL HYPORT_ERROR_SOCKET_BASE-42		/* Unable to allocate
the hostent structure */
+#define HYPORT_ERROR_SOCKET_TIMEVALALLOCFAIL HYPORT_ERROR_SOCKET_BASE-43		/* Unable to allocate
the timeval structure */
+#define HYPORT_ERROR_SOCKET_LINGERALLOCFAIL HYPORT_ERROR_SOCKET_BASE-44			/* Unable to allocate
the linger structure */
+#define HYPORT_ERROR_SOCKET_IPMREQALLOCFAIL HYPORT_ERROR_SOCKET_BASE-45		 	/* Unable to allocate
the ipmreq structure */
+#define HYPORT_ERROR_SOCKET_FDSETALLOCFAIL HYPORT_ERROR_SOCKET_BASE-46 			/* Unable to allocate
the fdset structure */
+#define HYPORT_ERROR_SOCKET_OPFAILED HYPORT_ERROR_SOCKET_BASE-47
+#define HYPORT_ERROR_SOCKET_VALUE_NULL HYPORT_ERROR_SOCKET_BASE-48 					/* The value indexed
was NULL */
+#define HYPORT_ERROR_SOCKET_CONNECTION_REFUSED	 HYPORT_ERROR_SOCKET_BASE-49	/* connection
was refused */
+#define HYPORT_ERROR_SOCKET_ENETUNREACH HYPORT_ERROR_SOCKET_BASE-50					/* network is not
reachable */
+#define HYPORT_ERROR_SOCKET_EACCES HYPORT_ERROR_SOCKET_BASE-51							/* permissions do not
allow action on socket */
+
+#define HYPORT_ERROR_SOCKET_FIRST_ERROR_NUMBER HYPORT_ERROR_SOCKET_BASE
+#define HYPORT_ERROR_SOCKET_LAST_ERROR_NUMBER HYPORT_ERROR_SOCKET_VALUE_NULL /* Equals last
used error code */
+/**
+ * @name File Errors 
+ * Error codes for file operations.
+ *
+ * @internal HYPORT_ERROR_FILE* range from -300 to -349 avoid overlap
+ * @{
+ */
+#define HYPORT_ERROR_FILE_BASE -300
+#define HYPORT_ERROR_FILE_OPFAILED (HYPORT_ERROR_FILE_BASE)
+#define HYPORT_ERROR_FILE_EOF (HYPORT_ERROR_FILE_BASE-1)
+#define HYPORT_ERROR_FILE_NOPERMISSION (HYPORT_ERROR_FILE_BASE-2)
+#define HYPORT_ERROR_FILE_NOTFOUND (HYPORT_ERROR_FILE_BASE-3)
+#define HYPORT_ERROR_FILE_NAMETOOLONG (HYPORT_ERROR_FILE_BASE-4)
+#define HYPORT_ERROR_FILE_DISKFULL (HYPORT_ERROR_FILE_BASE-5)
+#define HYPORT_ERROR_FILE_EXIST (HYPORT_ERROR_FILE_BASE-6)
+#define HYPORT_ERROR_FILE_SYSTEMFULL (HYPORT_ERROR_FILE_BASE-7)
+#define HYPORT_ERROR_FILE_NOENT (HYPORT_ERROR_FILE_BASE-8)
+#define HYPORT_ERROR_FILE_NOTDIR (HYPORT_ERROR_FILE_BASE-9)
+#define HYPORT_ERROR_FILE_LOOP (HYPORT_ERROR_FILE_BASE-10)
+#define HYPORT_ERROR_FILE_BADF (HYPORT_ERROR_FILE_BASE-11)
+#define HYPORT_ERROR_FILE_WOULDBLOCK (HYPORT_ERROR_FILE_BASE-12)
+#define HYPORT_ERROR_FILE_INVAL (HYPORT_ERROR_FILE_BASE-13)
+/** @} */
+
+#endif     /* hyporterror_h */

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/linux.IA32/include/hysignal.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/linux.IA32/include/hysignal.h?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/linux.IA32/include/hysignal.h
(added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/linux.IA32/include/hysignal.h
Wed Nov 30 21:29:27 2005
@@ -0,0 +1,258 @@
+/* Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+	MOTIVATION:
+	===========
+	Getting signals correct on the different UNIX platforms is difficult.
+	Each platform provides slighlty different semantics for signals depending
+	on the call used (signal/sigaction/sigset).
+	
+	The macros in this file are designed to minimize those differences, and
+	if used as recommended can completely hide the platform differences.
+
+	USE:
+	====
+
+	***NOTE: These functions only work with signals whose signal number is less
+		than 50. This can be changed by changing the value of HyMaxSignals.
+
+	The following macros are defined
+
+		HySigSet (aSignal, aFn, previousHandler);
+			Installs a signal handler called aFn.
+
+			aSignal - is the platform constant for the signal
+				(e.g. SIG_USR1)
+			aFn - is the signal handler you want to install
+				(fn of type SIGHANDLERFN)
+			previousHandler - is a storage location for the previous handler,
+				or action
+				(fn of type HySignalHandler, or constant such as SIG_DFL)
+
+		HySigBlock(aSignal)
+		HySigUnblock(aSignal)
+
+
+	The Handler function should have a prototype of:
+		void mySigHandler(int SignalNumber);
+
+	To invoke a previous signal handler use:
+		HyInvokePreviousHandler(previousHandler, asig);
+
+		The previous handler will only be invoked if it was not a system
+		action such as (SIG_IGN, or SIG_DFL).
+
+	NOTE:
+		HySigUnblock must be called before the signal handler returns, to ensure the
+		signal can be handled again.
+
+	
+
+	EXAMPLES:
+	=========
+
+===>1) If the handler *can* be interrupted by additional signals
+		use the following style:
+
+	static HySigHandler previousHandler;
+
+	myHandler(aSig)
+	{
+		HySigUnblock(aSig);
+		... do some interruptable work ...
+		HyInvokePreviousHandler(previousHandler, aSig);
+	}
+
+	main()
+	{
+		HySetSig(SIG_USR1, myHandler, previousHandler);
+	}
+		
+===>2) If the handler *cannot* be interrupted by the same signal,
+	use the following style:
+
+	static HySigHandler previousHandler;
+
+	myHandler(aSig)
+	{
+		HySigBlock(aSig);
+		... do some uninterruptable work ...
+		HySigUnblock(aSig);
+		HyInvokePreviousHandler(previousHandler, aSig);
+	}
+
+	main()
+	{
+		HySetSig(SIG_USR1, myHandler, previousHandler);
+	}
+
+	
+===>3) If it does not matter whether or not the handler can be interrupted
+	by additional signals use the following style:
+	NOTE: the signal must be unblocked before the signal handler returns
+	or a long jump is executed.
+
+	static HySigHandler previousHandler;
+
+	myHandler(aSig)
+	{
+		... do some interruptable work ...
+		HySigUnblock(aSig);
+		HyInvokePreviousHandler(previousHandler, aSig);
+	}
+
+	main()
+	{
+		HySetSig(SIG_USR1, myHandler, previousHandler);
+	}
+
+	SPECIFICATION NOTES: (for porting)
+	==================================
+
+	1. The signal handler must be reliable. This means: the sighandler will not
+		be set to SIG_DFL when the signal handler is entered. So there is
+		no need to set it again. (A problem when cascading signal handlers).
+	2. The blocking state will remain unspecified when the sig handler is
+		entered. So in order to set the state, the developer must specify
+		HySigBlock(aSig), or HySigUnblock(aSig)
+	3. The previous signal handler may or may not be returned if it was set
+		using a fn other than HySigSet(...) or sigaction(...). e.g. if
+		signal() was used to set the handler it may or may not be returned
+		in the previousHandler variable. (This is platform specific).
+	4. These macros work only on Solaris, SPARC, HPUX and AIX. Other Unix platforms
+		may be added in the future.
+	5. When signals are blocked they are actually queued by the OS. However,
+		the queue that the OS uses is extremely small, and some signals may
+		be lost, even though they are blocked.
+	6. In a multithreaded environment a signal handler must be able to handle signals
+		meant for other threads.
+
+*/
+
+#if !defined(HYSIGNAL_H)
+#define HYSIGNAL_H
+ 
+#include <signal.h>
+/* declare protototypes - different for each platform */
+
+
+
+#if defined(LINUXPPC)
+typedef void(*HySignalHandler)PROTOTYPE((int sig, struct sigcontext *context));
+#endif
+
+#if defined(LINUX) && !defined(LINUXPPC)
+typedef void(*HySignalHandler)PROTOTYPE((int sig));
+#endif
+
+#define HyMaxSignals 50 /* This implementation can only handle the first 50 signals */
+
+/* A set of signal handlers indexed by signal number. This is useful for storing previous
+signal handlers */
+typedef HySignalHandler HySignalHandlerSet[HyMaxSignals];
+#define HySigUnblock(aSig_es)\
+	{sigset_t asigset_es;\
+		sigemptyset(&asigset_es);\
+		sigaddset(&asigset_es, (aSig_es));\
+		sigprocmask(SIG_UNBLOCK, &asigset_es, NULL);\
+	}
+#define HySigBlock(aSig_es)\
+	{sigset_t asigset_es;\
+		sigemptyset(&asigset_es);\
+		sigaddset(&asigset_es, (aSig_es));\
+		sigprocmask(SIG_BLOCK, &asigset_es, NULL);\
+	}
+#if false
+/* Note: On the solaris platform the .sa_flags = NODEFER option does not
+	work properly on Solaris 2.4. Behaviour on other versions is unknown */
+#define HySigSet(aSignal_es, aFn_es, previousHandler_es)\
+	{\
+		struct sigaction newact_es, oldact_es;\
+		sigemptyset(&newact_es.sa_mask);\
+		newact_es.sa_flags = SA_RESTART;\
+		newact_es.sa_handler = (void (*)(int))aFn_es;\
+		HYJSIG_SIGACTION(aSignal_es,&newact_es,&oldact_es);\
+		(previousHandler_es) = (HySignalHandler)oldact_es.sa_handler;\
+	}
+#elif defined(LINUX)
+#define HySigSet(aSignal_es, aFn_es, previousHandler_es)\
+	{\
+		struct sigaction newact_es, oldact_es;\
+		sigemptyset(&newact_es.sa_mask);\
+		newact_es.sa_flags = SA_RESTART;\
+		if ((void *)aFn_es != (void *)SIG_DFL &&\
+		    (void *)aFn_es != (void *)SIG_IGN) {\
+			newact_es.sa_flags |= SA_SIGINFO;\
+			newact_es.sa_sigaction = (void (*)(int, siginfo_t*, void*))aFn_es;\
+		} else {\
+			newact_es.sa_handler = (void (*)(int))aFn_es;\
+		}\
+		HYJSIG_SIGACTION(aSignal_es,&newact_es,&oldact_es);\
+		(previousHandler_es) = (HySignalHandler)oldact_es.sa_handler;\
+	}
+#elif defined(HYZOS390)
+#define HySigSet(aSignal_es, aFn_es, previousHandler_es)\
+		{\
+	struct sigaction newact_es, oldact_es;\
+	sigemptyset(&newact_es.sa_mask);\
+	newact_es.sa_flags = SA_RESTART;\
+	if ((void *)aFn_es != (void *)SIG_DFL &&\
+	    (void *)aFn_es != (void *)SIG_IGN) {\
+		newact_es.sa_flags |= SA_SIGINFO;\
+		newact_es.sa_sigaction = (void (*)(int, siginfo_t*, void*))aFn_es;\
+	} else {\
+		newact_es.sa_handler = (void (*)(int))aFn_es;\
+	}\
+	HYJSIG_SIGACTION(aSignal_es,&newact_es,&oldact_es);\
+	(previousHandler_es) = (HySignalHandler)oldact_es.sa_sigaction;\
+		}
+#else
+#endif
+/* AIX, HP and SOLARIS all return NULL for the previous handler if
+   there wasn't one defined */
+/* Invoke the previous handler 
+	- stored in the signal set <previousHandlerSet_es>
+	- at index <aSig_es>
+	- passing it signal number <aSig_es> */
+
+#if (defined(LINUX) && !defined(LINUXPPC))
+#define HyInvokePreviousHandlerIn(previousHandlerSet_es,aSig_es)\
+	if ((previousHandlerSet_es)[(aSig_es)] != NULL) (*(previousHandlerSet_es)[(aSig_es)])((aSig_es))
+#endif
+
+#if defined(LINUXPPC)
+#define HyInvokePreviousHandlerIn(previousHandlerSet_es, aSig_es, aScp_es)\
+	if ((previousHandlerSet_es)[(aSig_es)] != NULL) (*(previousHandlerSet_es)[(aSig_es)])((aSig_es),
(aScp_es))
+#endif
+/*store the previous handler 
+	- in the signal set <previousHandlerSet_es>
+	- at index <aSig_es>
+	- where the previous handler is <previousHandler_es> */
+#define HyAddPreviousHandlerIn(previousHandlerSet_es, previousHandler_es, aSig_es)\
+	(previousHandlerSet_es)[(aSig_es)] = previousHandler_es
+/*remove the previous handler 
+	- in the signal set <previousHandlerSet_es>
+	- at index <aSig_es> */
+#define HyRemovePreviousHandlerIn(previousHandlerSet_es, aSig_es)\
+	(previousHandlerSet_es)[(aSig_es)] = NULL
+/*answer the previous handler 
+	- in the signal set <previousHandlerSet_es>
+	- at index <aSig_es>
+	-if there was no previous handler answer NULL */
+#define HyPreviousHandlerIn(previousHandlerSet_es, aSig_es)\
+	((previousHandlerSet_es)[(aSig_es)])
+
+#endif /* HYSIGNAL_H defined */

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/linux.IA32/include/hysocket.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/linux.IA32/include/hysocket.h?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/linux.IA32/include/hysocket.h
(added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/linux.IA32/include/hysocket.h
Wed Nov 30 21:29:27 2005
@@ -0,0 +1,101 @@
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/******************************************************\
+		Portable socket library header.
+\******************************************************/
+
+#if !defined(hysocket_h)
+#define hysocket_h
+
+#include <stddef.h>
+#include "hyporterror.h"
+
+/* Socket types, stream & datagram */
+#define HYSOCK_STREAM 0
+#define HYSOCK_DGRAM 1
+#define HYSOCK_AFINET 2
+#define HYSOCK_ANY 3
+#define HYSOCK_DEFPROTOCOL 0
+#define HYSOCK_INADDR_ANY (U_32)0	
+#define HYSOCK_NOFLAGS (U_32)0       /* The default flag argument value, as in a recv */
+#define HYSOCK_INADDR_LEN 4          /* The length in bytes of a binary IPv4 internet address
*/
+#define HYSOCK_INADDR6_LEN 16        /* The length in bytes of a binary IPv6 internet address
*/
+
+/* For getaddrinfo (IPv6) -- socket types */
+#define HYSOCKET_ANY 0        /* for getaddrinfo hints */
+#define HYSOCKET_STREAM 1     /* stream socket */
+#define HYSOCKET_DGRAM 2      /* datagram socket */
+#define HYSOCKET_RAW 3        /* raw-protocol interface */
+#define HYSOCKET_RDM 4        /* reliably-delivered message */
+#define HYSOCKET_SEQPACKET 5  /* sequenced packet stream */
+
+/** address family */
+#define HYADDR_FAMILY_UNSPEC 0     /* IPv6 */
+#define HYADDR_FAMILY_AFINET4 2    /* IPv6 */
+#define HYADDR_FAMILY_AFINET6 23   /* IPv6 */
+
+/** protocol family */
+#define HYPROTOCOL_FAMILY_UNSPEC  HYADDR_FAMILY_UNSPEC     /* IPv6 */
+#define HYPROTOCOL_FAMILY_INET4   HYADDR_FAMILY_AFINET4    /* IPv6 */
+#define HYPROTOCOL_FAMILY_INET6   HYADDR_FAMILY_AFINET6    /* IPv6 */
+
+/* Portable defines for socket levels */
+#define HY_SOL_SOCKET 1
+#define HY_IPPROTO_TCP 2
+#define HY_IPPROTO_IP 3
+#define HY_IPPROTO_IPV6 4
+
+/* Portable defines for socket options */
+#define HY_SO_LINGER 1
+#define HY_SO_KEEPALIVE 2
+#define HY_TCP_NODELAY 3
+#define HY_MCAST_TTL 4
+#define HY_MCAST_ADD_MEMBERSHIP 5
+#define HY_MCAST_DROP_MEMBERSHIP 6
+#define HY_MCAST_INTERFACE 7
+#define HY_SO_REUSEADDR 8
+#define HY_SO_REUSEPORT 9
+#define HY_SO_SNDBUF 11
+#define HY_SO_RCVBUF 12
+#define HY_SO_BROADCAST 13
+#define HY_SO_OOBINLINE 14
+#define HY_IP_MULTICAST_LOOP 15
+#define HY_IP_TOS 16
+#define HY_MCAST_INTERFACE_2 17
+#define HY_IPV6_ADD_MEMBERSHIP 18
+#define HY_IPV6_DROP_MEMBERSHIP	19
+
+/* Portable defines for socket read/write options */
+#define HYSOCK_MSG_PEEK 1
+#define HYSOCK_MSG_OOB 2
+
+/* Platform Constants */
+typedef struct hysocket_struct *hysocket_t;
+typedef struct hysockaddr_struct *hysockaddr_t;
+typedef struct hyhostent_struct *hyhostent_t;
+typedef struct hyfdset_struct *hyfdset_t;
+typedef struct hytimeval_struct *hytimeval_t;
+typedef struct hylinger_struct *hylinger_t;
+typedef struct hyipmreq_struct *hyipmreq_t;
+typedef struct hyaddrinfo_struct *hyaddrinfo_t;    /* IPv6 */
+typedef struct hyipv6_mreq_struct *hyipv6_mreq_t;  /* IPv6 */
+
+/* constants for calling multi-call functions */
+#define HY_PORT_SOCKET_STEP_START 		10
+#define HY_PORT_SOCKET_STEP_CHECK	20
+#define HY_PORT_SOCKET_STEP_DONE		30
+
+#endif     /* hysocket_h */

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/linux.IA32/include/hystatic.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/linux.IA32/include/hystatic.h?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/linux.IA32/include/hystatic.h
(added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/linux.IA32/include/hystatic.h
Wed Nov 30 21:29:27 2005
@@ -0,0 +1,30 @@
+/* Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#if !defined(hystatic_h)
+#define hystatic_h
+
+typedef struct {
+	char * name;
+	void * funcOrTable;
+} HyPrimitiveTableSlot;
+
+typedef	HyPrimitiveTableSlot HyPrimitiveTable[];
+#define	HyDefinePrimitiveTable(name) HyPrimitiveTableSlot name [] = {
+#define	HySubTable(table) HyPrimitiveTableEntry(0, (table))
+#define	HyPrimitiveTableEntry(name, fn) { (char *) (name), (void *) (fn) },
+#define	HyEndPrimitiveTable { (char *) 0, (void *) 0} };
+
+#endif     /* hystatic_h */

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/linux.IA32/include/hystdarg.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/linux.IA32/include/hystdarg.h?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/linux.IA32/include/hystdarg.h
(added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/linux.IA32/include/hystdarg.h
Wed Nov 30 21:29:27 2005
@@ -0,0 +1,29 @@
+/* Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#if !defined(hystdarg_h)
+#define hystdarg_h
+
+#include <stdarg.h>
+#include <string.h>	
+#include "hycomp.h"
+
+#if defined(va_copy)
+#define COPY_VA_LIST(new,old) va_copy(new,  old)
+#else
+#define COPY_VA_LIST(new,old) memcpy(VA_PTR(new), VA_PTR(old), sizeof(va_list))
+#endif
+
+#endif     /* hystdarg_h */

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/linux.IA32/include/hythread.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/linux.IA32/include/hythread.h?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/linux.IA32/include/hythread.h
(added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/linux.IA32/include/hythread.h
Wed Nov 30 21:29:27 2005
@@ -0,0 +1,291 @@
+/* Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#if !defined(HYTHREAD_H)
+#define HYTHREAD_H
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#include <stddef.h>
+#include "hycomp.h"
+
+typedef UDATA hythread_tls_key_t;
+
+#define HYTHREAD_PROC VMCALL
+
+typedef int(HYTHREAD_PROC* hythread_entrypoint_t)(void*);
+typedef void(HYTHREAD_PROC* hythread_tls_finalizer_t)(void*);
+typedef struct HyThread *hythread_t;
+typedef struct HyThreadMonitor *hythread_monitor_t;
+typedef struct HySemaphore *hysem_t;
+
+struct HyPortLibrary;
+
+#define HYTHREAD_PRIORITY_MIN  0
+#define HYTHREAD_PRIORITY_USER_MIN  1
+#define HYTHREAD_PRIORITY_NORMAL  5
+#define HYTHREAD_PRIORITY_USER_MAX  10
+
+#define HYTHREAD_PRIORITY_MAX  11
+
+#define HYTHREAD_LOCKING_DEFAULT	0 /* default locking policy for platform */ 
+#define HYTHREAD_LOCKING_NO_DATA	(-1)	/* if no policy data is provided */
+#define HYTHREAD_FLAG_BLOCKED  1
+#define HYTHREAD_ALREADY_INITIALIZED  4
+#define HYTHREAD_TIMED_OUT  3
+#define HYTHREAD_FLAG_STARTED  0x800
+#define HYTHREAD_FLAG_JLM_HAS_BEEN_ENABLED  0x20000
+#define HYTHREAD_ILLEGAL_MONITOR_STATE  1
+#define HYTHREAD_FLAG_PRIORITY_INTERRUPTED  0x100
+#define HYTHREAD_FLAG_JLMHST_ENABLED  0x10000
+#define HYTHREAD_FLAG_JLM_ENABLED  0x4000
+#define HYTHREAD_FLAG_INTERRUPTED  4
+#define HYTHREAD_INVALID_ARGUMENT  7
+#define HYTHREAD_FLAG_DETACHED  0x80
+#define HYTHREAD_PRIORITY_INTERRUPTED  5
+#define HYTHREAD_FLAG_CANCELED  0x400
+#define HYTHREAD_FLAG_NOTIFIED  16
+#define HYTHREAD_FLAG_ATTACHED  0x200
+#define HYTHREAD_WOULD_BLOCK  8
+#define HYTHREAD_FLAG_DEAD  32
+#define HYTHREAD_FLAG_WAITING  2
+#define HYTHREAD_FLAG_PARKED  0x40000
+#define HYTHREAD_FLAG_UNPARKED  0x80000
+#define HYTHREAD_FLAG_INTERRUPTABLE  0x2000
+#define HYTHREAD_FLAG_TIMER_SET  0x100000
+#define HYTHREAD_FLAG_JLM_ENABLED_ALL  0x1C000
+#define HYTHREAD_FLAG_JLMTS_ENABLED  0x8000
+#define HYTHREAD_INTERRUPTED  2
+#define HYTHREAD_FLAG_BLOCKED_AFTER_WAIT  0x1000
+#define HYTHREAD_ALREADY_ATTACHED  6
+#define HYTHREAD_FLAG_SUSPENDED  8
+#define HYTHREAD_FLAG_SLEEPING  64
+#define HYTHREAD_MONITOR_INFLATED  0x10000
+#define HYTHREAD_MONITOR_INTERRUPTABLE  0x20000
+#define HYTHREAD_MONITOR_PRIORITY_INTERRUPTABLE  0x40000
+#define HYTHREAD_MONITOR_SYSTEM  0
+#define HYTHREAD_MONITOR_OBJECT  0x60000
+#define HYTHREAD_MONITOR_MUTEX_UNINITIALIZED  0x80000
+#define HYTHREAD_MONITOR_SUPPRESS_CONTENDED_EXIT  0x100000
+#define HYTHREAD_MONITOR_MUTEX_IN_USE  0x200000
+#define HYTHREAD_MONITOR_SPINLOCK_UNOWNED  0
+#define HYTHREAD_MONITOR_SPINLOCK_OWNED  1
+#define HYTHREAD_MONITOR_SPINLOCK_EXCEEDED  2
+#define HYTHREAD_LIB_FLAG_JLMHST_ENABLED  0x10000
+#define HYTHREAD_LIB_FLAG_JLM_ENABLED  0x4000
+#define HYTHREAD_LIB_FLAG_JLM_ENABLED_ALL  0x1C000
+#define HYTHREAD_LIB_FLAG_JLM_HAS_BEEN_ENABLED  0x20000
+#define HYTHREAD_LIB_FLAG_JLMTS_ENABLED  0x8000
+
+typedef struct HyThreadMonitorTracing {
+    char* monitor_name;
+    UDATA enter_count;
+    UDATA slow_count;
+    UDATA recursive_count;
+    UDATA spin2_count;
+    UDATA yield_count;
+} HyThreadMonitorTracing;
+
+#define HYSIZEOF_HyThreadMonitorTracing 24
+
+extern HY_CFUNC void VMCALL
+hythread_detach PROTOTYPE((hythread_t thread));
+extern HY_CFUNC UDATA VMCALL
+hythread_lib_set_flags PROTOTYPE((UDATA flags));
+extern HY_CFUNC IDATA VMCALL 
+hythread_tls_alloc PROTOTYPE((hythread_tls_key_t* handle));
+extern HY_CFUNC IDATA VMCALL 
+hythread_sleep_interruptable PROTOTYPE((I_64 millis, IDATA nanos));
+extern HY_CFUNC IDATA VMCALL 
+hythread_monitor_enter_using_threadId PROTOTYPE((hythread_monitor_t monitor, hythread_t threadId));
+extern HY_CFUNC void  VMCALL 
+hythread_cancel PROTOTYPE((hythread_t thread));
+extern HY_CFUNC UDATA VMCALL
+hythread_clear_interrupted PROTOTYPE((void));
+extern HY_CFUNC void VMCALL 
+hythread_lib_unlock PROTOTYPE((hythread_t self));
+extern HY_CFUNC IDATA VMCALL 
+hythread_monitor_enter PROTOTYPE((hythread_monitor_t monitor));
+extern HY_CFUNC IDATA VMCALL
+hythread_monitor_notify_all PROTOTYPE((hythread_monitor_t monitor));
+extern HY_CFUNC IDATA VMCALL 
+hythread_attach PROTOTYPE((hythread_t* handle));
+extern HY_CFUNC HyThreadMonitorTracing* VMCALL 
+hythread_jlm_get_gc_lock_tracing PROTOTYPE(());
+extern HY_CFUNC UDATA VMCALL 
+hythread_priority_interrupted PROTOTYPE((hythread_t thread));
+extern HY_CFUNC IDATA VMCALL 
+hythread_monitor_destroy PROTOTYPE((hythread_monitor_t monitor));
+extern HY_CFUNC IDATA VMCALL 
+hysem_post PROTOTYPE((hysem_t s));
+extern HY_CFUNC UDATA VMCALL 
+hythread_monitor_num_waiting PROTOTYPE((hythread_monitor_t monitor));
+extern HY_CFUNC UDATA VMCALL
+hythread_interrupted PROTOTYPE((hythread_t thread));
+
+extern HY_CFUNC void VMCALL 
+hythread_monitor_lock PROTOTYPE((hythread_t self, hythread_monitor_t monitor));
+extern HY_CFUNC IDATA VMCALL 
+hythread_park PROTOTYPE((I_64 millis, IDATA nanos));
+extern HY_CFUNC IDATA VMCALL 
+hythread_monitor_init_with_name PROTOTYPE((hythread_monitor_t* handle, UDATA flags, char*
name));
+extern HY_CFUNC IDATA VMCALL 
+hythread_monitor_try_enter PROTOTYPE((hythread_monitor_t monitor));
+extern HY_CFUNC void VMCALL 
+hythread_jlm_thread_clear PROTOTYPE((hythread_t thread));
+extern HY_CFUNC hythread_t VMCALL hythread_self PROTOTYPE((void));
+extern HY_CFUNC IDATA VMCALL 
+hythread_tls_free PROTOTYPE((hythread_tls_key_t key));
+extern HY_CFUNC UDATA VMCALL
+hythread_clear_priority_interrupted PROTOTYPE((void));
+extern HY_CFUNC void VMCALL 
+hythread_jlm_thread_init PROTOTYPE((hythread_t thread));
+
+extern HY_CFUNC void VMCALL 
+hythread_jlm_gc_lock_init PROTOTYPE(());
+extern HY_CFUNC void VMCALL 
+hythread_monitor_unlock PROTOTYPE((hythread_t self, hythread_monitor_t monitor));
+extern HY_CFUNC IDATA VMCALL 
+hysem_wait PROTOTYPE((hysem_t s));
+extern HY_CFUNC void VMCALL 
+hythread_yield PROTOTYPE((void));
+extern HY_CFUNC void VMCALL 
+hythread_suspend PROTOTYPE((void));
+extern HY_CFUNC void VMCALL 
+hythread_interrupt PROTOTYPE((hythread_t thread));
+extern HY_CFUNC IDATA VMCALL 
+hythread_tls_set PROTOTYPE((hythread_t thread, hythread_tls_key_t key, void* value));
+extern HY_CFUNC IDATA VMCALL 
+hythread_create PROTOTYPE((hythread_t* handle, UDATA stacksize, UDATA priority, UDATA suspend,
hythread_entrypoint_t entrypoint, void* entryarg));
+extern HY_CFUNC IDATA VMCALL
+hysem_init PROTOTYPE((hysem_t* sp, I_32 initValue));
+extern HY_CFUNC IDATA VMCALL 
+hythread_monitor_wait PROTOTYPE((hythread_monitor_t monitor));
+extern HY_CFUNC IDATA VMCALL 
+hythread_monitor_init_policy PROTOTYPE((hythread_monitor_t* handle, UDATA flags, IDATA policy,
IDATA policyData));
+extern HY_CFUNC void VMCALL 
+hythread_jlm_monitor_init PROTOTYPE((hythread_monitor_t monitor));
+extern HY_CFUNC IDATA VMCALL
+hysem_destroy PROTOTYPE((hysem_t s));
+extern HY_CFUNC IDATA VMCALL 
+hythread_monitor_wait_interruptable PROTOTYPE((hythread_monitor_t monitor, I_64 millis, IDATA
nanos));
+extern HY_CFUNC IDATA VMCALL 
+hythread_monitor_try_enter_using_threadId PROTOTYPE((hythread_monitor_t monitor, hythread_t
threadId));
+extern HY_CFUNC IDATA VMCALL 
+hythread_monitor_exit PROTOTYPE((hythread_monitor_t monitor));
+extern HY_CFUNC IDATA VMCALL 
+hythread_set_priority PROTOTYPE((hythread_t thread, UDATA priority));
+extern HY_CFUNC void VMCALL 
+hythread_unpark PROTOTYPE((hythread_t thread));
+extern HY_CFUNC void VMCALL 
+hythread_lib_lock PROTOTYPE((hythread_t self));
+extern HY_CFUNC IDATA VMCALL 
+hythread_monitor_init PROTOTYPE((hythread_monitor_t* handle, UDATA flags));
+extern HY_CFUNC IDATA VMCALL 
+hythread_sleep PROTOTYPE((I_64 millis));
+extern HY_CFUNC UDATA* VMCALL 
+hythread_global PROTOTYPE((char* name));
+extern HY_CFUNC IDATA VMCALL 
+hythread_tls_alloc_with_finalizer PROTOTYPE((hythread_tls_key_t* handle, hythread_tls_finalizer_t
finalizer));
+extern HY_CFUNC void VMCALL 
+hythread_jlm_monitor_clear PROTOTYPE((hythread_monitor_t monitor));
+extern HY_CFUNC IDATA VMCALL 
+hythread_monitor_wait_timed PROTOTYPE((hythread_monitor_t monitor, I_64 millis, IDATA nanos));
+extern HY_CFUNC void VMCALL
+hythread_resume PROTOTYPE((hythread_t thread));
+extern HY_CFUNC UDATA VMCALL 
+hythread_lib_clear_flags PROTOTYPE((UDATA flags));
+extern HY_CFUNC void VMCALL 
+hythread_priority_interrupt PROTOTYPE((hythread_t thread));
+extern HY_CFUNC void VMCALL NORETURN 
+hythread_exit PROTOTYPE((hythread_monitor_t monitor));
+extern HY_CFUNC IDATA VMCALL 
+hythread_monitor_exit_using_threadId PROTOTYPE((hythread_monitor_t monitor, hythread_t threadId));
+
+extern HY_CFUNC UDATA VMCALL 
+hythread_lib_get_flags PROTOTYPE(());
+extern HY_CFUNC IDATA VMCALL 
+hythread_monitor_notify PROTOTYPE((hythread_monitor_t monitor));
+extern HY_CFUNC void VMCALL 
+hythread_enable_stack_usage PROTOTYPE((UDATA enable));
+
+extern HY_CFUNC UDATA VMCALL 
+hythread_get_handle PROTOTYPE((hythread_t thread));
+
+extern HY_CFUNC UDATA VMCALL 
+hythread_get_stack_usage PROTOTYPE((hythread_t thread));
+
+extern HY_CFUNC I_64 VMCALL 
+hythread_get_cpu_time PROTOTYPE((hythread_t thread));
+
+extern HY_CFUNC UDATA VMCALL 
+hythread_get_stack_size PROTOTYPE((hythread_t thread));
+extern HY_CFUNC I_64 VMCALL 
+hythread_get_user_time PROTOTYPE((hythread_t thread));
+extern HY_CFUNC IDATA VMCALL hythread_get_os_priority PROTOTYPE((hythread_t thread, IDATA*
policy, IDATA *priority));
+extern HY_CFUNC UDATA VMCALL 
+hythread_get_flags PROTOTYPE((hythread_t thread, hythread_monitor_t* blocker));
+extern HY_CFUNC HyThreadMonitorTracing* VMCALL 
+hythread_monitor_get_tracing PROTOTYPE((hythread_monitor_t monitor));
+extern HY_CFUNC UDATA VMCALL 
+hythread_get_priority PROTOTYPE((hythread_t thread));
+extern HY_CFUNC void* VMCALL
+hythread_tls_get PROTOTYPE((hythread_t thread, hythread_tls_key_t key));
+extern HY_CFUNC char* VMCALL 
+hythread_monitor_get_name PROTOTYPE((hythread_monitor_t monitor));
+extern HY_CFUNC hythread_monitor_t VMCALL 
+hythread_monitor_walk PROTOTYPE((hythread_monitor_t monitor));
+struct RWMutex;
+typedef struct RWMutex* hythread_rwmutex_t;
+extern HY_CFUNC IDATA VMCALL
+hythread_rwmutex_enter_read PROTOTYPE((hythread_rwmutex_t mutex));
+extern HY_CFUNC IDATA VMCALL
+hythread_rwmutex_destroy PROTOTYPE((hythread_rwmutex_t mutex));
+extern HY_CFUNC IDATA VMCALL
+hythread_rwmutex_exit_read PROTOTYPE((hythread_rwmutex_t mutex));
+extern HY_CFUNC IDATA VMCALL
+hythread_rwmutex_exit_write PROTOTYPE((hythread_rwmutex_t mutex));
+extern HY_CFUNC IDATA VMCALL
+hythread_rwmutex_init PROTOTYPE((hythread_rwmutex_t* handle, UDATA flags, const char* name));
+extern HY_CFUNC IDATA VMCALL
+hythread_rwmutex_enter_write PROTOTYPE((hythread_rwmutex_t mutex));
+
+/* HyVMThreadHelpers*/
+#if !defined(_HYVMTHREADHELPERS_)
+#define _HYVMTHREADHELPERS_
+extern HY_CFUNC UDATA  VMCALL current_stack_depth ();
+extern HY_CFUNC void  VMCALL hythread_monitor_unpin ( hythread_monitor_t monitor, hythread_t
osThread);
+extern HY_CFUNC void  VMCALL hythread_monitor_pin ( hythread_monitor_t monitor, hythread_t
osThread);
+#endif /* _HYVMTHREADHELPERS_ */
+
+/* HyVMThreadSpinlocks*/
+#if !defined(_HYVMTHREADSPINLOCKS_)
+#define _HYVMTHREADSPINLOCKS_
+extern HY_CFUNC IDATA  VMCALL hythread_spinlock_acquire (hythread_t self, hythread_monitor_t
monitor);
+extern HY_CFUNC UDATA  VMCALL hythread_spinlock_swapState (hythread_monitor_t monitor, UDATA
newState);
+#endif /* _HYVMTHREADSPINLOCKS_ */
+
+#define hythread_global_monitor() (*(hythread_monitor_t*)hythread_global("global_monitor"))
+#define hythread_monitor_init(pMon,flags)  hythread_monitor_init_with_name(pMon,flags, #pMon)
+#define hythread_monitor_set_name(pMon,pName)
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* HYTHREAD_H */
+

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/linux.IA32/include/hyvmls.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/linux.IA32/include/hyvmls.h?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/linux.IA32/include/hyvmls.h
(added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/native-src/linux.IA32/include/hyvmls.h
Wed Nov 30 21:29:27 2005
@@ -0,0 +1,107 @@
+/* Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @file
+ * @ingroup VMLS
+ * @brief VM Local Storage Header
+ */
+
+#if !defined(HY_VMLS_H)
+#define HY_VMLS_H
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#include "hycomp.h"
+#include "jni.h"
+
+#define HY_VMLS_MAX_KEYS 256
+
+/**
+ * @struct HyVMLSFunctionTable
+ * The VM local storage function table.
+ */
+typedef struct HyVMLSFunctionTable {
+    UDATA  (JNICALL *HYVMLSAllocKeys)(JNIEnv * env, UDATA * pInitCount, ...) ;
+    void  (JNICALL *HYVMLSFreeKeys)(JNIEnv * env, UDATA * pInitCount, ...) ;
+    void*  (JNICALL *HyVMLSGet)(JNIEnv * env, void * key) ;
+    void*  (JNICALL *HyVMLSSet)(JNIEnv * env, void ** pKey, void * value) ;
+} HyVMLSFunctionTable;
+#define HYSIZEOF_HyVMLSFunctionTable 16
+
+/**
+ * @fn HyVMLSFunctionTable::HYVMLSAllocKeys
+ * Allocate one or more slots of VM local storage. 
+ *
+ * @code UDATA  JNICALL HYVMLSAllocKeys(JNIEnv * env, UDATA * pInitCount, ...); @endcode
+ *
+ * @param[in] env  A JNIEnv pointer
+ * @param[in] pInitCount  Pointer to the reference count for these slots
+ * @param[out] ...  Locations to store the allocated keys
+ *
+ * @return 0 on success, 1 on failure.
+ *
+ * @note Newly allocated VMLS slots contain NULL in all VMs.
+ */
+/**
+ * @fn HyVMLSFunctionTable::HYVMLSFreeKeys
+ * Destroy one or more slots of VM local storage. 
+ *
+ * @code void  JNICALL HYVMLSFreeKeys(JNIEnv * env, UDATA * pInitCount, ...); @endcode
+ *
+ * @param[in] env  A JNIEnv pointer
+ * @param[in] pInitCount  Pointer to the reference count for these slots
+ * @param[out] ...  Pointers to the allocated keys
+ */
+/**
+ * @fn HyVMLSFunctionTable::HyVMLSGet
+ * Retrieve the value in a VM local storage slot. 
+ *
+ * @code void*  JNICALL HyVMLSGet(JNIEnv * env, void * key); @endcode
+ *
+ * @param[in] env  JNIEnv pointer
+ * @param[in] key  The VMLS key
+ *
+ * @return The contents of the VM local storage slot in the VM that contains the specified
env
+ */
+/**
+ * @fn HyVMLSFunctionTable::HyVMLSSet
+ * Store a value into a VM local storage slot.
+ *
+ * @code void*  JNICALL HyVMLSSet(JNIEnv * env, void ** pKey, void * value); @endcode
+ *
+ * @param[in] env  JNIEnv pointer
+ * @param[in] pKey  Pointer to the VM local storage key
+ * @param[in] value  Value to store
+ *
+ * @return The value stored
+ */
+
+#if defined(USING_VMI)
+#define HY_VMLS_FNTBL(env) (*VMI_GetVMIFromJNIEnv(env))->GetVMLSFunctions(VMI_GetVMIFromJNIEnv(env))
+#else
+#define HY_VMLS_FNTBL(env) ((HyVMLSFunctionTable *) ((((void ***) (env))[offsetof(HyVMThread,javaVM)/sizeof(UDATA)])[offsetof(HyJavaVM,vmLocalStorageFunctions)/sizeof(UDATA)]))
+#endif
+
+#define HY_VMLS_GET(env, key) (HY_VMLS_FNTBL(env)->HyVMLSGet(env, (key)))
+#define HY_VMLS_SET(env, key, value) (HY_VMLS_FNTBL(env)->HyVMLSSet(env, &(key), (void
*) (value)))
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* HY_VMLS_H */



Mime
View raw message