Lines Matching +full:vp +full:- +full:p

1 // SPDX-License-Identifier: GPL-2.0-or-later
4 * of PCI-SCSI IO processors.
6 * Copyright (C) 1999-2001 Gerard Roudier <[email protected]>
9 * Copyright (C) 1998-2000 Gerard Roudier
12 * a port of the FreeBSD ncr driver to Linux-1.2.13.
16 * Stefan Esser <[email protected]-Koeln.de>
24 *-----------------------------------------------------------------------------
30 * Simple power of two buddy-like generic allocator.
53 m_link_p h = mp->h; in ___sym_malloc()
68 h[j].next->next = NULL; in ___sym_malloc()
76 h[j].next = h[j].next->next; in ___sym_malloc()
78 j -= 1; in ___sym_malloc()
81 h[j].next->next = NULL; in ___sym_malloc()
85 printf("___sym_malloc(%d) = %p\n", size, (void *) a); in ___sym_malloc()
91 * Counter-part of the generic allocator.
99 m_link_p h = mp->h; in ___sym_mfree()
102 printf("___sym_mfree(%p, %d)\n", ptr, size); in ___sym_mfree()
120 ((m_link_p) a)->next = h[i].next; in ___sym_mfree()
127 while (q->next && q->next != (m_link_p) b) { in ___sym_mfree()
128 q = q->next; in ___sym_mfree()
130 if (!q->next) { in ___sym_mfree()
131 ((m_link_p) a)->next = h[i].next; in ___sym_mfree()
135 q->next = q->next->next; in ___sym_mfree()
147 void *p; in __sym_calloc2() local
149 p = ___sym_malloc(mp, size); in __sym_calloc2()
152 printf ("new %-10s[%4d] @%p.\n", name, size, p); in __sym_calloc2()
155 if (p) in __sym_calloc2()
156 memset(p, 0, size); in __sym_calloc2()
159 return p; in __sym_calloc2()
164 * Its counter-part.
169 printf ("freeing %-10s[%4d] @%p.\n", name, size, ptr); in __sym_mfree()
184 ++mp->nump; in ___mp0_get_mem_cluster()
192 --mp->nump; in ___mp0_free_mem_cluster()
222 vbp->next = mp->vtob[hc]; in ___get_dma_mem_cluster()
223 mp->vtob[hc] = vbp; in ___get_dma_mem_cluster()
224 ++mp->nump; in ___get_dma_mem_cluster()
238 vbpp = &mp->vtob[hc]; in ___free_dma_mem_cluster()
239 while (*vbpp && (*vbpp)->vaddr != m) in ___free_dma_mem_cluster()
240 vbpp = &(*vbpp)->next; in ___free_dma_mem_cluster()
243 *vbpp = (*vbpp)->next; in ___free_dma_mem_cluster()
246 --mp->nump; in ___free_dma_mem_cluster()
256 mp && !sym_m_pool_match(mp->dev_dmat, dev_dmat); in ___get_dma_pool()
257 mp = mp->next); in ___get_dma_pool()
266 mp->dev_dmat = dev_dmat; in ___cre_dma_pool()
267 mp->get_mem_cluster = ___get_dma_mem_cluster; in ___cre_dma_pool()
269 mp->free_mem_cluster = ___free_dma_mem_cluster; in ___cre_dma_pool()
271 mp->next = mp0.next; in ___cre_dma_pool()
280 static void ___del_dma_pool(m_pool_p p) in ___del_dma_pool() argument
284 while (*pp && *pp != p) in ___del_dma_pool()
285 pp = &(*pp)->next; in ___del_dma_pool()
287 *pp = (*pp)->next; in ___del_dma_pool()
288 __sym_mfree(&mp0, p, sizeof(*p), "MPOOL"); in ___del_dma_pool()
313 if (!mp->nump) in __sym_calloc_dma()
333 if (!mp->nump) in __sym_mfree_dma()
349 m_vtob_p vp = NULL; in __vtobus() local
356 vp = mp->vtob[hc]; in __vtobus()
357 while (vp && vp->vaddr != a) in __vtobus()
358 vp = vp->next; in __vtobus()
360 if (!vp) in __vtobus()
362 b = vp->baddr + (m - a); in __vtobus()