diff --git a/samgr/BUILD.gn b/samgr/BUILD.gn index 14e7d27ade2372b9c6f0e527fec6e4014670057b..42152976d41a719f93b72ad04a3438315a5762a6 100755 --- a/samgr/BUILD.gn +++ b/samgr/BUILD.gn @@ -36,7 +36,7 @@ if (ohos_kernel_type == "liteos_m") { include_dirs = [ "//base/hiviewdfx/interfaces/kits/hilog_lite", - "//kernel/liteos_m/components/cmsis", + "//kernel/liteos_m/kal/cmsis", ] public_deps = [ diff --git a/samgr/adapter/BUILD.gn b/samgr/adapter/BUILD.gn index 067dad58868492300cf8f8010a4be34581505a62..731db6811b7231ab9f9d5d810404388836e79315 100755 --- a/samgr/adapter/BUILD.gn +++ b/samgr/adapter/BUILD.gn @@ -31,7 +31,11 @@ if (ohos_kernel_type == "liteos_m") { public_configs = [ ":samgr_adapter_public" ] cflags = [ "-Wall" ] - include_dirs = [ "//kernel/liteos_m/kal" ] + include_dirs = [ + "//kernel/liteos_m/kal/", + "//kernel/liteos_m/kal/cmsis", + "//kernel/liteos_m/kal/posix/include/malloc.h", + ] } } diff --git a/samgr/adapter/cmsis/memory_adapter.c b/samgr/adapter/cmsis/memory_adapter.c index 337ca3c6dbc3acd12081eb3752877805d3dc2f08..10071c1c9c8e842c87a04419545c35b3df15a251 100755 --- a/samgr/adapter/cmsis/memory_adapter.c +++ b/samgr/adapter/cmsis/memory_adapter.c @@ -13,14 +13,14 @@ * limitations under the License. */ #include "memory_adapter.h" -#include +#include void *SAMGR_Malloc(uint32 size) { if (size == 0) { return NULL; } - return LOS_MemAlloc(m_aucSysMem0, (UINT32)size); + return malloc(size); } void SAMGR_Free(void *buffer) @@ -28,5 +28,5 @@ void SAMGR_Free(void *buffer) if (buffer == NULL) { return; } - (void)LOS_MemFree(m_aucSysMem0, buffer); + (void)free(buffer); } \ No newline at end of file diff --git a/samgr/adapter/cmsis/thread_adapter.c b/samgr/adapter/cmsis/thread_adapter.c index 69dbad2d5ad3c988e9ed7c99fbb2079b59bd00a4..32a557eae824d8f91f9ed7a747494c195dce5047 100755 --- a/samgr/adapter/cmsis/thread_adapter.c +++ b/samgr/adapter/cmsis/thread_adapter.c @@ -14,7 +14,6 @@ */ #include "thread_adapter.h" #include "common.h" -#include #include extern void *osThreadGetArgument(void); @@ -29,7 +28,7 @@ void MUTEX_Lock(MutexId mutex) if (mutex == NULL) { return; } - osMutexAcquire(mutex, LOS_WAIT_FOREVER); + osMutexAcquire(mutex, osWaitForever); } void MUTEX_Unlock(MutexId mutex) @@ -42,12 +41,12 @@ void MUTEX_Unlock(MutexId mutex) void MUTEX_GlobalLock(void) { - LOS_TaskLock(); + osKernelLock(); } void MUTEX_GlobalUnlock(void) { - LOS_TaskUnlock(); + osKernelUnlock(); } ThreadId THREAD_Create(Runnable run, void *argv, const ThreadAttr *attr) @@ -69,4 +68,4 @@ void *THREAD_GetThreadLocal(void) void THREAD_SetThreadLocal(const void *local) { (void)local; -} \ No newline at end of file +} diff --git a/samgr/source/BUILD.gn b/samgr/source/BUILD.gn index 79c1b26ef586d461cd1330bd96398c2eb722111c..8cedbc712a80699f9ab8a8adf8d64e63c9e2f97c 100755 --- a/samgr/source/BUILD.gn +++ b/samgr/source/BUILD.gn @@ -39,7 +39,7 @@ if (ohos_kernel_type == "liteos_m") { include_dirs = [ "//base/hiviewdfx/interfaces/kits/hilog_lite", - "//kernel/liteos_m/components/cmsis", + "//kernel/liteos_m/kal/cmsis", ] } }