diff --git a/riscv32_virt/liteos_m/board/driver/virtnet.c b/riscv32_virt/liteos_m/board/driver/virtnet.c index 66549e9b3cdc6ff44a66d4ff08b3304f5708adc9..3ccf256f8536ac5f48eef2948ffb6b2bbefc7504 100644 --- a/riscv32_virt/liteos_m/board/driver/virtnet.c +++ b/riscv32_virt/liteos_m/board/driver/virtnet.c @@ -27,15 +27,17 @@ #include "los_sched.h" VOID LOS_TaskLockSave(UINT32 *intSave) { + UINT32 cpuid = ArchCurrCpuid(); *intSave = LOS_IntLock(); - g_losTaskLock++; + g_losTaskLock[cpuid]++; } VOID LOS_TaskUnlockRestore(UINT32 intSave) { - if (g_losTaskLock > 0) { - g_losTaskLock--; - if (g_losTaskLock == 0) { + UINT32 cpuid = ArchCurrCpuid(); + if (g_losTaskLock[cpuid] > 0) { + g_losTaskLock[cpuid]--; + if (g_losTaskLock[cpuid] == 0) { LOS_IntRestore(intSave); LOS_Schedule(); return;