Compare commits

...

4 Commits

Author SHA1 Message Date
openharmony_ci
d7789ce6a2 !48 L0 posix接口新增
Merge pull request !48 from give-me-five/noEmployeeNum_ChangeID_13439291_wuyunjie
2021-03-31 14:00:23 +08:00
openharmony_ci
a2c7a5279e !50 使用01替换YES NO的依赖
Merge pull request !50 from 刘建东/OpenHarmony_1.0.1_release
2021-03-30 12:11:01 +08:00
YOUR_NAME
4084cd0dbe IssueNo:#I3E5C3
Description:use 0 1 instead of YES NO
Sig:phone
Feature or Bugfix:Bugfix
Binary Source:No
2021-03-30 11:28:09 +08:00
openharmony_ci
7db6a2b82a !38 update ReadME.md
Merge pull request !38 from Harylee/master
2021-03-23 10:16:05 +08:00

View File

@@ -41,15 +41,15 @@
#include <los_timer.h>
#include <los_config.h>
#define YES 1
#define NO 0
#define LOSCFG_KERNEL_SMP NO
#ifndef LOSCFG_KERNEL_SMP
#define LOSCFG_KERNEL_SMP 0
#endif
#if (LOSCFG_KERNEL_SMP == YES)
#if (LOSCFG_KERNEL_SMP)
SPIN_LOCK_INIT(arch_protect_spin);
static u32_t lwprot_thread = LOS_ERRNO_TSK_ID_INVALID;
static int lwprot_count = 0;
#endif /* LOSCFG_KERNEL_SMP == YES */
#endif /* LOSCFG_KERNEL_SMP */
#define ROUND_UP_DIV(val, div) (((val) + (div) - 1) / (div))
#define LWIP_LOG_BUF_SIZE 64
@@ -98,7 +98,7 @@ u32_t sys_now(void)
*/
sys_prot_t sys_arch_protect(void)
{
#if (LOSCFG_KERNEL_SMP == YES)
#if (LOSCFG_KERNEL_SMP)
/* Note that we are using spinlock instead of mutex for LiteOS-SMP here:
* 1. spinlock is more effective for short critical region protection.
* 2. this function is called only in task context, not in interrupt handler.
@@ -116,14 +116,14 @@ sys_prot_t sys_arch_protect(void)
}
#else
LOS_TaskLock();
#endif /* LOSCFG_KERNEL_SMP == YES */
#endif /* LOSCFG_KERNEL_SMP */
return 0; /* return value is unused */
}
void sys_arch_unprotect(sys_prot_t pval)
{
LWIP_UNUSED_ARG(pval);
#if (LOSCFG_KERNEL_SMP == YES)
#if (LOSCFG_KERNEL_SMP)
if (lwprot_thread == LOS_CurTaskIDGet()) {
lwprot_count--;
if (lwprot_count == 0) {
@@ -133,7 +133,7 @@ void sys_arch_unprotect(sys_prot_t pval)
}
#else
LOS_TaskUnlock();
#endif /* LOSCFG_KERNEL_SMP == YES */
#endif /* LOSCFG_KERNEL_SMP */
}
/**