Lines Matching +full:on +full:- +full:the +full:- +full:fly
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Device driver for the SYMBIOS/LSILOGIC 53C8XX and 53C1010 family
4 * of PCI-SCSI IO processors.
6 * Copyright (C) 1999-2001 Gerard Roudier <groudier@free.fr>
8 * This driver is derived from the Linux sym53c8xx driver.
9 * Copyright (C) 1998-2000 Gerard Roudier
11 * The sym53c8xx driver is derived from the ncr53c8xx driver that had been
12 * a port of the FreeBSD ncr driver to Linux-1.2.13.
14 * The original ncr driver has been written for 386bsd and FreeBSD by
16 * Stefan Esser <se@mi.Uni-Koeln.de>
24 *-----------------------------------------------------------------------------
30 * Simple power of two buddy-like generic allocator.
35 * Since the SCRIPTS processor only supplies 8 bit arithmetic,
37 * from the SCRIPTS code. In addition, cache line alignment
40 * This allocator has been developed for the Linux sym53c8xx
43 * It has the advantage of allowing the driver to use private
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()
91 * Counter-part of the generic allocator.
99 m_link_p h = mp->h; 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()
143 * Verbose and zeroing allocator that wrapps to the generic allocator.
152 printf ("new %-10s[%4d] @%p.\n", name, size, 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()
206 * New pools are created on the fly when a new pool id is provided.
207 * They are deleted on the fly when they get emptied.
209 /* Get a memory cluster that matches the DMA constraints of a given pool */
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()
251 /* Fetch the memory pool for a given pool id (i.e. DMA constraints) */
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()
285 pp = &(*pp)->next; in ___del_dma_pool()
287 *pp = (*pp)->next; in ___del_dma_pool()
293 /* This lock protects only the memory allocation/free. */
313 if (!mp->nump) in __sym_calloc_dma()
333 if (!mp->nump) in __sym_mfree_dma()
356 vp = mp->vtob[hc]; in __vtobus()
357 while (vp && vp->vaddr != a) in __vtobus()
358 vp = vp->next; in __vtobus()
362 b = vp->baddr + (m - a); in __vtobus()