From patchwork Tue Aug 11 01:21:43 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ameya Palande X-Patchwork-Id: 40533 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7B1M78C010158 for ; Tue, 11 Aug 2009 01:22:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751987AbZHKBWJ (ORCPT ); Mon, 10 Aug 2009 21:22:09 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752439AbZHKBWJ (ORCPT ); Mon, 10 Aug 2009 21:22:09 -0400 Received: from smtp.nokia.com ([192.100.105.134]:49882 "EHLO mgw-mx09.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751987AbZHKBWH (ORCPT ); Mon, 10 Aug 2009 21:22:07 -0400 Received: from esebh105.NOE.Nokia.com (esebh105.ntc.nokia.com [172.21.138.211]) by mgw-mx09.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n7B1LR4g029225; Mon, 10 Aug 2009 20:21:46 -0500 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by esebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 11 Aug 2009 04:21:58 +0300 Received: from mgw-sa01.ext.nokia.com ([147.243.1.47]) by esebh102.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Tue, 11 Aug 2009 04:21:58 +0300 Received: from localhost.localdomain (mipv6-1.research.nokia.com [172.21.41.19]) by mgw-sa01.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n7B1LpoE002545; Tue, 11 Aug 2009 04:21:55 +0300 From: Ameya Palande To: linux-omap@vger.kernel.org Cc: hiroshi.doyu@nokia.com, omar.ramirez@ti.com, x0095840@ti.com, suyog@ti.com, roman.tereshonkov@nokia.com, ernesto@ti.com Subject: [PATCH 02/13] DSPBRIDGE: Use pr_ctxt in NODE_Allocate Date: Tue, 11 Aug 2009 04:21:43 +0300 Message-Id: <1249953714-20972-3-git-send-email-ameya.palande@nokia.com> X-Mailer: git-send-email 1.6.2.4 In-Reply-To: <1249953714-20972-2-git-send-email-ameya.palande@nokia.com> References: <1249953714-20972-1-git-send-email-ameya.palande@nokia.com> <1249953714-20972-2-git-send-email-ameya.palande@nokia.com> X-OriginalArrivalTime: 11 Aug 2009 01:21:58.0264 (UTC) FILETIME=[1EDF4780:01CA1A22] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Signed-off-by: Ameya Palande --- arch/arm/plat-omap/include/dspbridge/node.h | 4 ++- drivers/dsp/bridge/pmgr/wcd.c | 2 +- drivers/dsp/bridge/rmgr/node.c | 49 +++------------------------ 3 files changed, 9 insertions(+), 46 deletions(-) diff --git a/arch/arm/plat-omap/include/dspbridge/node.h b/arch/arm/plat-omap/include/dspbridge/node.h index d253962..db3be05 100644 --- a/arch/arm/plat-omap/include/dspbridge/node.h +++ b/arch/arm/plat-omap/include/dspbridge/node.h @@ -68,6 +68,7 @@ #include #include #include +#include /* * ======== NODE_Allocate ======== @@ -104,7 +105,8 @@ *pArgs, OPTIONAL IN CONST struct DSP_NODEATTRIN *pAttrIn, - OUT struct NODE_OBJECT **phNode); + OUT struct NODE_OBJECT **phNode, + struct PROCESS_CONTEXT *pr_ctxt); /* * ======== NODE_AllocMsgBuf ======== diff --git a/drivers/dsp/bridge/pmgr/wcd.c b/drivers/dsp/bridge/pmgr/wcd.c index 23ed3a7..05afb2c 100644 --- a/drivers/dsp/bridge/pmgr/wcd.c +++ b/drivers/dsp/bridge/pmgr/wcd.c @@ -1170,7 +1170,7 @@ u32 NODEWRAP_Allocate(union Trapped_Args *args, void *pr_ctxt) if (DSP_SUCCEEDED(status)) { status = NODE_Allocate(args->ARGS_NODE_ALLOCATE.hProcessor, &nodeId, (struct DSP_CBDATA *)pArgs, - pAttrIn, &hNode); + pAttrIn, &hNode, pr_ctxt); } cp_to_usr(args->ARGS_NODE_ALLOCATE.phNode, &hNode, status, 1); func_cont: diff --git a/drivers/dsp/bridge/rmgr/node.c b/drivers/dsp/bridge/rmgr/node.c index 5ff87e9..b7bdf08 100644 --- a/drivers/dsp/bridge/rmgr/node.c +++ b/drivers/dsp/bridge/rmgr/node.c @@ -389,7 +389,8 @@ DSP_STATUS NODE_Allocate(struct PROC_OBJECT *hProcessor, IN CONST struct DSP_UUID *pNodeId, OPTIONAL IN CONST struct DSP_CBDATA *pArgs, OPTIONAL IN CONST struct DSP_NODEATTRIN *pAttrIn, - OUT struct NODE_OBJECT **phNode) + OUT struct NODE_OBJECT **phNode, + struct PROCESS_CONTEXT *pr_ctxt) { struct NODE_MGR *hNodeMgr; struct DEV_OBJECT *hDevObject; @@ -418,11 +419,7 @@ DSP_STATUS NODE_Allocate(struct PROC_OBJECT *hProcessor, #endif #ifndef RES_CLEANUP_DISABLE - HANDLE hDrvObject; HANDLE nodeRes; - u32 hProcess; - struct PROCESS_CONTEXT *pPctxt = NULL; - DSP_STATUS res_status = DSP_SOK; #endif DBC_Require(cRefs > 0); @@ -789,45 +786,9 @@ func_cont2: #ifndef RES_CLEANUP_DISABLE if (DSP_SUCCEEDED(status)) { - /* Return TGID instead of process handle */ - hProcess = current->tgid; - - res_status = CFG_GetObject((u32 *)&hDrvObject, - REG_DRV_OBJECT); - if (DSP_SUCCEEDED(res_status)) { - DRV_GetProcContext(hProcess, - (struct DRV_OBJECT *)hDrvObject, - &pPctxt, *phNode, 0); - if (pPctxt == NULL) { - DRV_InsertProcContext( - (struct DRV_OBJECT *)hDrvObject, - &pPctxt); - if (pPctxt != NULL) { - DRV_ProcUpdatestate(pPctxt, - PROC_RES_ALLOCATED); - DRV_ProcSetPID(pPctxt, hProcess); - pPctxt->hProcessor = - (DSP_HPROCESSOR)hProcessor; - } - } - } - } - if (DSP_SUCCEEDED(status)) { - /* Return TGID instead of process handle */ - hProcess = current->tgid; - res_status = CFG_GetObject((u32 *)&hDrvObject, - REG_DRV_OBJECT); - if (DSP_SUCCEEDED(res_status)) { - DRV_GetProcContext(hProcess, - (struct DRV_OBJECT *)hDrvObject, - &pPctxt, *phNode, 0); - if (pPctxt != NULL) { - DRV_InsertNodeResElement(*phNode, &nodeRes, - pPctxt); - DRV_ProcNodeUpdateHeapStatus(nodeRes, true); - DRV_ProcNodeUpdateStatus(nodeRes, true); - } - } + DRV_InsertNodeResElement(*phNode, &nodeRes, pr_ctxt); + DRV_ProcNodeUpdateHeapStatus(nodeRes, true); + DRV_ProcNodeUpdateStatus(nodeRes, true); } #endif DBC_Ensure((DSP_FAILED(status) && (*phNode == NULL)) ||