Loading drivers/char/adsprpc.c +20 −0 Original line number Diff line number Diff line Loading @@ -2017,6 +2017,17 @@ bail: return err; } static int fastrpc_get_info(struct fastrpc_file *fl, uint32_t *info) { int err = 0; VERIFY(err, fl && fl->sctx); if (err) goto bail; *info = (fl->sctx->smmu.enabled ? 1 : 0); bail: return err; } static long fastrpc_device_ioctl(struct file *file, unsigned int ioctl_num, unsigned long ioctl_param) Loading @@ -2030,6 +2041,7 @@ static long fastrpc_device_ioctl(struct file *file, unsigned int ioctl_num, void *param = (char *)ioctl_param; struct fastrpc_file *fl = (struct fastrpc_file *)file->private_data; int size = 0, err = 0; uint32_t info; switch (ioctl_num) { case FASTRPC_IOCTL_INVOKE_FD: Loading Loading @@ -2078,6 +2090,14 @@ static long fastrpc_device_ioctl(struct file *file, unsigned int ioctl_num, break; } break; case FASTRPC_IOCTL_GETINFO: VERIFY(err, 0 == (err = fastrpc_get_info(fl, &info))); if (err) goto bail; VERIFY(err, 0 == copy_to_user(param, &info, sizeof(info))); if (err) goto bail; break; case FASTRPC_IOCTL_INIT: VERIFY(err, 0 == copy_from_user(&p.init, param, sizeof(p.init))); Loading drivers/char/adsprpc_compat.c +21 −1 Original line number Diff line number Diff line /* * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. * Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -319,6 +319,26 @@ long compat_fastrpc_device_ioctl(struct file *filp, unsigned int cmd, return filp->f_op->unlocked_ioctl(filp, FASTRPC_IOCTL_INIT, (unsigned long)init); } case FASTRPC_IOCTL_GETINFO: { compat_uptr_t __user *info32; uint32_t __user *info; compat_uint_t u; long ret; info32 = compat_ptr(arg); VERIFY(err, NULL != (info = compat_alloc_user_space( sizeof(*info)))); if (err) return -EFAULT; ret = filp->f_op->unlocked_ioctl(filp, FASTRPC_IOCTL_GETINFO, (unsigned long)info); if (ret) return ret; err = get_user(u, info); err |= put_user(u, info32); return err; } case FASTRPC_IOCTL_SETMODE: return filp->f_op->unlocked_ioctl(filp, cmd, (unsigned long)compat_ptr(arg)); Loading drivers/char/adsprpc_shared.h +1 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #define FASTRPC_IOCTL_INVOKE_FD _IOWR('R', 4, struct fastrpc_ioctl_invoke_fd) #define FASTRPC_IOCTL_SETMODE _IOWR('R', 5, uint32_t) #define FASTRPC_IOCTL_INIT _IOWR('R', 6, struct fastrpc_ioctl_init) #define FASTRPC_IOCTL_GETINFO _IOWR('R', 8, uint32_t) #define FASTRPC_GLINK_GUID "fastrpcglink-apps-dsp" #define FASTRPC_SMD_GUID "fastrpcsmd-apps-dsp" #define DEVICE_NAME "adsprpc-smd" Loading Loading
drivers/char/adsprpc.c +20 −0 Original line number Diff line number Diff line Loading @@ -2017,6 +2017,17 @@ bail: return err; } static int fastrpc_get_info(struct fastrpc_file *fl, uint32_t *info) { int err = 0; VERIFY(err, fl && fl->sctx); if (err) goto bail; *info = (fl->sctx->smmu.enabled ? 1 : 0); bail: return err; } static long fastrpc_device_ioctl(struct file *file, unsigned int ioctl_num, unsigned long ioctl_param) Loading @@ -2030,6 +2041,7 @@ static long fastrpc_device_ioctl(struct file *file, unsigned int ioctl_num, void *param = (char *)ioctl_param; struct fastrpc_file *fl = (struct fastrpc_file *)file->private_data; int size = 0, err = 0; uint32_t info; switch (ioctl_num) { case FASTRPC_IOCTL_INVOKE_FD: Loading Loading @@ -2078,6 +2090,14 @@ static long fastrpc_device_ioctl(struct file *file, unsigned int ioctl_num, break; } break; case FASTRPC_IOCTL_GETINFO: VERIFY(err, 0 == (err = fastrpc_get_info(fl, &info))); if (err) goto bail; VERIFY(err, 0 == copy_to_user(param, &info, sizeof(info))); if (err) goto bail; break; case FASTRPC_IOCTL_INIT: VERIFY(err, 0 == copy_from_user(&p.init, param, sizeof(p.init))); Loading
drivers/char/adsprpc_compat.c +21 −1 Original line number Diff line number Diff line /* * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. * Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -319,6 +319,26 @@ long compat_fastrpc_device_ioctl(struct file *filp, unsigned int cmd, return filp->f_op->unlocked_ioctl(filp, FASTRPC_IOCTL_INIT, (unsigned long)init); } case FASTRPC_IOCTL_GETINFO: { compat_uptr_t __user *info32; uint32_t __user *info; compat_uint_t u; long ret; info32 = compat_ptr(arg); VERIFY(err, NULL != (info = compat_alloc_user_space( sizeof(*info)))); if (err) return -EFAULT; ret = filp->f_op->unlocked_ioctl(filp, FASTRPC_IOCTL_GETINFO, (unsigned long)info); if (ret) return ret; err = get_user(u, info); err |= put_user(u, info32); return err; } case FASTRPC_IOCTL_SETMODE: return filp->f_op->unlocked_ioctl(filp, cmd, (unsigned long)compat_ptr(arg)); Loading
drivers/char/adsprpc_shared.h +1 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #define FASTRPC_IOCTL_INVOKE_FD _IOWR('R', 4, struct fastrpc_ioctl_invoke_fd) #define FASTRPC_IOCTL_SETMODE _IOWR('R', 5, uint32_t) #define FASTRPC_IOCTL_INIT _IOWR('R', 6, struct fastrpc_ioctl_init) #define FASTRPC_IOCTL_GETINFO _IOWR('R', 8, uint32_t) #define FASTRPC_GLINK_GUID "fastrpcglink-apps-dsp" #define FASTRPC_SMD_GUID "fastrpcsmd-apps-dsp" #define DEVICE_NAME "adsprpc-smd" Loading