From 4bd258ce7bf0ce2ccb4e015d52828494f73f740c Mon Sep 17 00:00:00 2001 From: "bernard.xiong" Date: Sun, 13 Sep 2009 23:34:52 +0000 Subject: [PATCH] remove fast event git-svn-id: https://rt-thread.googlecode.com/svn/trunk@46 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- include/rtdef.h | 23 ++--------------------- include/rtthread.h | 14 -------------- src/object.c | 29 +++++++++++------------------ 3 files changed, 13 insertions(+), 53 deletions(-) diff --git a/include/rtdef.h b/include/rtdef.h index 2c21f5a258..027440fc48 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -169,7 +169,6 @@ typedef struct rt_object* rt_object_t; /* Type for kernel objects. */ * - Process * - Semaphore * - Mutex - * - FastEvent * - Event * - MailBox * - MessageQueue @@ -188,9 +187,6 @@ enum rt_object_class_type #ifdef RT_USING_MUTEX RT_Object_Class_Mutex, /* The object is a mutex. */ #endif -#ifdef RT_USING_FASTEVENT - RT_Object_Class_FastEvent, /* The object is a fast event. */ -#endif #ifdef RT_USING_EVENT RT_Object_Class_Event, /* The object is a event. */ #endif @@ -323,7 +319,7 @@ struct rt_thread #endif rt_uint32_t number_mask; -#if defined(RT_USING_EVENT) || defined(RT_USING_FASTEVENT) +#if defined(RT_USING_EVENT) /* thread event */ rt_uint32_t event_set; rt_uint8_t event_info; @@ -424,27 +420,12 @@ struct rt_mutex typedef struct rt_mutex* rt_mutex_t; #endif -#if defined(RT_USING_EVENT) || defined(RT_USING_FASTEVENT) +#if defined(RT_USING_EVENT) #define RT_EVENT_FLAG_AND 0x01 #define RT_EVENT_FLAG_OR 0x02 #define RT_EVENT_FLAG_CLEAR 0x04 #endif -#ifdef RT_USING_FASTEVENT -/* - * fast_event - */ -struct rt_fast_event -{ - struct rt_object parent; - - rt_uint32_t set; /* event set. */ - - rt_list_t thread_list[RT_EVENT_LENGTH]; /* threads blocked on this resource. */ -}; -typedef struct rt_fast_event* rt_fast_event_t; -#endif - #ifdef RT_USING_EVENT /* * event diff --git a/include/rtthread.h b/include/rtthread.h index 540c1aacdb..97d28f5045 100644 --- a/include/rtthread.h +++ b/include/rtthread.h @@ -204,20 +204,6 @@ rt_err_t rt_mutex_release(rt_mutex_t mutex); rt_err_t rt_mutex_control(rt_mutex_t mutex, rt_uint8_t cmd, void* arg); #endif -#ifdef RT_USING_FASTEVENT -/* - * fast_event interface - */ -rt_err_t rt_fast_event_init(rt_fast_event_t event, const char* name, rt_uint8_t flag); -rt_err_t rt_fast_event_detach(rt_fast_event_t event); -rt_fast_event_t rt_fast_event_create (const char* name, rt_uint8_t flag); -rt_err_t rt_fast_event_delete (rt_fast_event_t event); - -rt_err_t rt_fast_event_send(rt_fast_event_t event, rt_uint8_t bit); -rt_err_t rt_fast_event_recv(rt_fast_event_t event, rt_uint8_t bit, rt_uint8_t opt, rt_int32_t timeout); -rt_err_t rt_fast_event_control (rt_fast_event_t event, rt_uint8_t cmd, void* arg); -#endif - #ifdef RT_USING_EVENT /* * event interface diff --git a/src/object.c b/src/object.c index d3c6828bd8..0655382350 100644 --- a/src/object.c +++ b/src/object.c @@ -38,7 +38,7 @@ void (*rt_object_put_hook)(struct rt_object* object); /** * This function will set a hook function, which will be invoked when object * attaches to kernel object system. - * + * * @param hook the hook function */ void rt_object_attach_sethook(void (*hook)(struct rt_object* object)) @@ -49,7 +49,7 @@ void rt_object_attach_sethook(void (*hook)(struct rt_object* object)) /** * This function will set a hook function, which will be invoked when object * detaches from kernel object system. - * + * * @param hook the hook function */ void rt_object_detach_sethook(void (*hook)(struct rt_object* object)) @@ -60,14 +60,14 @@ void rt_object_detach_sethook(void (*hook)(struct rt_object* object)) /** * This function will set a hook function, which will be invoked when object * is taken from kernel object system. - * - * The object is taken means that + * + * The object is taken means that * semaphore - semaphore is taken by thread * mutex - mutex is taken by thread - * event/fast event - event/fast event is received by thread + * event - event is received by thread * mailbox - mail is received by thread * message queue - message is received by thread - * + * * @param hook the hook function */ void rt_object_trytake_sethook(void (*hook)(struct rt_object* object)) @@ -78,15 +78,15 @@ void rt_object_trytake_sethook(void (*hook)(struct rt_object* object)) /** * This function will set a hook function, which will be invoked when object * have been taken from kernel object system. - * - * The object have been taken means that + * + * The object have been taken means that * semaphore - semaphore have been taken by thread * mutex - mutex have been taken by thread - * event/fast event - event/fast event have been received by thread + * event - event have been received by thread * mailbox - mail have been received by thread * message queue - message have been received by thread * timer - timer is started - * + * * @param hook the hook function */ void rt_object_take_sethook(void (*hook)(struct rt_object* object)) @@ -97,7 +97,7 @@ void rt_object_take_sethook(void (*hook)(struct rt_object* object)) /** * This function will set a hook function, which will be invoked when object * is put to kernel object system. - * + * * @param hook the hook function */ void rt_object_put_sethook(void (*hook)(struct rt_object* object)) @@ -142,13 +142,6 @@ void rt_system_object_init(void) rt_object_container[RT_Object_Class_Mutex].type = RT_Object_Class_Mutex; #endif -#ifdef RT_USING_FASTEVENT - /* init object container - fast event */ - rt_list_init(&(rt_object_container[RT_Object_Class_FastEvent].object_list)); - rt_object_container[RT_Object_Class_FastEvent].object_size = sizeof(struct rt_fast_event); - rt_object_container[RT_Object_Class_FastEvent].type = RT_Object_Class_FastEvent; -#endif - #ifdef RT_USING_EVENT /* init object container - event */ rt_list_init(&(rt_object_container[RT_Object_Class_Event].object_list));