classes for Java object access.
dnl Set optimization and debugging for all architectures and systems.
if test x"$CFLAGS" = "x"; then
- OPT_CFLAGS="-O0 -g"
+ OPT_CFLAGS="-g -O0"
else
OPT_CFLAGS=$CFLAGS
fi
if test x"$CXXFLAGS" = "x"; then
- OPT_CXXFLAGS="-O0 -g"
+ OPT_CXXFLAGS="-g -O0"
else
OPT_CXXFLAGS=$CXXFLAGS
fi
JAVA_ARCH="alpha"
;;
-arm | armv4 | armv4tl | armv5b | armv5l | armv5tejl )
+arm | armv4 | armv4tl | armv5b | armv5l | armv5tel | armv5tejl )
ARCH_DIR="arm"
ARCH_FLAGS="-D__ARM__"
JAVA_ARCH="arm"
i386 | i486 | i586 | i686 )
ARCH_DIR="i386"
- ARCH_FLAGS="-D__I386__"
+ ARCH_FLAGS="-m32 -D__I386__"
JAVA_ARCH="i386"
;;
powerpc )
ARCH_DIR="powerpc"
- ARCH_FLAGS="-D__POWERPC__"
+ ARCH_FLAGS="-m32 -D__POWERPC__"
JAVA_ARCH="ppc"
;;
powerpc64 )
ARCH_DIR="powerpc64"
- ARCH_FLAGS="-D__POWERPC64__"
+ ARCH_FLAGS="-m64 -D__POWERPC64__"
JAVA_ARCH="ppc64"
;;
from Boehm-GC. */
/*
- This is a very simple semaphore implementation for darwin. It
+ This is a very simple semaphore implementation for Darwin. It
is implemented in terms of pthreads calls so it isn't async signal
safe. This isn't a problem because signals aren't used to
- suspend threads on darwin.
+ suspend threads on Darwin.
*/
static int sem_init(sem_t *sem, int pshared, int value)
if (pshared)
assert(0);
- sem->value = value;
-
sem->mutex = new Mutex();
-
- if (pthread_cond_init(&sem->cond, NULL) < 0)
- return -1;
+ sem->cond = new Condition();
+ sem->value = value;
return 0;
}
static int sem_post(sem_t *sem)
{
sem->mutex->lock();
-
sem->value++;
-
- if (pthread_cond_signal(&sem->cond) < 0) {
- sem->mutex->unlock();
- return -1;
- }
-
+ sem->cond->signal();
sem->mutex->unlock();
return 0;
sem->mutex->lock();
while (sem->value == 0) {
-#error We cannot call pthread_cond_wait on a Mutex-class pointer.
- pthread_cond_wait(&sem->cond, &sem->mutex);
+ sem->cond->wait(sem->mutex);
}
sem->value--;
-
sem->mutex->unlock();
return 0;
static int sem_destroy(sem_t *sem)
{
- if (pthread_cond_destroy(&sem->cond) < 0)
- return -1;
-
+ delete sem->cond;
delete sem->mutex;
return 0;
/* Interrupt blocking system call using a signal. */
- pthread_kill(t->tid, Signal_THREAD_INTERRUPT);
+ pthread_kill(t->tid, Signal_INTERRUPT_SYSTEM_CALL);
t->waitcond->signal();
# include <mach/mach.h>
typedef struct {
- mutex_t mutex;
- pthread_cond_t cond;
+ Mutex* mutex;
+ Condition* cond;
int value;
} sem_t;
#if defined(ENABLE_THREADS)
/* SIGHUP handler for threads_thread_interrupt */
- signal_register_signal(Signal_THREAD_INTERRUPT, (functionptr) signal_handler_sighup, 0);
+ signal_register_signal(Signal_INTERRUPT_SYSTEM_CALL, (functionptr) signal_handler_sighup, 0);
#endif
#if defined(ENABLE_THREADS) && defined(ENABLE_GC_CACAO)
}
break;
}
+#else
+ default:
+ vm_abort("signal_thread_handler: Unknown signal %d", sig);
#endif
}
}
// Signal defines.
-#define Signal_THREAD_INTERRUPT SIGHUP
+#if defined(__LINUX__)
+// See openjdk/jdk/src/solaris/native/java/net/linux_close.c (sigWakeup)
+// See openjdk/jdk/src/solaris/native/sun/nio/ch/NativeThread.c (INTERRUPT_SIGNAL)
+# define Signal_INTERRUPT_SYSTEM_CALL (__SIGRTMAX - 2)
+#else
+# define Signal_INTERRUPT_SYSTEM_CALL SIGHUP
+#endif
/* function prototypes ********************************************************/
#endif
}
-#if defined(__LINUX__)
inline int os::scandir(const char *dir, struct dirent ***namelist, int(*filter)(const struct dirent *), int(*compar)(const void *, const void *))
+/*
#elif defined(__SOLARIS__)
inline int os::scandir(const char *dir, struct dirent ***namelist, int(*filter)(const struct dirent *), int(*compar)(const struct dirent **, const struct dirent **))
#elif defined(__IRIX__)
#else
inline int os::scandir(const char *dir, struct dirent ***namelist, int(*filter)(struct dirent *), int(*compar)(const void *, const void *))
#endif
+*/
{
#if defined(HAVE_SCANDIR)
+# if defined(__LINUX__)
return ::scandir(dir, namelist, filter, compar);
+# else
+ return ::scandir(dir, namelist, (int (*)(struct dirent*)) filter, compar);
+# endif
#else
# error scandir not available
#endif
*******************************************************************************/
-#if defined(__LINUX__)
static int scandir_filter(const struct dirent *a)
-#else
-static int scandir_filter(struct dirent *a)
-#endif
{
s4 namlen;