diff options
Diffstat (limited to 'arch/arm/mach-imx/sci/svc/irq')
-rw-r--r-- | arch/arm/mach-imx/sci/svc/irq/rpc.h | 7 | ||||
-rw-r--r-- | arch/arm/mach-imx/sci/svc/irq/rpc_clnt.c | 32 |
2 files changed, 22 insertions, 17 deletions
diff --git a/arch/arm/mach-imx/sci/svc/irq/rpc.h b/arch/arm/mach-imx/sci/svc/irq/rpc.h index 687dc2866d..bc01cad93c 100644 --- a/arch/arm/mach-imx/sci/svc/irq/rpc.h +++ b/arch/arm/mach-imx/sci/svc/irq/rpc.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2016 Freescale Semiconductor, Inc. - * Copyright 2017-2018 NXP + * Copyright 2017-2019 NXP * * SPDX-License-Identifier: GPL-2.0+ */ @@ -24,8 +24,8 @@ */ /*@{*/ #define IRQ_FUNC_UNKNOWN 0 /*!< Unknown function */ -#define IRQ_FUNC_ENABLE 1U /*!< Index for irq_enable() RPC call */ -#define IRQ_FUNC_STATUS 2U /*!< Index for irq_status() RPC call */ +#define IRQ_FUNC_ENABLE 1U /*!< Index for sc_irq_enable() RPC call */ +#define IRQ_FUNC_STATUS 2U /*!< Index for sc_irq_status() RPC call */ /*@}*/ /* Types */ @@ -36,6 +36,7 @@ * This function dispatches an incoming IRQ RPC request. * * @param[in] caller_pt caller partition + * @param[in] mu MU message came from * @param[in] msg pointer to RPC message */ void irq_dispatch(sc_rm_pt_t caller_pt, sc_rsrc_t mu, sc_rpc_msg_t *msg); diff --git a/arch/arm/mach-imx/sci/svc/irq/rpc_clnt.c b/arch/arm/mach-imx/sci/svc/irq/rpc_clnt.c index c0cfe16164..d9be8bd58e 100644 --- a/arch/arm/mach-imx/sci/svc/irq/rpc_clnt.c +++ b/arch/arm/mach-imx/sci/svc/irq/rpc_clnt.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2016 Freescale Semiconductor, Inc. - * Copyright 2017-2018 NXP + * Copyright 2017-2019 NXP * * SPDX-License-Identifier: GPL-2.0+ */ @@ -27,49 +27,53 @@ /* Local Functions */ -sc_err_t sc_irq_enable(sc_ipc_t ipc, sc_rsrc_t resource, - sc_irq_group_t group, uint32_t mask, sc_bool_t enable) +sc_err_t sc_irq_enable(sc_ipc_t ipc, sc_rsrc_t resource, sc_irq_group_t group, + uint32_t mask, sc_bool_t enable) { sc_rpc_msg_t msg; - uint8_t result; + sc_err_t err; RPC_VER(&msg) = SC_RPC_VERSION; + RPC_SIZE(&msg) = 3U; RPC_SVC(&msg) = U8(SC_RPC_SVC_IRQ); RPC_FUNC(&msg) = U8(IRQ_FUNC_ENABLE); + RPC_U32(&msg, 0U) = U32(mask); RPC_U16(&msg, 4U) = U16(resource); RPC_U8(&msg, 6U) = U8(group); RPC_U8(&msg, 7U) = B2U8(enable); - RPC_SIZE(&msg) = 3U; sc_call_rpc(ipc, &msg, SC_FALSE); - result = RPC_R8(&msg); - return (sc_err_t) result; + err = (sc_err_t) RPC_R8(&msg); + + return err; } -sc_err_t sc_irq_status(sc_ipc_t ipc, sc_rsrc_t resource, - sc_irq_group_t group, uint32_t *status) +sc_err_t sc_irq_status(sc_ipc_t ipc, sc_rsrc_t resource, sc_irq_group_t group, + uint32_t *status) { sc_rpc_msg_t msg; - uint8_t result; + sc_err_t err; RPC_VER(&msg) = SC_RPC_VERSION; + RPC_SIZE(&msg) = 2U; RPC_SVC(&msg) = U8(SC_RPC_SVC_IRQ); RPC_FUNC(&msg) = U8(IRQ_FUNC_STATUS); + RPC_U16(&msg, 0U) = U16(resource); RPC_U8(&msg, 2U) = U8(group); - RPC_SIZE(&msg) = 2U; sc_call_rpc(ipc, &msg, SC_FALSE); + err = (sc_err_t) RPC_R8(&msg); + if (status != NULL) { - *status = RPC_U32(&msg, 0U); + *status = (uint32_t) RPC_U32(&msg, 0U); } - result = RPC_R8(&msg); - return (sc_err_t) result; + return err; } /**@}*/ |