OK one more try at getting it right ...
This commit is contained in:
parent
5c7d4e081c
commit
e123d2840c
@ -2,20 +2,21 @@
|
||||
|
||||
LIB=pthread
|
||||
INSTALL_PIC_ARCHIVE= no
|
||||
CPPFLAGS+= -g -DPTHREAD_KERNEL -I${.CURDIR}/include -I${.CURDIR}/arch/${MACHINE}
|
||||
CPPFLAGS+= -g -DPTHREAD_KERNEL -I. -I${.CURDIR}/include -I${.CURDIR}/arch/${MACHINE}
|
||||
CFLAGS+= ${CPPFLAGS}
|
||||
|
||||
.include "${.CURDIR}/arch/${MACHINE}/Makefile.inc"
|
||||
.include "${.CURDIR}/pthreads/Makefile.inc"
|
||||
|
||||
all: preall
|
||||
all: includelinks
|
||||
|
||||
preall:
|
||||
if [ ! -e include/pthread ]; then; \
|
||||
ln -s . include/pthread; \
|
||||
fi
|
||||
if [ ! -e arch/${MACHINE}/pthread ]; then; \
|
||||
ln -s . arch/${MACHINE}/pthread; \
|
||||
beforedepend: includelinks
|
||||
|
||||
CLEANFILES+=pthread
|
||||
|
||||
includelinks:
|
||||
if [ ! -e pthread ]; then; \
|
||||
ln -s ${.CURDIR}/include pthread; \
|
||||
fi
|
||||
|
||||
.include <bsd.lib.mk>
|
||||
|
@ -4,9 +4,6 @@
|
||||
*/
|
||||
|
||||
#include <pthread/copyright.h>
|
||||
#include <unistd.h>
|
||||
#include <setjmp.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
/*
|
||||
* The first machine dependent functions are the SEMAPHORES
|
||||
@ -27,53 +24,8 @@ temp; \
|
||||
|
||||
#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
|
||||
|
||||
/*
|
||||
* New types
|
||||
*/
|
||||
typedef long semaphore;
|
||||
|
||||
#define SIGMAX 31
|
||||
|
||||
/*
|
||||
* New Strutures
|
||||
*/
|
||||
struct machdep_pthread {
|
||||
void *(*start_routine)(void *);
|
||||
void *start_argument;
|
||||
void *machdep_stack;
|
||||
struct itimerval machdep_timer;
|
||||
jmp_buf machdep_state;
|
||||
};
|
||||
|
||||
/*
|
||||
* Static machdep_pthread initialization values.
|
||||
* For initial thread only.
|
||||
*/
|
||||
#define MACHDEP_PTHREAD_INIT \
|
||||
{ NULL, NULL, NULL, { { 0, 0 }, { 0, 0 } }, 0 }
|
||||
|
||||
/*
|
||||
* Minimum stack size
|
||||
*/
|
||||
#define PTHREAD_STACK_MIN 1024
|
||||
|
||||
/*
|
||||
* Some fd flag defines that are necessary to distinguish between posix
|
||||
* behavior and bsd4.3 behavior.
|
||||
*/
|
||||
#define __FD_NONBLOCK O_NONBLOCK
|
||||
|
||||
/*
|
||||
* New functions
|
||||
*/
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#if defined(PTHREAD_KERNEL)
|
||||
|
||||
int semaphore_text_and_set __P((semaphore *));
|
||||
int machdep_save_state __P((void));
|
||||
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
@ -7,10 +7,7 @@
|
||||
|
||||
|
||||
FILES= cond.h copyright.h fd.h fd_pipe.h kernel.h mutex.h posix.h \
|
||||
pthread.h pthread_attr.h queue.h util.h
|
||||
|
||||
# Machine dependent header file
|
||||
MFILE= ${.CURDIR}/arch/${MACHINE}/machdep.h
|
||||
pthread.h pthread_attr.h queue.h util.h engine.h
|
||||
|
||||
realinstall:
|
||||
if [ ! -d ${DESTDIR}/usr/include/pthread ]; then \
|
||||
@ -21,8 +18,6 @@ realinstall:
|
||||
cmp -s $$i ${DESTDIR}/usr/include/pthread/$$i || \
|
||||
install -c -m 644 $$i ${DESTDIR}/usr/include/$$i; \
|
||||
done
|
||||
cmp -s ${MFILE} ${DESTDIR}/usr/include/pthread/machdep.h || \
|
||||
install -c -m 644 ${MFILE} ${DESTDIR}/usr/include/pthread/machdep.h
|
||||
rm -rf ${DESTDIR}/usr/include/pthread.h
|
||||
ln -s /usr/include/pthread/pthread.h ${DESTDIR}/usr/include/pthread.h
|
||||
@chown -R ${BINOWN}:${BINGRP} ${DESTDIR}/usr/include/pthread
|
||||
|
59
lib/libpthread/include/engine.h
Normal file
59
lib/libpthread/include/engine.h
Normal file
@ -0,0 +1,59 @@
|
||||
/* ==== engine.h ============================================================
|
||||
* Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
|
||||
*
|
||||
*/
|
||||
|
||||
#include <pthread/copyright.h>
|
||||
#include <unistd.h>
|
||||
#include <setjmp.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#if defined(PTHREAD_KERNEL)
|
||||
#include "machdep.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* New types
|
||||
*/
|
||||
typedef long semaphore;
|
||||
|
||||
#define SIGMAX 31
|
||||
|
||||
/*
|
||||
* New Strutures
|
||||
*/
|
||||
struct machdep_pthread {
|
||||
void *(*start_routine)(void *);
|
||||
void *start_argument;
|
||||
void *machdep_stack;
|
||||
struct itimerval machdep_timer;
|
||||
jmp_buf machdep_state;
|
||||
};
|
||||
|
||||
/*
|
||||
* Static machdep_pthread initialization values.
|
||||
* For initial thread only.
|
||||
*/
|
||||
#define MACHDEP_PTHREAD_INIT \
|
||||
{ NULL, NULL, NULL, { { 0, 0 }, { 0, 0 } }, 0 }
|
||||
|
||||
/*
|
||||
* Some fd flag defines that are necessary to distinguish between posix
|
||||
* behavior and bsd4.3 behavior.
|
||||
*/
|
||||
#define __FD_NONBLOCK O_NONBLOCK
|
||||
|
||||
/*
|
||||
* New functions
|
||||
*/
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#if defined(PTHREAD_KERNEL)
|
||||
|
||||
int semaphore_text_and_set __P((semaphore *));
|
||||
int machdep_save_state __P((void));
|
||||
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#include <pthread/copyright.h>
|
||||
#include <pthread/machdep.h>
|
||||
#include <pthread/engine.h>
|
||||
#include <pthread/kernel.h>
|
||||
#include <pthread/queue.h>
|
||||
#include <pthread/mutex.h>
|
||||
|
Loading…
Reference in New Issue
Block a user