Update from omapzoom 18-Aug-2008
[bridge-dev.git] / 0013-BRIDGE-remove-homebrewn-macros.patch
bloba9869218469cb160629d5232d6b9c02748cfa8d7
1 From: Omar Ramirez Luna <x00omar@ti.com> on behalf of Ramesh Gupta <grgupta@ti.com>
2 Subject: [PATCH] Removed home brewn macros
4 Removed MAX, MIN, Min from bridge sources and replaced them with
5 max/min from the kernel header file. Also cleaned up the resource
6 cleanup functions.
8 Signed-off-by: Ramesh Gupta <grgupta@ti.com>
9 ---
10 drivers/dsp/bridge/pmgr/dbl.c | 4 --
11 drivers/dsp/bridge/rmgr/drv.c | 33 ---------------------
12 drivers/dsp/bridge/rmgr/rmm.c | 4 --
13 drivers/dsp/bridge/wmd/io_sm.c | 6 +--
14 arch/arm/plat-omap/include/bridge/resourcecleanup.h | 18 -----------
15 5 files changed, 4 insertions(+), 61 deletions(-)
17 Index: omapkernel/arch/arm/plat-omap/include/bridge/resourcecleanup.h
18 ===================================================================
19 --- omapkernel.orig/arch/arm/plat-omap/include/bridge/resourcecleanup.h 2008-08-12 18:31:03.000000000 -0500
20 +++ omapkernel/arch/arm/plat-omap/include/bridge/resourcecleanup.h 2008-08-12 21:11:36.000000000 -0500
21 @@ -82,24 +82,6 @@
23 extern DSP_STATUS DRV_RemoveAllSTRMResElements(HANDLE pCtxt);
25 -extern DSP_STATUS DRV_GetDSPHEAPResElement(u32 pMapAddr, HANDLE hDSPHEAPRes,
26 - HANDLE hPCtxt);
28 -extern DSP_STATUS DRV_RemoveAllDSPHEAPResElements(HANDLE hPCtxt);
30 -extern DSP_STATUS DRV_ProcFreeDSPHEAPRes(HANDLE hPCtxt);
32 -extern DSP_STATUS DRV_UpdateDSPHEAPResElement(HANDLE hDSPHEAPRes,
33 - u32 pMpuAddr, u32 ulSize,
34 - u32 pReqAddr, u32 pMapAddr,
35 - HANDLE hProcessor);
37 -extern DSP_STATUS DRV_RemoveDSPHEAPResElement(HANDLE hDSPHEAPRes,
38 - HANDLE hPCtxt);
40 -extern DSP_STATUS DRV_InsertDSPHEAPResElement(HANDLE hDSPHEAPRes,
41 - HANDLE hPCtxt);
43 extern DSP_STATUS DRV_ProcDisplayResInfo(u8 *pBuf, u32 *pSize);
45 extern enum NODE_STATE NODE_GetState(HANDLE hNode);
46 Index: omapkernel/drivers/dsp/bridge/pmgr/dbl.c
47 ===================================================================
48 --- omapkernel.orig/drivers/dsp/bridge/pmgr/dbl.c 2008-08-12 18:31:03.000000000 -0500
49 +++ omapkernel/drivers/dsp/bridge/pmgr/dbl.c 2008-08-12 21:11:36.000000000 -0500
50 @@ -72,8 +72,6 @@
51 #define EXECUTEPHASE 2
52 #define NONE 3 /* For overlay section with phase not specified */
54 -#define MIN(a, b) ((a) < (b) ? (a) : (b))
56 /* Default load buffer size */
57 #define LOADBUFSIZE 0x800
59 @@ -1056,7 +1054,7 @@
60 addr = sectHdr.addr;
61 space = sectHdr.page;
62 for (total = sectHdr.size; total > 0; total -= nWords) {
63 - nWords = MIN(total, bufSize);
64 + nWords = min(total, bufSize);
65 nBytes = nWords * mauSize;
66 /* Read section data */
67 if ((*dbl->dblAttrs.fread)(pBuf, nBytes, 1,
68 Index: omapkernel/drivers/dsp/bridge/rmgr/drv.c
69 ===================================================================
70 --- omapkernel.orig/drivers/dsp/bridge/rmgr/drv.c 2008-08-12 18:31:03.000000000 -0500
71 +++ omapkernel/drivers/dsp/bridge/rmgr/drv.c 2008-08-12 21:11:36.000000000 -0500
72 @@ -861,39 +861,6 @@
73 (*STRMRes)->uNumBufs = uNumBufs;
74 return status;
77 -/* Actual DSPHEAP De-Allocation */
78 -DSP_STATUS DRV_ProcFreeDSPHEAPRes(HANDLE hPCtxt)
80 - struct PROCESS_CONTEXT *pCtxt = (struct PROCESS_CONTEXT *)hPCtxt;
81 - DSP_STATUS status = DSP_SOK;
82 - struct DSPHEAP_RES_OBJECT *pDSPHEAPList = NULL;
83 - struct DSPHEAP_RES_OBJECT *pDSPHEAPRes = NULL;
85 - DBC_Assert(hPCtxt != NULL);
86 - pDSPHEAPList = pCtxt->pDSPHEAPList;
87 - while (pDSPHEAPList != NULL) {
88 - pDSPHEAPRes = pDSPHEAPList;
89 - pDSPHEAPList = pDSPHEAPList->next;
90 - if (pDSPHEAPRes->heapAllocated) {
91 - GT_1trace(curTrace, GT_5CLASS,
92 - "DRV_ProcFreeDSPHEAPRes:Unmapping "
93 - "pDSPHEAPRes->ulDSPAddr:%x \n",
94 - pDSPHEAPRes->ulDSPAddr);
95 - status = PROC_UnMap(pDSPHEAPRes->hProcessor,
96 - (void *) pDSPHEAPRes->ulDSPAddr);
97 - GT_1trace(curTrace, GT_5CLASS,
98 - "DRV_ProcFreeDSPHEAPRes:UnReserving"
99 - " memory:pDSPHEAPRes->ulDSPResAddr: %x \n",
100 - pDSPHEAPRes->ulDSPResAddr);
101 - status = PROC_UnReserveMemory(pDSPHEAPRes->hProcessor,
102 - (void *)pDSPHEAPRes->ulDSPResAddr);
103 - pDSPHEAPRes->heapAllocated = 0;
106 - return status;
109 /* Displaying the resources allocated by a process */
110 DSP_STATUS DRV_ProcDisplayResInfo(u8 *pBuf1, u32 *pSize)
112 Index: omapkernel/drivers/dsp/bridge/rmgr/rmm.c
113 ===================================================================
114 --- omapkernel.orig/drivers/dsp/bridge/rmgr/rmm.c 2008-08-12 18:31:03.000000000 -0500
115 +++ omapkernel/drivers/dsp/bridge/rmgr/rmm.c 2008-08-12 21:11:36.000000000 -0500
116 @@ -69,8 +69,6 @@
118 #define RMM_TARGSIGNATURE 0x544d4d52 /* "TMMR" */
120 -#define MAX(x, y) ((x) > (y) ? (x) : (y))
123 * ======== RMM_Header ========
124 * This header is used to maintain a list of free memory blocks.
125 @@ -456,7 +454,7 @@
127 /* Collect data from freeList */
128 while (head != NULL) {
129 - maxFreeSize = MAX(maxFreeSize, head->size);
130 + maxFreeSize = max(maxFreeSize, head->size);
131 totalFreeSize += head->size;
132 freeBlocks++;
133 head = head->next;
134 Index: omapkernel/drivers/dsp/bridge/wmd/io_sm.c
135 ===================================================================
136 --- omapkernel.orig/drivers/dsp/bridge/wmd/io_sm.c 2008-08-12 18:31:03.000000000 -0500
137 +++ omapkernel/drivers/dsp/bridge/wmd/io_sm.c 2008-08-12 21:11:36.000000000 -0500
138 @@ -168,8 +168,6 @@
140 #define EXTEND "_EXT_END"
142 -#define Min(x, y) ((x < y) ? x : y)
144 #define SwapWord(x) (x)
145 #define ulPageAlignSize 0x10000 /* Page Align Size */
147 @@ -1219,7 +1217,7 @@
148 DBC_Assert(pChnl->cIOReqs >= 0);
149 /* Ensure we don't overflow the client's
150 * buffer: */
151 - uBytes = Min(uBytes, pChirp->cBytes);
152 + uBytes = min(uBytes, pChirp->cBytes);
153 /* Transfer buffer from DSP side: */
154 uBytes = ReadData(pIOMgr->hWmdContext,
155 pChirp->pHostSysBuf,
156 @@ -1461,7 +1459,7 @@
158 /* Transfer buffer to DSP side: */
159 pChirp->cBytes = WriteData(pIOMgr->hWmdContext, pIOMgr->pOutput,
160 - pChirp->pHostSysBuf, Min(pIOMgr->uSMBufSize, pChirp->
161 + pChirp->pHostSysBuf, min(pIOMgr->uSMBufSize, pChirp->
162 cBytes));
163 pChnl->cBytesMoved += pChirp->cBytes;
164 /* Write all 32 bits of arg */