Use U64 for the pointer hand over to kernel via ioctl
authorJonghwa Lee <jonghwa3.lee@samsung.com>
Wed, 27 Mar 2024 10:39:04 +0000 (19:39 +0900)
committerWook Song <wook16.song@samsung.com>
Tue, 18 Mar 2025 07:28:09 +0000 (16:28 +0900)
It fixes the error of TRINITY_IOCTL_GET_PROFILE_BUFFER ioctl command.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
include/uapi/misc/trinity.h
src/core/npu/NPUdrvAPI_triv2.cc

index 8dc2e8e6adaa0c6034d4fc4f92bb9c5c7f37d320..5671091c121cd5d1768d19148b1f83d5a4de21a4 100644 (file)
@@ -238,7 +238,7 @@ struct trinity_ioctl_profile_buff {
        __s32 req_id;
        __u32 profile_pos;
        __u32 profile_size;
-       void *profile_buf;
+       __u64 profile_buf;
 } __attribute__((packed));
 
 /**
index fde53bf7bfcca7a7b6235f12e811d762662c23c1..a64b32fb8ad11049f59b6059d45d942424fa5238 100644 (file)
@@ -685,7 +685,7 @@ TrinityVision2API::getProfile (int req_id, npu_profile *profile, std::string pat
       chunk_size = PROFILE_MAXSIZE;
 
     buff.profile_pos = pos;
-    buff.profile_buf = (char *) profile->layers + pos;
+    buff.profile_buf = reinterpret_cast<std::uintptr_t>(profile->layers) + pos;
     buff.profile_size = chunk_size;
 
     ret = ioctl (this->getDeviceFD (), TRINITY_IOCTL_GET_PROFILE_BUFF, &buff);