From 2ad250e92d2978b56a9a552a0b55c1f8046312cb Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 6 Aug 2013 14:46:24 +0200 Subject: 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. --- cpukit/posix/src/key.c | 48 +++++++++++++---------------------- cpukit/posix/src/keycreate.c | 2 +- cpukit/posix/src/keydelete.c | 2 +- cpukit/posix/src/keyfreememory.c | 7 ++--- cpukit/posix/src/keygetspecific.c | 2 +- cpukit/posix/src/keyrundestructors.c | 7 ++--- cpukit/posix/src/keysetspecific.c | 15 +++-------- cpukit/posix/src/pthread.c | 2 +- cpukit/posix/src/pthreadinitthreads.c | 1 - 9 files changed, 29 insertions(+), 57 deletions(-) (limited to 'cpukit/posix/src') 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 -#include -#include -#include -#include - -#include -#include -#include +#include +#include +#include #include -#include -#include -#include -#include - -/* 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 @@ -83,23 +69,10 @@ int _POSIX_Keys_Key_value_lookup_tree_compare_function( return 0; } -/** - * @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 = @@ -115,6 +88,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 */ 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 #include #include -#include +#include /** * 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 #include #include -#include +#include /* * 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 -#include -#include -#include -#include +#include +#include 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 #include #include -#include +#include /* * 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 -#include -#include -#include -#include +#include #include +#include /* * _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 -#include -#include -#include -#include - -#include -#include -#include -#include -#include +#include #include +#include + +#include /* * 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 #include #include -#include +#include #include #include 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 #include #include -#include #include void _POSIX_Threads_Initialize_user_threads_body(void) -- cgit v1.2.3