From: Yunhee Seo Date: Mon, 22 Apr 2024 02:42:35 +0000 (+0900) Subject: memory: Apply HAL ABI versioning X-Git-Tag: accepted/tizen/unified/20240614.085013~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fe84a1063e76ac2b143ddaf10de3d8b451733f58;p=platform%2Fhal%2Fbackend%2Femulator%2Fdevice-emulator.git memory: Apply HAL ABI versioning While applying HAL ABI versioning, hal_backend_[module]_funcs is allocated from hal-api-[module] side. Thus, allocation is moved to hal-api-device-memory side. Also, wrong module name is fixed and hal interface inclusion path is changed. "memory" -> "device-memory" Change-Id: I2e65bd3a7b7a230c95aaba86ce9a0d0fead80346 Signed-off-by: Yunhee Seo --- diff --git a/hw/memory/memory.c b/hw/memory/memory.c index f7be3c5..21bde9d 100644 --- a/hw/memory/memory.c +++ b/hw/memory/memory.c @@ -18,33 +18,36 @@ #include #include -#include +#include #include #include -static int memory_get_gpu_info(const int pid, struct gpu_info *info) +static int memory_get_gpu_info(const int pid, hal_device_memory_gpu_info_s *info) { return -ENODEV; } -static int memory_get_gem_info(const int pid, struct gem_info *info) +static int memory_get_gem_info(const int pid, hal_device_memory_gem_info_s *info) { return -ENODEV; } static int memory_init(void **data) { - hal_backend_memory_funcs *memory_funcs; + hal_backend_device_memory_funcs *device_memory_funcs; - memory_funcs = calloc(1, sizeof(hal_backend_memory_funcs)); - if (!memory_funcs) - return -ENOMEM; + if (!data) { + _E("Invalid parameter"); + return -EINVAL; + } - memory_funcs->get_gpu_info = memory_get_gpu_info; - memory_funcs->get_gem_info = memory_get_gem_info; + device_memory_funcs = *(hal_backend_device_memory_funcs **) data; + if (!device_memory_funcs) + return -EINVAL; - *data = (void *)memory_funcs; + device_memory_funcs->get_gpu_info = memory_get_gpu_info; + device_memory_funcs->get_gem_info = memory_get_gem_info; return 0; }