move src\kservice.h to include\rtservice.h.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2005 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
bernard.xiong@gmail.com 2012-03-22 06:11:44 +00:00
parent f71efa4281
commit 0f519b6721
12 changed files with 103 additions and 123 deletions

View File

@ -1,108 +1,102 @@
/* /*
* File : kservice.h * File : rtservice.h
* This file is part of RT-Thread RTOS * This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team * COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team
* *
* The license and distribution terms for this file may be * The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at * found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE * http://www.rt-thread.org/license/LICENSE
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
* 2006-03-16 Bernard the first version * 2006-03-16 Bernard the first version
* 2006-09-07 Bernard move the kservice APIs to rtthread.h * 2006-09-07 Bernard move the kservice APIs to rtthread.h
* 2007-06-27 Bernard fix the rt_list_remove bug * 2007-06-27 Bernard fix the rt_list_remove bug
*/ * 2012-03-22 Bernard rename kservice.h to rtservice.h
*/
#ifndef __RT_SERVICE_H__
#define __RT_SERVICE_H__ #ifdef __cplusplus
extern "C" {
#include <rtthread.h> #endif
#ifdef __cplusplus /**
extern "C" { * @addtogroup KernelService
#endif */
/** /*@{*/
* @addtogroup KernelService
*/ /**
* @brief initialize a list
/*@{*/ *
* @param l list to be initialized
/** */
* @brief initialize a list rt_inline void rt_list_init(rt_list_t *l)
* {
* @param l list to be initialized l->next = l->prev = l;
*/ }
rt_inline void rt_list_init(rt_list_t *l)
{ /**
l->next = l->prev = l; * @brief insert a node after a list
} *
* @param l list to insert it
/** * @param n new node to be inserted
* @brief insert a node after a list */
* rt_inline void rt_list_insert_after(rt_list_t *l, rt_list_t *n)
* @param l list to insert it {
* @param n new node to be inserted l->next->prev = n;
*/ n->next = l->next;
rt_inline void rt_list_insert_after(rt_list_t *l, rt_list_t *n)
{ l->next = n;
l->next->prev = n; n->prev = l;
n->next = l->next; }
l->next = n; /**
n->prev = l; * @brief insert a node before a list
} *
* @param n new node to be inserted
/** * @param l list to insert it
* @brief insert a node before a list */
* rt_inline void rt_list_insert_before(rt_list_t *l, rt_list_t *n)
* @param n new node to be inserted {
* @param l list to insert it l->prev->next = n;
*/ n->prev = l->prev;
rt_inline void rt_list_insert_before(rt_list_t *l, rt_list_t *n)
{ l->prev = n;
l->prev->next = n; n->next = l;
n->prev = l->prev; }
l->prev = n; /**
n->next = l; * @brief remove node from list.
} * @param n the node to remove from the list.
*/
/** rt_inline void rt_list_remove(rt_list_t *n)
* @brief remove node from list. {
* @param n the node to remove from the list. n->next->prev = n->prev;
*/ n->prev->next = n->next;
rt_inline void rt_list_remove(rt_list_t *n)
{ n->next = n->prev = n;
n->next->prev = n->prev; }
n->prev->next = n->next;
/**
n->next = n->prev = n; * @brief tests whether a list is empty
} * @param l the list to test.
*/
/** rt_inline int rt_list_isempty(const rt_list_t *l)
* @brief tests whether a list is empty {
* @param l the list to test. return l->next == l;
*/ }
rt_inline int rt_list_isempty(const rt_list_t *l)
{ /**
return l->next == l; * @brief get the struct for this entry
} * @param node the entry point
* @param type the type of structure
/** * @param member the name of list in structure
* @brief get the struct for this entry */
* @param node the entry point #define rt_list_entry(node, type, member) \
* @param type the type of structure ((type *)((char *)(node) - (unsigned long)(&((type *)0)->member)))
* @param member the name of list in structure
*/ /*@}*/
#define rt_list_entry(node, type, member) \
((type *)((char *)(node) - (unsigned long)(&((type *)0)->member))) #ifdef __cplusplus
}
/*@}*/ #endif
#ifdef __cplusplus
}
#endif
#endif

View File

@ -22,6 +22,7 @@
#include <rtdef.h> #include <rtdef.h>
#include <rtdebug.h> #include <rtdebug.h>
#include <rtservice.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

View File

@ -14,7 +14,6 @@
*/ */
#include <rtthread.h> #include <rtthread.h>
#include "kservice.h"
#ifdef RT_USING_DEVICE #ifdef RT_USING_DEVICE

View File

@ -15,7 +15,6 @@
#include <rthw.h> #include <rthw.h>
#include <rtthread.h> #include <rtthread.h>
#include "kservice.h"
#ifndef IDLE_THREAD_STACK_SIZE #ifndef IDLE_THREAD_STACK_SIZE
#if defined (RT_USING_HOOK) || defined(RT_USING_HEAP) #if defined (RT_USING_HOOK) || defined(RT_USING_HEAP)

View File

@ -40,8 +40,6 @@
#include <rtthread.h> #include <rtthread.h>
#include <rthw.h> #include <rthw.h>
#include "kservice.h"
#ifdef RT_USING_HOOK #ifdef RT_USING_HOOK
extern void (*rt_object_trytake_hook)(struct rt_object *object); extern void (*rt_object_trytake_hook)(struct rt_object *object);
extern void (*rt_object_take_hook)(struct rt_object *object); extern void (*rt_object_take_hook)(struct rt_object *object);

View File

@ -22,8 +22,6 @@
#include <rthw.h> #include <rthw.h>
#include <rtthread.h> #include <rtthread.h>
#include "kservice.h"
#ifdef RT_USING_MEMPOOL #ifdef RT_USING_MEMPOOL
#ifdef RT_USING_HOOK #ifdef RT_USING_HOOK

View File

@ -21,7 +21,6 @@
#include <rtm.h> #include <rtm.h>
#include "string.h" #include "string.h"
#include "kservice.h"
#ifdef RT_USING_MODULE #ifdef RT_USING_MODULE
#include "module.h" #include "module.h"

View File

@ -20,8 +20,6 @@
#include <rtthread.h> #include <rtthread.h>
#include <rthw.h> #include <rthw.h>
#include "kservice.h"
#define _OBJ_CONTAINER_LIST_INIT(c) \ #define _OBJ_CONTAINER_LIST_INIT(c) \
{&(rt_object_container[c].object_list), &(rt_object_container[c].object_list)} {&(rt_object_container[c].object_list), &(rt_object_container[c].object_list)}
struct rt_object_information rt_object_container[RT_Object_Class_Unknown] = struct rt_object_information rt_object_container[RT_Object_Class_Unknown] =

View File

@ -29,8 +29,6 @@
#include <rtthread.h> #include <rtthread.h>
#include <rthw.h> #include <rthw.h>
#include "kservice.h"
static rt_int16_t rt_scheduler_lock_nest; static rt_int16_t rt_scheduler_lock_nest;
extern volatile rt_uint8_t rt_interrupt_nest; extern volatile rt_uint8_t rt_interrupt_nest;

View File

@ -54,7 +54,6 @@
#include <rthw.h> #include <rthw.h>
#include <rtthread.h> #include <rtthread.h>
#include "kservice.h"
#define RT_MEM_STATS #define RT_MEM_STATS

View File

@ -27,7 +27,6 @@
#include <rtthread.h> #include <rtthread.h>
#include <rthw.h> #include <rthw.h>
#include "kservice.h"
extern rt_list_t rt_thread_priority_table[RT_THREAD_PRIORITY_MAX]; extern rt_list_t rt_thread_priority_table[RT_THREAD_PRIORITY_MAX];
extern struct rt_thread *rt_current_thread; extern struct rt_thread *rt_current_thread;

View File

@ -22,8 +22,6 @@
#include <rtthread.h> #include <rtthread.h>
#include <rthw.h> #include <rthw.h>
#include "kservice.h"
/* hard timer list */ /* hard timer list */
static rt_list_t rt_timer_list; static rt_list_t rt_timer_list;