Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/smartpqi/smartpqi_mem.c
Show All 22 Lines | |||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
* SUCH DAMAGE. | * SUCH DAMAGE. | ||||
*/ | */ | ||||
/* $FreeBSD$ */ | /* $FreeBSD$ */ | ||||
#include "smartpqi_includes.h" | #include "smartpqi_includes.h" | ||||
MALLOC_DEFINE(M_SMARTRAID, "smartraidbuf", "Buffers for the smartraid driver"); | MALLOC_DEFINE(M_SMARTPQI, "smartpqi", "Buffers for the smartpqi(4) driver"); | ||||
/* | /* | ||||
* DMA map load callback function | * DMA map load callback function | ||||
*/ | */ | ||||
static void | static void | ||||
os_dma_map(void *arg, bus_dma_segment_t *segs, int nseg, int error) | os_dma_map(void *arg, bus_dma_segment_t *segs, int nseg, int error) | ||||
{ | { | ||||
bus_addr_t *paddr = (bus_addr_t *)arg; | bus_addr_t *paddr = (bus_addr_t *)arg; | ||||
▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | |||||
* Mem resource allocation wrapper function | * Mem resource allocation wrapper function | ||||
*/ | */ | ||||
void *os_mem_alloc(pqisrc_softstate_t *softs, size_t size) | void *os_mem_alloc(pqisrc_softstate_t *softs, size_t size) | ||||
{ | { | ||||
void *addr = NULL; | void *addr = NULL; | ||||
/* DBG_FUNC("IN\n"); */ | /* DBG_FUNC("IN\n"); */ | ||||
addr = malloc((unsigned long)size, M_SMARTRAID, | addr = malloc((unsigned long)size, M_SMARTPQI, | ||||
M_NOWAIT | M_ZERO); | M_NOWAIT | M_ZERO); | ||||
/* DBG_FUNC("OUT\n"); */ | /* DBG_FUNC("OUT\n"); */ | ||||
return addr; | return addr; | ||||
} | } | ||||
/* | /* | ||||
* Mem resource deallocation wrapper function | * Mem resource deallocation wrapper function | ||||
*/ | */ | ||||
void os_mem_free(pqisrc_softstate_t *softs, | void os_mem_free(pqisrc_softstate_t *softs, | ||||
char *addr, size_t size) | char *addr, size_t size) | ||||
{ | { | ||||
/* DBG_FUNC("IN\n"); */ | /* DBG_FUNC("IN\n"); */ | ||||
free((void*)addr, M_SMARTRAID); | free((void*)addr, M_SMARTPQI); | ||||
/* DBG_FUNC("OUT\n"); */ | /* DBG_FUNC("OUT\n"); */ | ||||
} | } | ||||
/* | /* | ||||
* dma/bus resource deallocation wrapper function | * dma/bus resource deallocation wrapper function | ||||
*/ | */ | ||||
void os_resource_free(pqisrc_softstate_t *softs) | void os_resource_free(pqisrc_softstate_t *softs) | ||||
Show All 10 Lines |