diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-08-06 14:46:24 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-08-06 15:47:57 +0200 |
commit | 2ad250e92d2978b56a9a552a0b55c1f8046312cb (patch) | |
tree | a1aa5613b23bcb54c995546be8591430e3304aea /cpukit/posix/src | |
parent | psxtests/psx14: Include missing header file (diff) | |
download | rtems-2ad250e92d2978b56a9a552a0b55c1f8046312cb.tar.bz2 |
posix: Create key implementation header
Move implementation specific parts of key.h and key.inl into new header
file keyimpl.h. The key.h contains now only the application visible
API.
Diffstat (limited to 'cpukit/posix/src')
-rw-r--r-- | cpukit/posix/src/key.c | 48 | ||||
-rw-r--r-- | cpukit/posix/src/keycreate.c | 2 | ||||
-rw-r--r-- | cpukit/posix/src/keydelete.c | 2 | ||||
-rw-r--r-- | cpukit/posix/src/keyfreememory.c | 7 | ||||
-rw-r--r-- | cpukit/posix/src/keygetspecific.c | 2 | ||||
-rw-r--r-- | cpukit/posix/src/keyrundestructors.c | 7 | ||||
-rw-r--r-- | cpukit/posix/src/keysetspecific.c | 15 | ||||
-rw-r--r-- | cpukit/posix/src/pthread.c | 2 | ||||
-rw-r--r-- | cpukit/posix/src/pthreadinitthreads.c | 1 |
9 files changed, 29 insertions, 57 deletions
diff --git a/cpukit/posix/src/key.c b/cpukit/posix/src/key.c index 2bb415c4d5..99654c2da4 100644 --- a/cpukit/posix/src/key.c +++ b/cpukit/posix/src/key.c @@ -19,24 +19,10 @@ #include "config.h" #endif -#include <errno.h> -#include <limits.h> -#include <pthread.h> -#include <string.h> -#include <limits.h> - -#include <rtems/system.h> -#include <rtems/config.h> -#include <rtems/score/thread.h> +#include <rtems/posix/keyimpl.h> +#include <rtems/posix/config.h> +#include <rtems/score/chainimpl.h> #include <rtems/score/wkspace.h> -#include <rtems/posix/key.h> -#include <rtems/score/rbtree.h> -#include <rtems/score/chain.h> -#include <rtems/score/freechain.h> - -/* forward declarations to avoid warnings */ -void _POSIX_Keys_Keypool_init(void); -void _POSIX_Keys_Freechain_init(Freechain_Control *freechain); /** * @brief This routine compares the rbtree node by comparing POSIX key first @@ -84,22 +70,9 @@ int _POSIX_Keys_Key_value_lookup_tree_compare_function( } /** - * @brief This routine does keypool initialize, keypool contains all - * POSIX_Keys_Key_value_pair - */ - -void _POSIX_Keys_Keypool_init(void) -{ - _Freechain_Initialize((Freechain_Control *)&_POSIX_Keys_Keypool, - &_POSIX_Keys_Freechain_extend); - - _POSIX_Keys_Freechain_init((Freechain_Control *)&_POSIX_Keys_Keypool); -} - -/** * @brief This routine does user side freechain initialization */ -void _POSIX_Keys_Freechain_init(Freechain_Control *freechain) +static void _POSIX_Keys_Freechain_init(Freechain_Control *freechain) { POSIX_Keys_Freechain *psx_freechain_p = (POSIX_Keys_Freechain *)freechain; psx_freechain_p->bump_count = @@ -116,6 +89,19 @@ void _POSIX_Keys_Freechain_init(Freechain_Control *freechain) } /** + * @brief This routine does keypool initialize, keypool contains all + * POSIX_Keys_Key_value_pair + */ + +static void _POSIX_Keys_Keypool_init(void) +{ + _Freechain_Initialize((Freechain_Control *)&_POSIX_Keys_Keypool, + &_POSIX_Keys_Freechain_extend); + + _POSIX_Keys_Freechain_init((Freechain_Control *)&_POSIX_Keys_Keypool); +} + +/** * @brief This routine is user defined freechain extension handle */ bool _POSIX_Keys_Freechain_extend(Freechain_Control *freechain) diff --git a/cpukit/posix/src/keycreate.c b/cpukit/posix/src/keycreate.c index 349e88378a..4a0f7842c2 100644 --- a/cpukit/posix/src/keycreate.c +++ b/cpukit/posix/src/keycreate.c @@ -26,7 +26,7 @@ #include <rtems/system.h> #include <rtems/score/thread.h> #include <rtems/score/wkspace.h> -#include <rtems/posix/key.h> +#include <rtems/posix/keyimpl.h> /** * 17.1.1 Thread-Specific Data Key Create, P1003.1c/Draft 10, p. 163 diff --git a/cpukit/posix/src/keydelete.c b/cpukit/posix/src/keydelete.c index c3d3da1a3b..5863a40f02 100644 --- a/cpukit/posix/src/keydelete.c +++ b/cpukit/posix/src/keydelete.c @@ -26,7 +26,7 @@ #include <rtems/system.h> #include <rtems/score/thread.h> #include <rtems/score/wkspace.h> -#include <rtems/posix/key.h> +#include <rtems/posix/keyimpl.h> /* * 17.1.3 Thread-Specific Data Key Deletion, P1003.1c/Draft 10, p. 167 diff --git a/cpukit/posix/src/keyfreememory.c b/cpukit/posix/src/keyfreememory.c index c42616dcb0..d971d0a95e 100644 --- a/cpukit/posix/src/keyfreememory.c +++ b/cpukit/posix/src/keyfreememory.c @@ -19,11 +19,8 @@ #include "config.h" #endif -#include <rtems/system.h> -#include <rtems/score/thread.h> -#include <rtems/score/wkspace.h> -#include <rtems/score/rbtree.h> -#include <rtems/posix/key.h> +#include <rtems/posix/keyimpl.h> +#include <rtems/score/chainimpl.h> void _POSIX_Keys_Free_memory( POSIX_Keys_Control *the_key diff --git a/cpukit/posix/src/keygetspecific.c b/cpukit/posix/src/keygetspecific.c index 88e084ee96..568a98cf71 100644 --- a/cpukit/posix/src/keygetspecific.c +++ b/cpukit/posix/src/keygetspecific.c @@ -28,7 +28,7 @@ #include <rtems/score/thread.h> #include <rtems/score/wkspace.h> #include <rtems/score/rbtree.h> -#include <rtems/posix/key.h> +#include <rtems/posix/keyimpl.h> /* * 17.1.2 Thread-Specific Data Management, P1003.1c/Draft 10, p. 165 diff --git a/cpukit/posix/src/keyrundestructors.c b/cpukit/posix/src/keyrundestructors.c index 7e3c88fdb6..d151f4f5ae 100644 --- a/cpukit/posix/src/keyrundestructors.c +++ b/cpukit/posix/src/keyrundestructors.c @@ -21,12 +21,9 @@ #include "config.h" #endif -#include <rtems/system.h> -#include <rtems/score/thread.h> -#include <rtems/score/wkspace.h> -#include <rtems/score/chain.h> -#include <rtems/posix/key.h> +#include <rtems/posix/keyimpl.h> #include <rtems/posix/threadsup.h> +#include <rtems/score/chainimpl.h> /* * _POSIX_Keys_Run_destructors diff --git a/cpukit/posix/src/keysetspecific.c b/cpukit/posix/src/keysetspecific.c index f527fe1ee4..4a1adb68b5 100644 --- a/cpukit/posix/src/keysetspecific.c +++ b/cpukit/posix/src/keysetspecific.c @@ -19,18 +19,11 @@ #include "config.h" #endif -#include <errno.h> -#include <limits.h> -#include <pthread.h> -#include <string.h> -#include <stddef.h> - -#include <rtems/system.h> -#include <rtems/score/thread.h> -#include <rtems/score/wkspace.h> -#include <rtems/score/rbtree.h> -#include <rtems/posix/key.h> +#include <rtems/posix/keyimpl.h> #include <rtems/posix/threadsup.h> +#include <rtems/score/chainimpl.h> + +#include <errno.h> /* * 17.1.2 Thread-Specific Data Management, P1003.1c/Draft 10, p. 165 diff --git a/cpukit/posix/src/pthread.c b/cpukit/posix/src/pthread.c index 13f7525c75..408bb07dc4 100644 --- a/cpukit/posix/src/pthread.c +++ b/cpukit/posix/src/pthread.c @@ -36,7 +36,7 @@ #include <rtems/posix/priorityimpl.h> #include <rtems/posix/psignalimpl.h> #include <rtems/posix/config.h> -#include <rtems/posix/key.h> +#include <rtems/posix/keyimpl.h> #include <rtems/posix/time.h> #include <rtems/score/timespec.h> diff --git a/cpukit/posix/src/pthreadinitthreads.c b/cpukit/posix/src/pthreadinitthreads.c index 9f2f468d8c..961105c669 100644 --- a/cpukit/posix/src/pthreadinitthreads.c +++ b/cpukit/posix/src/pthreadinitthreads.c @@ -32,7 +32,6 @@ #include <rtems/posix/pthreadimpl.h> #include <rtems/posix/priorityimpl.h> #include <rtems/posix/config.h> -#include <rtems/posix/key.h> #include <rtems/posix/time.h> void _POSIX_Threads_Initialize_user_threads_body(void) |