diff options
author | jb <jb@FreeBSD.org> | 1998-03-09 04:46:26 +0000 |
---|---|---|
committer | jb <jb@FreeBSD.org> | 1998-03-09 04:46:26 +0000 |
commit | ff740b6b07e261e28dcf09e5665b289383e50d0f (patch) | |
tree | a412d641e2769948a9670a901129e4a41084e2fd /lib/libpthread/thread/thr_create.c | |
parent | e96cb731c14cdff67c6de83b4e96c943949f7f4c (diff) | |
download | FreeBSD-src-ff740b6b07e261e28dcf09e5665b289383e50d0f.zip FreeBSD-src-ff740b6b07e261e28dcf09e5665b289383e50d0f.tar.gz |
Add FreeBSD/Alpha code to initialise a jmpbuf for a created thread.
Change a bunch of __alpha references to __alpha__.
Diffstat (limited to 'lib/libpthread/thread/thr_create.c')
-rw-r--r-- | lib/libpthread/thread/thr_create.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/lib/libpthread/thread/thr_create.c b/lib/libpthread/thread/thr_create.c index 398ff21..da00e4d 100644 --- a/lib/libpthread/thread/thr_create.c +++ b/lib/libpthread/thread/thr_create.c @@ -117,9 +117,15 @@ _thread_create(pthread_t * thread, const pthread_attr_t * attr, if (parent == NULL) { /* Use the user start function: */ #if defined(__FreeBSD__) +#if defined(__alpha__) + new_thread->saved_jmp_buf[0]._jb[2] = (long) _thread_start; + new_thread->saved_jmp_buf[0]._jb[4 + R_RA] = 0; + new_thread->saved_jmp_buf[0]._jb[4 + R_T12] = (long) _thread_start; +#else new_thread->saved_jmp_buf[0]._jb[0] = (long) _thread_start; +#endif #elif defined(__NetBSD__) -#if defined(__alpha) +#if defined(__alpha__) new_thread->saved_jmp_buf[2] = (long) _thread_start; new_thread->saved_jmp_buf[4 + R_RA] = 0; new_thread->saved_jmp_buf[4 + R_T12] = (long) _thread_start; @@ -135,9 +141,15 @@ _thread_create(pthread_t * thread, const pthread_attr_t * attr, * function: */ #if defined(__FreeBSD__) +#if defined(__alpha__) + new_thread->saved_jmp_buf[0]._jb[2] = (long) _thread_start_sig_handler; + new_thread->saved_jmp_buf[0]._jb[4 + R_RA] = 0; + new_thread->saved_jmp_buf[0]._jb[4 + R_T12] = (long) _thread_start_sig_handler; +#else new_thread->saved_jmp_buf[0]._jb[0] = (int) _thread_start_sig_handler; +#endif #elif defined(__NetBSD__) -#if defined(__alpha) +#if defined(__alpha__) new_thread->saved_jmp_buf[2] = (long) _thread_start_sig_handler; new_thread->saved_jmp_buf[4 + R_RA] = 0; new_thread->saved_jmp_buf[4 + R_T12] = (long) _thread_start_sig_handler; @@ -151,9 +163,13 @@ _thread_create(pthread_t * thread, const pthread_attr_t * attr, /* The stack starts high and builds down: */ #if defined(__FreeBSD__) +#if defined(__alpha__) + new_thread->saved_jmp_buf[0]._jb[4 + R_SP] = (long) new_thread->stack + pattr->stacksize_attr - sizeof(double); +#else new_thread->saved_jmp_buf[0]._jb[2] = (int) (new_thread->stack + pattr->stacksize_attr - sizeof(double)); +#endif #elif defined(__NetBSD__) -#if defined(__alpha) +#if defined(__alpha__) new_thread->saved_jmp_buf[4 + R_SP] = (long) new_thread->stack + pattr->stacksize_attr - sizeof(double); #else new_thread->saved_jmp_buf[2] = (long) new_thread->stack + pattr->stacksize_attr - sizeof(double); |