fix "redefinition of typedef 'k_task_t'"

1. remove re-typedef of k_task_st to k_task_t in tos_task.h
2. add "typedef struct k_task_st k_task_t" to tos_ktypes.h
This commit is contained in:
daishengdong
2020-03-12 11:04:17 +08:00
parent 6d0c6d3721
commit 441f57c837
4 changed files with 22 additions and 22 deletions

View File

@@ -17,7 +17,7 @@ typedef struct vfs_char_device_operations_st {
int (*resume) (void); int (*resume) (void);
} vfs_chrdev_ops_t; } vfs_chrdev_ops_t;
typedef struct vfs_block_device_geometry_t { typedef struct vfs_block_device_geometry_st {
int is_available; int is_available;
uint32_t sector_size; uint32_t sector_size;
uint32_t nsectors; uint32_t nsectors;

View File

@@ -24,10 +24,12 @@
typedef uint8_t k_prio_t; typedef uint8_t k_prio_t;
typedef uint8_t k_stack_t; typedef uint8_t k_stack_t;
typedef uint8_t k_task_state_t; typedef uint8_t k_task_state_t;
typedef struct k_task_st k_task_t;
typedef uint8_t k_nesting_t; typedef uint8_t k_nesting_t;
typedef uint16_t k_opt_t; typedef uint16_t k_opt_t;
typedef uint16_t k_sem_cnt_t; typedef uint16_t k_sem_cnt_t;
typedef uint32_t k_event_flag_t; typedef uint32_t k_event_flag_t;
typedef uint16_t k_barrier_cnt_t; typedef uint16_t k_barrier_cnt_t;

View File

@@ -20,8 +20,6 @@
__CDECLS_BEGIN __CDECLS_BEGIN
typedef struct k_task_st k_task_t;
/** /**
* The reason why we wakeup from a pend. * The reason why we wakeup from a pend.
* when we wakeup, we need to know why. * when we wakeup, we need to know why.

View File

@@ -71,7 +71,7 @@ typedef void (*k_task_walker_t)(k_task_t *task);
/** /**
* task control block * task control block
*/ */
typedef struct k_task_st { struct k_task_st {
k_stack_t *sp; /**< task stack pointer. This lady always comes first, we count on her in port_s.S for context switch. */ k_stack_t *sp; /**< task stack pointer. This lady always comes first, we count on her in port_s.S for context switch. */
knl_obj_t knl_obj; /**< just for verification, test whether current object is really a task. */ knl_obj_t knl_obj; /**< just for verification, test whether current object is really a task. */
@@ -130,7 +130,7 @@ typedef struct k_task_st {
k_event_flag_t *flag_match; /**< if we pend an event successfully, flag_match will be set by the event poster, and will be returned k_event_flag_t *flag_match; /**< if we pend an event successfully, flag_match will be set by the event poster, and will be returned
by tos_event_pend to the caller */ by tos_event_pend to the caller */
#endif #endif
} k_task_t; };
/** /**
* @brief Create a task. * @brief Create a task.