- enable arm archs

- fix up arm/green thread patches (kurt/dale)
- remove unused native thread patches
- fix WANTLIB

okay drahn@
This commit is contained in:
kurt 2005-07-14 17:29:08 +00:00
parent 08adb158c2
commit 36e37cb41e
7 changed files with 83 additions and 181 deletions

View File

@ -1,14 +1,14 @@
# $OpenBSD: Makefile,v 1.12 2005/06/14 20:10:58 espie Exp $
# $OpenBSD: Makefile,v 1.13 2005/07/14 17:29:08 kurt Exp $
# $FreeBSD: ports/java/jdk12/Makefile,v 1.11 2002/08/19 20:47:04 glewis Exp $
ONLY_FOR_ARCHS= i386 powerpc
ONLY_FOR_ARCHS= arm i386 powerpc
COMMENT= "Java2(TM) Standard Edition Dev Kit v${V}"
COMMENT-jre= "Java2(TM) Standard Edition Runtime Environment v${V}"
V= 1.3.1
DISTNAME= j2sdk-1_3_1-src
PKGNAME= jdk-${V}p0
PKGNAME-jre= jre-${V}p0
PKGNAME= jdk-${V}p1
PKGNAME-jre= jre-${V}p1
CATEGORIES= devel/jdk java
@ -86,7 +86,7 @@ PATCH_LIST= patch-* pack-patch-*
. endif
.endif
WANTLIB= ICE SM X11 Xext Xp Xt Xtst c dps m ossaudio pthread
WANTLIB= ICE SM X11 Xext Xp Xt Xtst c dps m ossaudio
ALL_TARGET= all images

View File

@ -1,16 +1,31 @@
$OpenBSD: patch-j2sdk1_3_1_src_solaris_hpi_green_threads_include_context_md_bsd_h,v 1.1 2005/06/03 17:27:54 kurt Exp $
--- j2sdk1.3.1/src/solaris/hpi/green_threads/include/context_md_bsd.h.orig Fri May 27 17:32:10 2005
+++ j2sdk1.3.1/src/solaris/hpi/green_threads/include/context_md_bsd.h Fri May 27 17:38:09 2005
@@ -59,7 +59,7 @@ typedef struct lj_ucontext {
# endif
#define BSD_STACK_POINTER 34
-#elif defined(__arm32__)
+#elif defined(__arm32__) || defined(__arm__)
#define BSD_FPU_MASK 0
$OpenBSD: patch-j2sdk1_3_1_src_solaris_hpi_green_threads_include_context_md_bsd_h,v 1.2 2005/07/14 17:29:09 kurt Exp $
--- j2sdk1.3.1/src/solaris/hpi/green_threads/include/context_md_bsd.h.orig Thu Jul 7 15:44:51 2005
+++ j2sdk1.3.1/src/solaris/hpi/green_threads/include/context_md_bsd.h Sat Jul 9 18:09:22 2005
@@ -26,6 +26,9 @@ typedef struct lj_ucontext {
context_jmpbuf_t jmpbuf;
#if defined(i386)
char floatbuf[108];
+#elif defined(__arm__)
+ unsigned int pc; /* args for death func are stored here */
+ unsigned int arg; /* args for death func are stored here */
#elif defined(__powerpc__)
/* We pretend the fp status & ctl reg (fpscr) is 64 bits */
unsigned int pc; /* args for death func are stored here */
@@ -65,6 +68,13 @@ typedef struct lj_ucontext {
#define BSD_SIGNAL_MASK 21
@@ -90,7 +90,7 @@ typedef lj_ucontext_t inner_ucontext_t;
#define BSD_STACK_POINTER 3
+#elif defined(__arm__)
+
+#define BSD_MAGIC 0
+#define BSD_STACK_POINTER 23
+#define BSD_LINK_REGISTER 24
+#define BSD_SIGNAL_MASK 25
+
#elif defined(__powerpc__)
/* jmpbuf contains sigmask, then r8-31 where r11 is the LR
@@ -90,7 +100,7 @@ typedef lj_ucontext_t inner_ucontext_t;
typedef struct {
unsigned int unix_errno;
@ -19,3 +34,25 @@ $OpenBSD: patch-j2sdk1_3_1_src_solaris_hpi_green_threads_include_context_md_bsd_
void *current_sp;
#endif
inner_ucontext_t lj_ucontext;
@@ -200,6 +210,21 @@ extern int netbsd_siglongjmp(sigjmp_buf
(contextp)->unix_errno = errno; \
reschedule(); \
} \
+}
+#elif defined(__arm__)
+#define getcontext(lj_ucontextp) { \
+ sigsetjmp((lj_ucontextp)->jmpbuf, -1); \
+}
+
+#define setcontext(lj_ucontextp) { \
+ siglongjmp((lj_ucontextp)->jmpbuf, (int)lj_ucontextp); \
+}
+
+#define yieldContext(contextp) { \
+ if (!sigsetjmp((contextp)->lj_ucontext.jmpbuf, -1)) { \
+ (contextp)->unix_errno = errno; \
+ reschedule(); \
+ } \
}
#else
#error architecture unsupported

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-j2sdk1_3_1_src_solaris_hpi_green_threads_src_context_c,v 1.1 2005/06/03 17:27:54 kurt Exp $
--- j2sdk1.3.1/src/solaris/hpi/green_threads/src/context.c.orig Fri May 27 17:32:10 2005
+++ j2sdk1.3.1/src/solaris/hpi/green_threads/src/context.c Fri May 27 17:40:41 2005
$OpenBSD: patch-j2sdk1_3_1_src_solaris_hpi_green_threads_src_context_c,v 1.2 2005/07/14 17:29:09 kurt Exp $
--- j2sdk1.3.1/src/solaris/hpi/green_threads/src/context.c.orig Thu Jul 7 15:44:51 2005
+++ j2sdk1.3.1/src/solaris/hpi/green_threads/src/context.c Sat Jul 9 18:17:31 2005
@@ -183,7 +183,7 @@ currentStackPointer(sys_thread_t *tp)
#if (defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__))
context_t *context = &tp->mdcontext;
@ -10,7 +10,7 @@ $OpenBSD: patch-j2sdk1_3_1_src_solaris_hpi_green_threads_src_context_c,v 1.1 200
return (void *)CONTEXT(tp)->current_sp;
#elif defined(__NetBSD__) || defined(__OpenBSD__)
return (void *)(uc->jmpbuf[BSD_STACK_POINTER]);
@@ -579,7 +579,30 @@ initContext(lj_ucontext_t *uc, gstack_t
@@ -579,7 +579,35 @@ initContext(lj_ucontext_t *uc, gstack_t
uc->jmpbuf->_sjb[35] = (long)0xACEDBADD; /* magic number for longjmp */
}
@ -22,6 +22,7 @@ $OpenBSD: patch-j2sdk1_3_1_src_solaris_hpi_green_threads_src_context_c,v 1.1 200
+ void (*death_func)(void), unsigned int arg)
+{
+ unsigned char *sp;
+ int *p;
+
+ memset(uc, 0, sizeof(lj_ucontext_t));
+
@ -30,12 +31,16 @@ $OpenBSD: patch-j2sdk1_3_1_src_solaris_hpi_green_threads_src_context_c,v 1.1 200
+ /* Force sp to be double aligned! */
+ sp = (unsigned char *)((unsigned long)(sp) & ~7L);
+
+ /* We use registers on the Alpha to pass args to death_func. */
+ uc->jmpbuf->_sjb[2] = (long)death_func; /* sc_pc */
+ uc->jmpbuf->_sjb[20] = (long)pc; /* sc_regs[R_A0] */
+ uc->jmpbuf->_sjb[21] = (long)arg; /* sc_regs[R_A1] */
+ uc->jmpbuf->_sjb[34] = (long)sp; /* sc_regs[R_SP] */
+ uc->jmpbuf->_sjb[35] = (long)0xACEDBADD; /* magic number for longjmp */
+ uc->pc = pc;
+ uc->arg = arg;
+
+ uc->jmpbuf[BSD_MAGIC] = (unsigned int)0x4278f501;
+ uc->jmpbuf[BSD_LINK_REGISTER] = (unsigned int)death_func;
+ uc->jmpbuf[BSD_STACK_POINTER] = (unsigned int)sp;
+
+ /* break back chain */
+ p = (int *)sp;
+ *p-- = (int ) 0;
+}
+
+#elif (defined(__NetBSD__) || defined(__OpenBSD__)) && defined(__powerpc__)

View File

@ -1,12 +1,12 @@
$OpenBSD: patch-j2sdk1_3_1_src_solaris_hpi_green_threads_src_threads_md_c,v 1.1 2005/06/03 17:27:54 kurt Exp $
--- j2sdk1.3.1/src/solaris/hpi/green_threads/src/threads_md.c.orig Fri May 27 17:40:57 2005
+++ j2sdk1.3.1/src/solaris/hpi/green_threads/src/threads_md.c Fri May 27 17:42:24 2005
$OpenBSD: patch-j2sdk1_3_1_src_solaris_hpi_green_threads_src_threads_md_c,v 1.2 2005/07/14 17:29:09 kurt Exp $
--- j2sdk1.3.1/src/solaris/hpi/green_threads/src/threads_md.c.orig Thu Jul 7 15:44:51 2005
+++ j2sdk1.3.1/src/solaris/hpi/green_threads/src/threads_md.c Sat Jul 9 18:18:55 2005
@@ -80,8 +80,11 @@ sysThreadCheckStack()
{
sys_thread_t *tid = greenThreadSelf();
+ /* workaround a gcc optimization bug on powerpc */
+ char *currentSP = &currentSP;
+ char *currentSP = (char *)&currentSP;
+
/* Stacks grow toward lower addresses on Solaris... */
- if ((char *)(tid)->stack.base - (char *)&(tid) + STACK_REDZONE <
@ -14,12 +14,12 @@ $OpenBSD: patch-j2sdk1_3_1_src_solaris_hpi_green_threads_src_threads_md_c,v 1.1
tid->stack.size) {
return 1;
} else {
@@ -327,13 +330,13 @@ start_func(void (*func)(int), start_args
@@ -327,17 +330,21 @@ start_func(void (*func)(int), start_args
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__)
static void
-#if defined(__NetBSD__) && defined(__powerpc__)
+#if defined(__powerpc__)
+#if defined(__powerpc__) || defined(__arm__)
start_func(lj_ucontext_t *uc)
#else
start_func(void (*func)(int), start_args *args)
@ -30,3 +30,11 @@ $OpenBSD: patch-j2sdk1_3_1_src_solaris_hpi_green_threads_src_threads_md_c,v 1.1
start_args *args = (start_args *)uc->arg;
void (*func)() = (void (*)())uc->pc;
int arg = args->arg;
CONTEXT(args->tid)->current_sp = &func;
+#elif defined(__arm__)
+ start_args *args = (start_args *)uc->arg;
+ void (*func)() = (void (*)())uc->pc;
+ int arg = args->arg;
#else
int arg = args->arg;
#endif

View File

@ -1,23 +0,0 @@
$OpenBSD: patch-j2sdk1_3_1_src_solaris_hpi_native_threads_include_threads_md_h,v 1.1 2005/06/03 17:27:54 kurt Exp $
--- j2sdk1.3.1/src/solaris/hpi/native_threads/include/threads_md.h.orig Mon Nov 22 20:25:24 2004
+++ j2sdk1.3.1/src/solaris/hpi/native_threads/include/threads_md.h Tue Nov 23 14:47:07 2004
@@ -17,7 +17,7 @@
#include "porting.h"
-#ifdef sparc
+#if defined(sparc) || defined(sparc64)
#define N_TRACED_REGS 12
#elif i386
#define N_TRACED_REGS 7
@@ -25,6 +25,10 @@
#define N_TRACED_REGS 1
#elif m68k
#define N_TRACED_REGS 8
+#elif __arm__
+#define N_TRACED_REGS 16 /* XXX */
+#elif __powerpc__
+#define N_TRACED_REGS 12 /* XXX */
#else
#error "Can't define for N_TRACED_REGS"
#endif

View File

@ -1,93 +0,0 @@
$OpenBSD: patch-j2sdk1_3_1_src_solaris_hpi_native_threads_src_threads_bsd_c,v 1.1 2005/06/03 17:27:54 kurt Exp $
--- j2sdk1.3.1/src/solaris/hpi/native_threads/src/threads_bsd.c.orig Wed Apr 20 13:16:02 2005
+++ j2sdk1.3.1/src/solaris/hpi/native_threads/src/threads_bsd.c Wed Apr 20 13:16:04 2005
@@ -93,7 +93,22 @@ void np_initialize_thread(sys_thread_t *
/*
* Internal helper function to get stack information about specified thread.
*/
+#ifdef __OpenBSD__
static int
+get_stackinfo(pthread_t tid, void **addr, long *sizep)
+{
+ stack_t ss;
+
+ if (pthread_stackseg_np(tid, &ss) == 0) {
+ *addr = (void *)(ss.ss_sp) - ss.ss_size;
+ *sizep = (long)(ss.ss_size);
+ return SYS_OK;
+ } else {
+ return SYS_ERR; /* pthreads_stackinfo_np failed. */
+ }
+}
+#else
+static int
get_stackinfo(pthread_t tid, pthread_attr_t attr, void **addr, long *sizep)
{
size_t s;
@@ -113,14 +128,17 @@ err:
return (ret);
}
+#endif
-
/*
* Get the stack start address, and max stack size for the current thread.
*/
int
np_stackinfo(void **addr, long *sizep)
{
+#ifdef __OpenBSD__
+ return(get_stackinfo(pthread_self(), addr, sizep));
+#else
pthread_attr_t attr;
int ret = SYS_ERR;
@@ -130,6 +148,7 @@ np_stackinfo(void **addr, long *sizep)
}
return (ret);
+#endif
}
/*
@@ -193,13 +212,15 @@ record_thread_regs()
{
struct pthread *self = pthread_self();
sys_thread_t *tid = ThreadQueue;
- pthread_attr_t attr = NULL;
void *addr;
long sz;
int i;
+#ifndef __OpenBSD__
+ pthread_attr_t attr = NULL;
if (pthread_attr_init(&attr) != 0)
attr = NULL;
+#endif
for (i = 0; i < ActiveThreadCount && tid != NULL; i++, tid = tid->next) {
struct pthread *thread = tid->sys_thread;
@@ -214,7 +235,11 @@ record_thread_regs()
continue;
}
+#ifdef __OpenBSD__
+ if (get_stackinfo(thread, &addr, &sz) == SYS_OK)
+#else
if (get_stackinfo(thread, attr, &addr, &sz) == SYS_OK)
+#endif
tid->sp = addr;
else
tid->sp = 0;
@@ -247,8 +272,10 @@ record_thread_regs()
#endif
}
+#ifndef __OpenBSD__
if (attr != NULL)
pthread_attr_destroy(&attr);
+#endif
#ifdef DEBUG_BSD_NATIVE_THREADS
fprintf(stderr, "\n\n\nCalling GC thread\n\n\n"); fflush(stderr);

View File

@ -1,32 +0,0 @@
$OpenBSD: patch-j2sdk1_3_1_src_solaris_hpi_native_threads_src_threads_md_c,v 1.1 2005/06/03 17:27:54 kurt Exp $
--- j2sdk1.3.1/src/solaris/hpi/native_threads/src/threads_md.c.orig Mon Nov 8 11:41:54 2004
+++ j2sdk1.3.1/src/solaris/hpi/native_threads/src/threads_md.c Mon Nov 8 11:45:53 2004
@@ -77,11 +77,17 @@ static thread_key_t tid_key = (thread_ke
#ifdef __linux__
thread_key_t intrJmpbufkey;
static sigset_t squm = {{sigmask(SIGUSR1), 0, 0, 0}};
+#elif defined(__OpenBSD__)
+thread_key_t sigusr1Jmpbufkey;
+sigset_t sigusr1Mask = sigmask(SIGUSR1);
+static sigset_t squm = sigmask(SIGUSR1);
#else
thread_key_t sigusr1Jmpbufkey;
sigset_t sigusr1Mask = {{sigmask(SIGUSR1), 0, 0, 0}};
+static sigset_t squm = {{sigmask(SIGUSR1), 0, 0, 0}};
#endif
+
/*
* Thread C stack overflow check
*
@@ -148,10 +154,6 @@ sysThreadCheckStack()
return 0;
}
}
-
-#ifndef __linux__
-static sigset_t squm = {{sigmask(SIGUSR1), 0, 0, 0}};
-#endif
/*