Loading drivers/soc/qcom/scm.c +58 −1 Original line number Diff line number Diff line /* Copyright (c) 2010-2014, The Linux Foundation. All rights reserved. /* Copyright (c) 2010-2015, 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 @@ -942,6 +942,63 @@ s32 scm_call_atomic4_3(u32 svc, u32 cmd, u32 arg1, u32 arg2, } EXPORT_SYMBOL(scm_call_atomic4_3); /** * scm_call_atomic5_3() - SCM command with five argument and three return value * @svc_id: service identifier * @cmd_id: command identifier * @arg1: first argument * @arg2: second argument * @arg3: third argument * @arg4: fourth argument * @arg5: fifth argument * @ret1: first return value * @ret2: second return value * @ret3: third return value * * This shall only be used with commands that are guaranteed to be * uninterruptable, atomic and SMP safe. */ s32 scm_call_atomic5_3(u32 svc, u32 cmd, u32 arg1, u32 arg2, u32 arg3, u32 arg4, u32 arg5, u32 *ret1, u32 *ret2, u32 *ret3) { int ret; int context_id; register u32 r0 asm("r0") = SCM_ATOMIC(svc, cmd, 5); register u32 r1 asm("r1") = (uintptr_t)&context_id; register u32 r2 asm("r2") = arg1; register u32 r3 asm("r3") = arg2; register u32 r4 asm("r4") = arg3; register u32 r5 asm("r5") = arg4; register u32 r6 asm("r6") = arg5; asm volatile( __asmeq("%0", R0_STR) __asmeq("%1", R1_STR) __asmeq("%2", R2_STR) __asmeq("%3", R3_STR) __asmeq("%4", R0_STR) __asmeq("%5", R1_STR) __asmeq("%6", R2_STR) __asmeq("%7", R3_STR) #ifdef REQUIRES_SEC ".arch_extension sec\n" #endif "smc #0\n" : "=r" (r0), "=r" (r1), "=r" (r2), "=r" (r3) : "r" (r0), "r" (r1), "r" (r2), "r" (r3), "r" (r4), "r" (r5), "r" (r6)); ret = r0; if (ret1) *ret1 = r1; if (ret2) *ret2 = r2; if (ret3) *ret3 = r3; return r0; } EXPORT_SYMBOL(scm_call_atomic5_3); u32 scm_get_version(void) { int context_id; Loading include/soc/qcom/scm.h +9 −1 Original line number Diff line number Diff line /* Copyright (c) 2010-2014, The Linux Foundation. All rights reserved. /* Copyright (c) 2010-2015, 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 @@ -109,6 +109,8 @@ extern s32 scm_call_atomic2(u32 svc, u32 cmd, u32 arg1, u32 arg2); extern s32 scm_call_atomic3(u32 svc, u32 cmd, u32 arg1, u32 arg2, u32 arg3); extern s32 scm_call_atomic4_3(u32 svc, u32 cmd, u32 arg1, u32 arg2, u32 arg3, u32 arg4, u32 *ret1, u32 *ret2); extern s32 scm_call_atomic5_3(u32 svc, u32 cmd, u32 arg1, u32 arg2, u32 arg3, u32 arg4, u32 arg5, u32 *ret1, u32 *ret2, u32 *ret3); #define SCM_VERSION(major, minor) (((major) << 16) | ((minor) & 0xFF)) Loading Loading @@ -179,6 +181,12 @@ static inline s32 scm_call_atomic4_3(u32 svc, u32 cmd, u32 arg1, u32 arg2, return 0; } static inline s32 scm_call_atomic5_3(u32 svc, u32 cmd, u32 arg1, u32 arg2, u32 arg3, u32 arg4, u32 arg5, u32 *ret1, u32 *ret2, u32 *ret3) { return 0; } static inline u32 scm_get_version(void) { return 0; Loading Loading
drivers/soc/qcom/scm.c +58 −1 Original line number Diff line number Diff line /* Copyright (c) 2010-2014, The Linux Foundation. All rights reserved. /* Copyright (c) 2010-2015, 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 @@ -942,6 +942,63 @@ s32 scm_call_atomic4_3(u32 svc, u32 cmd, u32 arg1, u32 arg2, } EXPORT_SYMBOL(scm_call_atomic4_3); /** * scm_call_atomic5_3() - SCM command with five argument and three return value * @svc_id: service identifier * @cmd_id: command identifier * @arg1: first argument * @arg2: second argument * @arg3: third argument * @arg4: fourth argument * @arg5: fifth argument * @ret1: first return value * @ret2: second return value * @ret3: third return value * * This shall only be used with commands that are guaranteed to be * uninterruptable, atomic and SMP safe. */ s32 scm_call_atomic5_3(u32 svc, u32 cmd, u32 arg1, u32 arg2, u32 arg3, u32 arg4, u32 arg5, u32 *ret1, u32 *ret2, u32 *ret3) { int ret; int context_id; register u32 r0 asm("r0") = SCM_ATOMIC(svc, cmd, 5); register u32 r1 asm("r1") = (uintptr_t)&context_id; register u32 r2 asm("r2") = arg1; register u32 r3 asm("r3") = arg2; register u32 r4 asm("r4") = arg3; register u32 r5 asm("r5") = arg4; register u32 r6 asm("r6") = arg5; asm volatile( __asmeq("%0", R0_STR) __asmeq("%1", R1_STR) __asmeq("%2", R2_STR) __asmeq("%3", R3_STR) __asmeq("%4", R0_STR) __asmeq("%5", R1_STR) __asmeq("%6", R2_STR) __asmeq("%7", R3_STR) #ifdef REQUIRES_SEC ".arch_extension sec\n" #endif "smc #0\n" : "=r" (r0), "=r" (r1), "=r" (r2), "=r" (r3) : "r" (r0), "r" (r1), "r" (r2), "r" (r3), "r" (r4), "r" (r5), "r" (r6)); ret = r0; if (ret1) *ret1 = r1; if (ret2) *ret2 = r2; if (ret3) *ret3 = r3; return r0; } EXPORT_SYMBOL(scm_call_atomic5_3); u32 scm_get_version(void) { int context_id; Loading
include/soc/qcom/scm.h +9 −1 Original line number Diff line number Diff line /* Copyright (c) 2010-2014, The Linux Foundation. All rights reserved. /* Copyright (c) 2010-2015, 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 @@ -109,6 +109,8 @@ extern s32 scm_call_atomic2(u32 svc, u32 cmd, u32 arg1, u32 arg2); extern s32 scm_call_atomic3(u32 svc, u32 cmd, u32 arg1, u32 arg2, u32 arg3); extern s32 scm_call_atomic4_3(u32 svc, u32 cmd, u32 arg1, u32 arg2, u32 arg3, u32 arg4, u32 *ret1, u32 *ret2); extern s32 scm_call_atomic5_3(u32 svc, u32 cmd, u32 arg1, u32 arg2, u32 arg3, u32 arg4, u32 arg5, u32 *ret1, u32 *ret2, u32 *ret3); #define SCM_VERSION(major, minor) (((major) << 16) | ((minor) & 0xFF)) Loading Loading @@ -179,6 +181,12 @@ static inline s32 scm_call_atomic4_3(u32 svc, u32 cmd, u32 arg1, u32 arg2, return 0; } static inline s32 scm_call_atomic5_3(u32 svc, u32 cmd, u32 arg1, u32 arg2, u32 arg3, u32 arg4, u32 arg5, u32 *ret1, u32 *ret2, u32 *ret3) { return 0; } static inline u32 scm_get_version(void) { return 0; Loading