02245e6120
to be instances where the kernel doesn't properly save and/or restore it. Use noupcall and nocompleted flags in the KSE mailbox. These require kernel changes to work which will be committed sometime later. Things still work without the changes. Remove the general kse entry function and use two different functions -- one for scope system threads and one for scope process threads. The scope system function is not yet enabled and we use the same function for all threads at the moment. Keep a copy of the KSE stack for the case that a KSE runs a scope system thread and uses the same stack as the thread (no upcalls are generated, so a separate stack isn't needed). This isn't enabled yet. Use a separate field for the KSE waiting flag. It isn't correct to use the mailbox flags field. The following fixes were provided by David Xu: o Initialize condition variable locks with thread versions of the low-level locking functions instead of the kse versions. o Enable threading before creating the first thread instead of after. o Don't enter critical regions when trying to malloc/free or call functions that malloc/free. o Take the scheduling lock when inheriting thread attributes. o Check the attribute's stack pointer instead of the attributes stack size for null when allocating a thread's stack. o Add a kseg reinit function so we don't have to destroy and then recreate the same lock. o Check the return value of kse_create() and return an appropriate error if it fails. o Don't forget to destroy a thread's locks when freeing it. o Examine the correct flags word for checking to see if a thread is in a synchronization queue. Things should now work on an SMP kernel.
38 lines
1.2 KiB
Makefile
38 lines
1.2 KiB
Makefile
# $FreeBSD$
|
|
#
|
|
# All library objects contain FreeBSD revision strings by default; they may be
|
|
# excluded as a space-saving measure. To produce a library that does
|
|
# not contain these strings, add -DSTRIP_FBSDID (see <sys/cdefs.h>) to CFLAGS
|
|
# below. Note, there are no IDs for syscall stubs whose sources are generated.
|
|
# To included legacy CSRG sccsid strings, add -DLIBC_SCCS and -DSYSLIBC_SCCS
|
|
# (for system call stubs) to CFLAGS below. -DSYSLIBC_SCCS affects just the
|
|
# system call stubs.
|
|
LIB=kse
|
|
SHLIB_MAJOR= 1
|
|
CFLAGS+=-DPTHREAD_KERNEL
|
|
CFLAGS+=-I${.CURDIR}/../libc/include -I${.CURDIR}/thread \
|
|
-I${.CURDIR}/../../include
|
|
CFLAGS+=-I${.CURDIR}/arch/${MACHINE_ARCH}/include
|
|
CFLAGS+=-I${.CURDIR}/sys
|
|
|
|
# Uncomment this if you want libpthread to contain debug information for
|
|
# thread locking.
|
|
CFLAGS+=-D_LOCK_DEBUG
|
|
#CFLAGS+= -g
|
|
|
|
.if ${MACHINE_ARCH} == "i386"
|
|
CFLAGS+=-DGS_HACK
|
|
.endif
|
|
|
|
# enable extra internal consistancy checks
|
|
CFLAGS+=-D_PTHREADS_INVARIANTS -Wall
|
|
|
|
AINC= -I${.CURDIR}/../libc/${MACHINE_ARCH} -I${.CURDIR}/thread
|
|
PRECIOUSLIB= yes
|
|
|
|
#.include "${.CURDIR}/man/Makefile.inc"
|
|
.include "${.CURDIR}/thread/Makefile.inc"
|
|
.include "${.CURDIR}/sys/Makefile.inc"
|
|
|
|
.include <bsd.lib.mk>
|