Skip to content

Commit

Permalink
smp
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuzhuzhus committed Sep 12, 2024
1 parent ad2aba6 commit dd62e4f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions components/drivers/smp/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void rt_smp_call_ipi_handler(int vector, void *param)
* else it will call function on specified CPU and return immediately
* @param cond the condition function pointer,if you set it then it will call function only when cond return true
*/
void rt_smp_call_func_cond(int cpu_mask, smp_call_func_back func, void *data, rt_uint8_t flag, smp_cond cond)
void rt_smp_call_func_cond(int cpu_mask, rt_smp_call_func_back func, void *data, rt_uint8_t flag, rt_smp_cond cond)
{
RT_DEBUG_NOT_IN_INTERRUPT;
struct rt_smp_event event;
Expand Down Expand Up @@ -116,21 +116,21 @@ void rt_smp_call_func_cond(int cpu_mask, smp_call_func_back func, void *data, rt
}
}

void rt_smp_call_each_cpu(smp_call_func_back func, void *data, rt_uint8_t flag)
void rt_smp_call_each_cpu(rt_smp_call_func_back func, void *data, rt_uint8_t flag)
{
rt_smp_call_func_cond(RT_ALL_CPU, func, data, flag, RT_NULL);
}

void rt_smp_call_each_cpu_cond(smp_call_func_back func, void *data, rt_uint8_t flag, smp_cond cond_func)
void rt_smp_call_each_cpu_cond(rt_smp_call_func_back func, void *data, rt_uint8_t flag, rt_smp_cond cond_func)
{
rt_smp_call_func_cond(RT_ALL_CPU, func, data, flag, cond_func);
}
void rt_smp_call_any_cpu(int cpu_mask, smp_call_func_back func, void *data, rt_uint8_t flag)
void rt_smp_call_any_cpu(int cpu_mask, rt_smp_call_func_back func, void *data, rt_uint8_t flag)
{
rt_smp_call_func_cond(cpu_mask, func, data, flag, RT_NULL);
}

void rt_smp_call_any_cpu_cond(int cpu_mask, smp_call_func_back func, void *data, rt_uint8_t flag, smp_cond cond_func)
void rt_smp_call_any_cpu_cond(int cpu_mask, rt_smp_call_func_back func, void *data, rt_uint8_t flag, rt_smp_cond cond_func)
{
rt_smp_call_func_cond(cpu_mask, func, data, flag, cond_func);
}
Expand Down
14 changes: 7 additions & 7 deletions components/drivers/smp/smp.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef __SMP_IPI_H__
#define __SMP_IPI_H__
#include <rtthread.h>
typedef void (*smp_call_func_back)(void *data);
typedef rt_bool_t (*smp_cond)(int cpu, void *info);
typedef void (*rt_smp_call_func_back)(void *data);
typedef rt_bool_t (*rt_smp_cond)(int cpu, void *info);

#define SMP_CALL_EVENT_FUNC 0x1

Expand All @@ -15,7 +15,7 @@ struct rt_smp_event
int cpu_mask;
int event_id;
void *data;
smp_call_func_back func;
rt_smp_call_func_back func;
};
struct rt_smp_call
{
Expand All @@ -25,10 +25,10 @@ struct rt_smp_call


void rt_smp_call_ipi_handler(int vector, void *param);
void rt_smp_call_each_cpu(smp_call_func_back func, void *data,rt_uint8_t flag);
void rt_smp_call_each_cpu_cond(smp_call_func_back func, void *data,rt_uint8_t flag,smp_cond cond_func);
void rt_smp_call_any_cpu(int cpu_mask,smp_call_func_back func, void *data,rt_uint8_t flag);
void rt_smp_call_any_cpu_cond(int cpu_mask,smp_call_func_back func, void *data,rt_uint8_t flag,smp_cond cond_func);
void rt_smp_call_each_cpu(rt_smp_call_func_back func, void *data,rt_uint8_t flag);
void rt_smp_call_each_cpu_cond(rt_smp_call_func_back func, void *data,rt_uint8_t flag,rt_smp_cond cond_func);
void rt_smp_call_any_cpu(int cpu_mask,rt_smp_call_func_back func, void *data,rt_uint8_t flag);
void rt_smp_call_any_cpu_cond(int cpu_mask,rt_smp_call_func_back func, void *data,rt_uint8_t flag,rt_smp_cond cond_func);
void rt_smp_init(void);

#endif

0 comments on commit dd62e4f

Please sign in to comment.