change mempool hook parameter and fix the name mistake of rt_scheduler_sethook function.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@192 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
bernard.xiong 2009-12-04 09:37:14 +00:00
parent 84bf060294
commit af965befa9
2 changed files with 9 additions and 9 deletions

View File

@ -133,7 +133,7 @@ void rt_enter_critical(void);
void rt_exit_critical(void);
#ifdef RT_USING_HOOK
void rt_schedule_sethook(void (*hook)(rt_thread_t from, rt_thread_t to));
void rt_scheduler_sethook(void (*hook)(rt_thread_t from, rt_thread_t to));
#endif
/*@}*/
@ -157,8 +157,8 @@ void *rt_mp_alloc (rt_mp_t mp, rt_int32_t time);
void rt_mp_free (void *block);
#ifdef RT_USING_HOOK
void rt_mp_alloc_sethook(void (*hook)(void *block));
void rt_mp_free_sethook(void (*hook)(void *block));
void rt_mp_alloc_sethook(void (*hook)(struct rt_mempool* mp, void *block));
void rt_mp_free_sethook(void (*hook)(struct rt_mempool* mp, void *block));
#endif
#endif

View File

@ -24,8 +24,8 @@
#ifdef RT_USING_MEMPOOL
#ifdef RT_USING_HOOK
static void (*rt_mp_alloc_hook)(void *block);
static void (*rt_mp_free_hook)(void *block);
static void (*rt_mp_alloc_hook)(struct rt_mempool* mp, void *block);
static void (*rt_mp_free_hook)(struct rt_mempool* mp, void *block);
/**
* @addtogroup Hook
@ -38,7 +38,7 @@ static void (*rt_mp_free_hook)(void *block);
*
* @param hook the hook function
*/
void rt_mp_alloc_sethook(void (*hook)(void *block))
void rt_mp_alloc_sethook(void (*hook)(struct rt_mempool* mp, void *block))
{
rt_mp_alloc_hook = hook;
}
@ -49,7 +49,7 @@ void rt_mp_alloc_sethook(void (*hook)(void *block))
*
* @param hook the hook function
*/
void rt_mp_free_sethook(void (*hook)(void *block))
void rt_mp_free_sethook(void (*hook)(struct rt_mempool* mp, void *block))
{
rt_mp_free_hook = hook;
}
@ -344,7 +344,7 @@ void *rt_mp_alloc (rt_mp_t mp, rt_int32_t time)
rt_hw_interrupt_enable(level);
#ifdef RT_USING_HOOK
if (rt_mp_alloc_hook != RT_NULL) rt_mp_alloc_hook((rt_uint8_t*)(block_ptr + sizeof(rt_uint8_t*)));
if (rt_mp_alloc_hook != RT_NULL) rt_mp_alloc_hook(mp, (rt_uint8_t*)(block_ptr + sizeof(rt_uint8_t*)));
#endif
return (rt_uint8_t*)(block_ptr + sizeof(rt_uint8_t*));
@ -368,7 +368,7 @@ void rt_mp_free (void *block)
mp = (struct rt_mempool*) *block_ptr;
#ifdef RT_USING_HOOK
if (rt_mp_free_hook != RT_NULL) rt_mp_free_hook(block);
if (rt_mp_free_hook != RT_NULL) rt_mp_free_hook(mp, block);
#endif
/* disable interrupt */