- Size of pointer in 32bit arch is 4byte, but size of uint64_t is 8byte.
This occurs the size mismatching issue.
- The issue is fixed by checking type of architecture
Change-Id: If696b7465df81ba401458b94b8559b8521458f84
Signed-off-by: Taeyoung Kim <ty317.kim@samsung.com>
OPTION(USE_ARM "Use Arm" ON)
ENDIF()
+IF("${ARCH_BIT}" STREQUAL "32")
+ OPTION(USE_32BIT "Use 32bit architecture" ON)
+ELSEIF("${ARCH_BIT}" STREQUAL "64")
+ OPTION(USE_64BIT "Use 64bit architecture" ON)
+ENDIF()
+
########################################################
# Deviced Macros
########################################################
ELSEIF(USE_EMULATOR)
ADD_DEFINITIONS("-DEMULATOR")
ENDIF()
+IF(USE_32BIT)
+ ADD_DEFINITIONS("-DARCH_32BIT")
+ELSEIF(USE_64BIT)
+ ADD_DEFINITIONS("-DARCH_64BIT")
+ENDIF()
ADD_DEFINITIONS("-DDEBUG")
ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
%prep
%setup -q
%if %{with emulator}
-%define ARCH emulator
+ %define ARCH emulator
%else
-%define ARCH arm
+ %ifarch %{arm} aarch64
+ %define ARCH arm
+ %else
+ %define ARCH x86
+ %endif
+%endif
+
+%ifarch %{arm} %ix86
+ %define ARCH_BIT 32
+%else
+ %define ARCH_BIT 64
%endif
%define DPMS none
-DTZ_SYS_ETC=%TZ_SYS_ETC \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DARCH=%{ARCH} \
+ -DARCH_BIT=%{ARCH_BIT} \
-DDPMS=%{DPMS} \
-DPROFILE=%{profile} \
-DBATTERY_MODULE=%{battery_module} \
#include <unzip.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/time.h>
#include <unistd.h>
#include <semaphore.h>
#include <errno.h>
handle->path = zippath;
handle->file = file;
+#ifdef ARCH_32BIT
+ int hd = (int)handle;
+ fi->fh = (uint64_t)hd;
+#else
fi->fh = (uint64_t)handle;
+#endif
return 0;
out_unlock:
_E("Invalid Zip Handle ");
return -EINVAL;
}
+
+#ifdef ARCH_32BIT
+ int hd = (int)fi->fh;
+ handle = (struct tzip_handle *)hd;
+#else
handle = (struct tzip_handle *)(fi->fh);
+#endif
_D("Read - Path : %s size : %zd offset : %jd ", path, size, offset);
ret = read_zipfile(handle, buf, size, offset);
_E("Invalid Zip Handle ");
return -EINVAL;
}
+
+#ifdef ARCH_32BIT
+ int hd = (int)fi->fh;
+ handle = (struct tzip_handle *)hd;
+#else
handle = (struct tzip_handle *)(fi->fh);
+#endif
unzCloseCurrentFile(handle->zipfile);
unzClose(handle->zipfile);