IssueNo:#I3G1Q7

Description:Fix related interface competition issues.
Sig:liteos_a
Feature or Bugfix:Bugfix
Binary Source:No

Change-Id: I1198408be9ce577bbf0735e3da53d0834622f429
This commit is contained in:
YOUR_NAME 2021-04-17 16:15:35 +08:00
parent 0e56ee6509
commit 74af06d5cb
3 changed files with 22 additions and 3 deletions

View File

@ -1820,6 +1820,8 @@ UINT32 LOS_MemInfoGet(VOID *pool, LOS_MEM_POOL_STATUS *poolStatus)
return LOS_NOK;
}
(VOID)memset_s(poolStatus, sizeof(LOS_MEM_POOL_STATUS), 0, sizeof(LOS_MEM_POOL_STATUS));
struct OsMemNodeHead *tmpNode = NULL;
struct OsMemNodeHead *endNode = NULL;
UINT32 intSave;

View File

@ -365,12 +365,24 @@ LosVmMapRegion *OsFindRegion(LosRbTree *regionRbTree, VADDR_T vaddr, size_t len)
LosVmMapRegion *LOS_RegionFind(LosVmSpace *vmSpace, VADDR_T addr)
{
return OsFindRegion(&vmSpace->regionRbTree, addr, 1);
LosVmMapRegion *region = NULL;
(VOID)LOS_MuxAcquire(&vmSpace->regionMux);
region = OsFindRegion(&vmSpace->regionRbTree, addr, 1);
(VOID)LOS_MuxRelease(&vmSpace->regionMux);
return region;
}
LosVmMapRegion *LOS_RegionRangeFind(LosVmSpace *vmSpace, VADDR_T addr, size_t len)
{
return OsFindRegion(&vmSpace->regionRbTree, addr, len);
LosVmMapRegion *region = NULL;
(VOID)LOS_MuxAcquire(&vmSpace->regionMux);
region = OsFindRegion(&vmSpace->regionRbTree, addr, len);
(VOID)LOS_MuxRelease(&vmSpace->regionMux);
return region;
}
VADDR_T OsAllocRange(LosVmSpace *vmSpace, size_t len)

View File

@ -33,6 +33,7 @@
#include <stdlib.h>
#include "los_memory.h"
#include "los_vm_lock.h"
#include "los_vm_map.h"
#include "user_copy.h"
@ -47,11 +48,15 @@ extern void *DupUserMem(const void *ptr, size_t len, int needCopy);
__VA_ARGS__; \
return -get_errno(); \
} \
if (CheckRegion(OsCurrProcessGet()->vmSpace, (VADDR_T)(UINTPTR)ptr, len) == -1) { \
LosVmSpace *__aspace = OsCurrProcessGet()->vmSpace; \
(VOID)LOS_MuxAcquire(&__aspace->regionMux); \
if (CheckRegion(__aspace, (VADDR_T)(UINTPTR)ptr, len) == -1) { \
(VOID)LOS_MuxRelease(&__aspace->regionMux); \
set_errno(EFAULT); \
__VA_ARGS__; \
return -get_errno(); \
} \
(VOID)LOS_MuxRelease(&__aspace->regionMux); \
} \
} while (0)