diff options
author | marcel <marcel@FreeBSD.org> | 2003-06-23 23:15:06 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2003-06-23 23:15:06 +0000 |
commit | 931dcaae39f62974707109a3d22e0bfa45f092f3 (patch) | |
tree | e9269a536ef75030f6ad84fd11c5713deb1f0026 /lib/libkse | |
parent | f71f9df706a36ec25fdbde2e8451b6109e64ea0d (diff) | |
download | FreeBSD-src-931dcaae39f62974707109a3d22e0bfa45f092f3.zip FreeBSD-src-931dcaae39f62974707109a3d22e0bfa45f092f3.tar.gz |
Untangle the inter-dependency of kse types and ksd types/functions
by moving the definition of struct ksd to pthread_md.h and removing
the inclusion of ksd.h from thr_private.h (which has the definition
of struct kse and kse_critical_t). This allows ksd.h to have inline
functions that use struct kse and kse_critical_t and generally
yields a cleaner implementation at the cost of not having all ksd
related types/definitions in one header.
Implement the ksd functionality on ia64 by using inline functions
and permanently remove ksd.c from the ia64 specific makefile.
This change does not clean up the i386 specific version of ksd.h.
NOTE: The ksd code on ia64 abuses the tp register in the same way
as it is abused in libthr in that it is incompatible with the
runtime specification. This will be address when support for TLS
hits the tree.
Diffstat (limited to 'lib/libkse')
-rw-r--r-- | lib/libkse/arch/i386/include/pthread_md.h | 12 | ||||
-rw-r--r-- | lib/libkse/arch/ia64/Makefile.inc | 2 | ||||
-rw-r--r-- | lib/libkse/arch/ia64/include/pthread_md.h | 6 | ||||
-rw-r--r-- | lib/libkse/thread/thr_kern.c | 2 | ||||
-rw-r--r-- | lib/libkse/thread/thr_private.h | 1 |
5 files changed, 20 insertions, 3 deletions
diff --git a/lib/libkse/arch/i386/include/pthread_md.h b/lib/libkse/arch/i386/include/pthread_md.h index cb5a344..ad0dfd6 100644 --- a/lib/libkse/arch/i386/include/pthread_md.h +++ b/lib/libkse/arch/i386/include/pthread_md.h @@ -51,4 +51,16 @@ extern int _thr_getcontext(ucontext_t *); #define THR_ALIGNBYTES 15 #define THR_ALIGN(td) (((unsigned)(td) + THR_ALIGNBYTES) & ~THR_ALIGNBYTES) + +/* + * KSE Specific Data. + */ +struct ksd { + int ldt; +#define KSDF_INITIALIZED 0x01 + long flags; + void *base; + long size; +}; + #endif diff --git a/lib/libkse/arch/ia64/Makefile.inc b/lib/libkse/arch/ia64/Makefile.inc index b3aafbd..4b8d9d2 100644 --- a/lib/libkse/arch/ia64/Makefile.inc +++ b/lib/libkse/arch/ia64/Makefile.inc @@ -2,4 +2,4 @@ .PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH} -SRCS+= ksd.c thr_enter_uts.S thr_switch.S +SRCS+= thr_enter_uts.S thr_switch.S diff --git a/lib/libkse/arch/ia64/include/pthread_md.h b/lib/libkse/arch/ia64/include/pthread_md.h index 93a179d..0965435 100644 --- a/lib/libkse/arch/ia64/include/pthread_md.h +++ b/lib/libkse/arch/ia64/include/pthread_md.h @@ -35,4 +35,10 @@ #define THR_ALIGNBYTES 15 #define THR_ALIGN(td) (((uintptr_t)(td) + THR_ALIGNBYTES) & ~THR_ALIGNBYTES) +/* KSE Specific Data. */ +struct ksd { + void *ksd_base; + int ksd_size; +}; + #endif /* _PTHREAD_MD_H_ */ diff --git a/lib/libkse/thread/thr_kern.c b/lib/libkse/thread/thr_kern.c index 2641890..d1a2006 100644 --- a/lib/libkse/thread/thr_kern.c +++ b/lib/libkse/thread/thr_kern.c @@ -52,8 +52,8 @@ __FBSDID("$FreeBSD$"); #include "atomic_ops.h" #include "thr_private.h" -#include "pthread_md.h" #include "libc_private.h" +#include "ksd.h" /*#define DEBUG_THREAD_KERN */ #ifdef DEBUG_THREAD_KERN diff --git a/lib/libkse/thread/thr_private.h b/lib/libkse/thread/thr_private.h index 092f86d..3672025 100644 --- a/lib/libkse/thread/thr_private.h +++ b/lib/libkse/thread/thr_private.h @@ -54,7 +54,6 @@ #include <pthread.h> #include <pthread_np.h> -#include "ksd.h" #include "lock.h" #include "pthread_md.h" |