#define _TEE_CORE_FW_VER "1:0.1"
-static char *_tee_supp_app_name = "tee_supplicant";
+static char *_tee_supp_app_name = "tee-supplicant";
/* Store the class misc reference */
static struct class *misc_class;
{
int ret = -EINVAL;
struct tee_context *ctx = filp->private_data;
+ void __user *u_arg;
BUG_ON(!ctx);
BUG_ON(!ctx->tee);
dev_dbg(_DEV(ctx->tee), "%s: > cmd nr=%d\n", __func__, _IOC_NR(cmd));
+#ifdef CONFIG_COMPAT
+ if (is_compat_task())
+ u_arg = compat_ptr(arg);
+ else
+ u_arg = (void __user *)arg;
+#else
+ u_arg = (void __user *)arg;
+#endif
+
switch (cmd) {
case TEE_OPEN_SESSION_IOC:
- ret =
- tee_do_create_session(ctx, (struct tee_cmd_io __user *)arg);
+ ret = tee_do_create_session(ctx,
+ (struct tee_cmd_io __user *)u_arg);
break;
case TEE_ALLOC_SHM_IOC:
- ret = tee_do_shm_alloc(ctx, (struct tee_shm_io __user *)arg);
+ ret = tee_do_shm_alloc(ctx, (struct tee_shm_io __user *)u_arg);
break;
case TEE_GET_FD_FOR_RPC_SHM_IOC:
- ret =
- tee_do_get_fd_for_rpc_shm(ctx,
- (struct tee_shm_io __user *)arg);
+ ret = tee_do_get_fd_for_rpc_shm(ctx,
+ (struct tee_shm_io __user *)u_arg);
break;
default:
ret = -ENOSYS;
.write = tee_supp_write,
.open = tee_ctx_open,
.release = tee_ctx_release,
- .unlocked_ioctl = tee_ioctl,
- .compat_ioctl = tee_ioctl
+#ifdef CONFIG_COMPAT
+ .compat_ioctl = tee_ioctl,
+#endif
+ .unlocked_ioctl = tee_ioctl
};
static void tee_plt_device_release(struct device *dev)