deleted file mode 100644
@@ -1,142 +0,0 @@
-/*
- * mem.h
- *
- * DSP-BIOS Bridge driver support functions for TI OMAP processors.
- *
- * Memory management and address mapping services for the DSP/BIOS Bridge
- * class driver and mini-driver.
- *
- * Copyright (C) 2008 Texas Instruments, Inc.
- *
- * This package is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-#ifndef MEM_
-#define MEM_
-
-#include <dspbridge/host_os.h>
-#include <dspbridge/memdefs.h>
-
-/*
- * ======== mem_alloc ========
- * Purpose:
- * Allocate memory from the paged or non-paged pools.
- * Parameters:
- * byte_size: Number of bytes to allocate.
- * type: Type of memory to allocate; one of:
- * MEM_PAGED: Allocate from pageable memory.
- * MEM_NONPAGED: Allocate from page locked memory.
- * Returns:
- * Pointer to a block of memory;
- * NULL if memory couldn't be allocated, if byte_size == 0, or if type is
- * not one of MEM_PAGED or MEM_NONPAGED.
- * Requires:
- * MEM initialized.
- * Ensures:
- * The returned pointer, if not NULL, points to a valid memory block of
- * the size requested.
- */
-extern void *mem_alloc(IN u32 byte_size, IN enum mem_poolattrs type);
-
-/*
- * ======== MEM_ALLOC_OBJECT ========
- * Purpose:
- * Allocate an object, and set it's signature.
- * Parameters:
- * pObj: Pointer to the new object.
- * Obj: Type of the object to allocate.
- * Signature: Magic field value. Must be non-zero.
- * Returns:
- * Requires:
- * Same requirements as mem_calloc(); and
- * The object structure has a dw_signature field. The compiler ensures
- * this requirement.
- * Ensures:
- * A subsequent call to MEM_IS_VALID_HANDLE() will succeed for this object.
- */
-#define MEM_ALLOC_OBJECT(pObj, Obj, Signature) \
-{ \
- pObj = kzalloc(sizeof(Obj), GFP_KERNEL); \
- if (pObj) { \
- pObj->dw_signature = Signature; \
- } \
-}
-
-/*
- * ======== mem_calloc ========
- * Purpose:
- * Allocate zero-initialized memory from the paged or non-paged pools.
- * Parameters:
- * byte_size: Number of bytes to allocate.
- * type: Type of memory to allocate; one of:
- * MEM_PAGED: Allocate from pageable memory.
- * MEM_NONPAGED: Allocate from page locked memory.
- * Returns:
- * Pointer to a block of zeroed memory;
- * NULL if memory couldn't be allocated, if byte_size == 0, or if type is
- * not one of MEM_PAGED or MEM_NONPAGED.
- * Requires:
- * MEM initialized.
- * Ensures:
- * The returned pointer, if not NULL, points to a valid memory block
- * of the size requested.
- */
-extern void *mem_calloc(IN u32 byte_size, IN enum mem_poolattrs type);
-
-/*
- * ======== MEM_FREE_OBJECT ========
- * Purpose:
- * Utility macro to invalidate an object's signature, and deallocate it.
- * Parameters:
- * pObj: Pointer to the object to free.
- * Returns:
- * Requires:
- * Same requirements as kfree().
- * Ensures:
- * A subsequent call to MEM_IS_VALID_HANDLE() will fail for this object.
- */
-#define MEM_FREE_OBJECT(pObj) \
-{ \
- pObj->dw_signature = 0x00; \
- kfree(pObj); \
-}
-
-/*
- * ======== mem_get_num_pages ========
- * Purpose:
- * Calculate the number of pages corresponding to the supplied buffer.
- * Parameters:
- * paddr: Linear (virtual) address of the buffer.
- * byte_size: Number of bytes in the buffer.
- * Returns:
- * Number of pages.
- * Requires:
- * MEM initialized.
- * Ensures:
- * If byte_size > 0, number of pages returned > 0.
- */
-extern s32 mem_get_num_pages(IN void *paddr, IN u32 byte_size);
-
-/*
- * ======== MEM_IS_VALID_HANDLE ========
- * Purpose:
- * Validate the object handle.
- * Parameters:
- * hObj: Handle to object created with MEM_ALLOC_OBJECT().
- * Sig: Expected signature u32.
- * Returns:
- * TRUE if handle is valid; FALSE otherwise.
- * Requires:
- * The object structure has a dw_signature field. Ensured by compiler.
- * Ensures:
- */
-#define MEM_IS_VALID_HANDLE(hObj, Sig) \
- ((hObj != NULL) && (hObj->dw_signature == Sig))
-
-#endif /* MEM_ */
@@ -19,13 +19,6 @@
#ifndef MEMDEFS_
#define MEMDEFS_
-/* Memory Pool Attributes: */
-enum mem_poolattrs {
- MEM_PAGED = 0,
- MEM_NONPAGED = 1,
- MEM_LARGEVIRTMEM = 2
-};
-
/*
* MEM_VIRTUALSEGID is used by Node & Strm to access virtual address space in
* the correct client process context.
@@ -20,7 +20,6 @@
#ifndef WCDIOCTL_
#define WCDIOCTL_
-#include <dspbridge/mem.h>
#include <dspbridge/cmm.h>
#include <dspbridge/strmdefs.h>
#include <dspbridge/dbdcd.h>
@@ -352,34 +351,6 @@ union Trapped_Args {
struct cmm_info __user *cmm_info_obj;
} args_cmm_getinfo;
- /* MEM Module */
- struct {
- u32 byte_size;
- enum mem_poolattrs type;
- void *mem;
- } args_mem_alloc;
-
- struct {
- u32 byte_size;
- enum mem_poolattrs type;
- void *mem;
- } args_mem_calloc;
-
- struct {
- void *mem;
- } args_mem_free;
-
- struct {
- void *pbuffer;
- u32 size;
- void *locked_buffer;
- } args_mem_pagelock;
-
- struct {
- void *pbuffer;
- u32 size;
- } args_mem_pageunlock;
-
/* UTIL module */
struct {
s32 util_argc;
@@ -1,7 +1,7 @@
obj-$(CONFIG_MPU_BRIDGE) += bridgedriver.o
libgen = gen/gb.o gen/gs.o gen/gh.o gen/uuidutil.o
-libservices = services/mem.o services/sync.o \
+libservices = services/sync.o \
services/clk.o services/cfg.o services/reg.o \
services/regsup.o services/ntfy.o \
services/services.o
@@ -20,12 +20,12 @@
#include <dspbridge/std.h>
#include <dspbridge/dbdefs.h>
#include <linux/types.h>
-/* ----------------------------------- OS Adaptation Layer */
-#include <dspbridge/mem.h>
/* ----------------------------------- This */
#include <dspbridge/gs.h>
+#include <linux/slab.h>
+
/* ----------------------------------- Globals */
static u32 cumsize;
@@ -30,7 +30,6 @@
/* ----------------------------------- OS Adaptation Layer */
#include <dspbridge/cfg.h>
-#include <dspbridge/mem.h>
#include <dspbridge/sync.h>
/* ----------------------------------- Platform Manager */
@@ -41,7 +41,6 @@
/* ----------------------------------- OS Adaptation Layer */
#include <dspbridge/cfg.h>
#include <dspbridge/list.h>
-#include <dspbridge/mem.h>
#include <dspbridge/sync.h>
#include <dspbridge/utildefs.h>
@@ -35,7 +35,6 @@
/* ----------------------------------- OS Adaptation Layer */
#include <dspbridge/ldr.h>
-#include <dspbridge/mem.h>
/* ----------------------------------- Platform Manager */
/* Include appropriate loader header file */
@@ -27,7 +27,6 @@
#include <dspbridge/gh.h>
/* ----------------------------------- OS Adaptation Layer */
-#include <dspbridge/mem.h>
/* Dynamic loader library interface */
#include <dspbridge/dynamic_loader.h>
@@ -31,7 +31,6 @@
#include <dspbridge/cfg.h>
#include <dspbridge/ldr.h>
#include <dspbridge/list.h>
-#include <dspbridge/mem.h>
/* ----------------------------------- Platform Manager */
#include <dspbridge/cod.h>
@@ -33,7 +33,6 @@
#include <dspbridge/errbase.h>
/* ----------------------------------- OS Adaptation Layer */
-#include <dspbridge/mem.h>
#include <dspbridge/sync.h>
/* ----------------------------------- Platform Manager */
@@ -29,7 +29,6 @@
/* ----------------------------------- OS Adaptation Layer */
#include <dspbridge/cfg.h>
-#include <dspbridge/mem.h>
/* ----------------------------------- Platform Manager */
#include <dspbridge/dev.h>
@@ -27,9 +27,6 @@
/* ----------------------------------- Trace & Debug */
#include <dspbridge/dbc.h>
-/* ----------------------------------- OS Adaptation Layer */
-#include <dspbridge/mem.h>
-
/* ----------------------------------- Mini Driver */
#include <dspbridge/wmd.h>
@@ -30,7 +30,6 @@
/* ----------------------------------- OS Adaptation Layer */
#include <dspbridge/cfg.h>
-#include <dspbridge/mem.h>
#include <dspbridge/ntfy.h>
#include <dspbridge/services.h>
@@ -34,7 +34,6 @@
#include <dspbridge/dbc.h>
/* ----------------------------------- OS Adaptation Layer */
-#include <dspbridge/mem.h>
#include <dspbridge/reg.h>
/* ----------------------------------- Platform Manager */
@@ -29,7 +29,6 @@
#include <dspbridge/dbc.h>
/* ----------------------------------- OS Adaptation Layer */
-#include <dspbridge/mem.h>
#include <dspbridge/sync.h>
/* ----------------------------------- Link Driver */
@@ -30,7 +30,6 @@
/* ----------------------------------- OS Adaptation Layer */
#include <dspbridge/cfg.h>
#include <dspbridge/list.h>
-#include <dspbridge/mem.h>
#include <dspbridge/reg.h>
/* ----------------------------------- This */
@@ -29,7 +29,6 @@
/* ----------------------------------- OS Adaptation Layer */
#include <dspbridge/cfg.h>
-#include <dspbridge/mem.h>
#include <dspbridge/reg.h>
/* ----------------------------------- Platform Manager */
@@ -28,7 +28,6 @@
/* ----------------------------------- OS Adaptation Layer */
#include <dspbridge/cfg.h>
-#include <dspbridge/mem.h>
#include <dspbridge/sync.h>
/* ----------------------------------- Others */
@@ -24,9 +24,6 @@
#include <dspbridge/dbc.h>
-/* OS adaptation layer */
-#include <dspbridge/mem.h>
-
/* Platform manager */
#include <dspbridge/cod.h>
#include <dspbridge/dev.h>
@@ -30,7 +30,7 @@
/* ----------------------------------- OS Adaptation Layer */
#include <dspbridge/cfg.h>
#include <dspbridge/list.h>
-#include <dspbridge/mem.h>
+#include <dspbridge/memdefs.h>
#include <dspbridge/proc.h>
#include <dspbridge/strm.h>
#include <dspbridge/sync.h>
@@ -30,7 +30,6 @@
/* ----------------------------------- OS Adaptation Layer */
#include <dspbridge/cfg.h>
#include <dspbridge/list.h>
-#include <dspbridge/mem.h>
#include <dspbridge/ntfy.h>
#include <dspbridge/sync.h>
/* ----------------------------------- Mini Driver */
@@ -47,7 +47,6 @@
/* ----------------------------------- OS Adaptation Layer */
#include <dspbridge/list.h>
-#include <dspbridge/mem.h>
/* ----------------------------------- This */
#include <dspbridge/rmm.h>
@@ -28,7 +28,6 @@
#include <dspbridge/dbc.h>
/* ----------------------------------- OS Adaptation Layer */
-#include <dspbridge/mem.h>
#include <dspbridge/sync.h>
/* ----------------------------------- Mini Driver */
@@ -27,9 +27,6 @@
/* ----------------------------------- Trace & Debug */
#include <dspbridge/dbc.h>
-/* ----------------------------------- OS Adaptation Layer */
-#include <dspbridge/mem.h>
-
/* ----------------------------------- This */
#include <dspbridge/clk.h>
deleted file mode 100644
@@ -1,98 +0,0 @@
-/*
- * mem.c
- *
- * DSP-BIOS Bridge driver support functions for TI OMAP processors.
- *
- * Implementation of platform specific memory services.
- *
- * Copyright (C) 2005-2006 Texas Instruments, Inc.
- *
- * This package is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-/* ----------------------------------- Host OS */
-#include <dspbridge/host_os.h>
-
-/* ----------------------------------- DSP/BIOS Bridge */
-#include <dspbridge/std.h>
-#include <dspbridge/dbdefs.h>
-#include <dspbridge/errbase.h>
-
-/* ----------------------------------- Trace & Debug */
-#include <dspbridge/dbc.h>
-
-/* ----------------------------------- This */
-#include <dspbridge/mem.h>
-#include <dspbridge/list.h>
-
-/* ----------------------------------- Defines */
-#define MEM512MB 0x1fffffff
-
-/* ----------------------------------- Globals */
-
-
-/*
- * ======== mem_alloc ========
- * Purpose:
- * Allocate memory from the paged or non-paged pools.
- */
-void *mem_alloc(u32 byte_size, enum mem_poolattrs type)
-{
- void *mem = NULL;
-
- if (byte_size > 0) {
- switch (type) {
- case MEM_NONPAGED:
- /* Fall through */
- case MEM_PAGED:
- mem = kmalloc(byte_size,
- (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL);
- break;
- case MEM_LARGEVIRTMEM:
- mem = vmalloc(byte_size);
- break;
-
- default:
- break;
- }
- }
-
- return mem;
-}
-
-
-/*
- * ======== mem_calloc ========
- * Purpose:
- * Allocate zero-initialized memory from the paged or non-paged pools.
- */
-void *mem_calloc(u32 byte_size, enum mem_poolattrs type)
-{
- void *mem = NULL;
-
- if (byte_size > 0) {
- switch (type) {
- case MEM_NONPAGED:
- /* Fall through */
- case MEM_PAGED:
- mem = kzalloc(byte_size,
- (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL);
- break;
- case MEM_LARGEVIRTMEM:
- mem = __vmalloc(byte_size,
- GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO,
- PAGE_KERNEL);
- break;
- default:
- break;
- }
- }
-
- return mem;
-}
@@ -27,9 +27,6 @@
/* ----------------------------------- Trace & Debug */
#include <dspbridge/dbc.h>
-/* ----------------------------------- OS Adaptation Layer */
-#include <dspbridge/mem.h>
-
/* ----------------------------------- This */
#include <dspbridge/reg.h>
#include <regsup.h>
@@ -28,7 +28,6 @@
#include <dspbridge/dbc.h>
/* ----------------------------------- OS Adaptation Layer */
-#include <dspbridge/mem.h>
#include <dspbridge/list.h>
/* ----------------------------------- This */
@@ -27,7 +27,6 @@
/* ----------------------------------- OS Adaptation Layer */
#include <dspbridge/cfg.h>
-#include <dspbridge/mem.h>
#include <dspbridge/ntfy.h>
#include <dspbridge/reg.h>
#include <dspbridge/sync.h>
@@ -54,7 +54,6 @@
#include <dspbridge/dbc.h>
/* ----------------------------------- OS Adaptation Layer */
-#include <dspbridge/mem.h>
#include <dspbridge/cfg.h>
#include <dspbridge/sync.h>
@@ -38,7 +38,6 @@
/* Services Layer */
#include <dspbridge/cfg.h>
-#include <dspbridge/mem.h>
#include <dspbridge/ntfy.h>
#include <dspbridge/sync.h>
#include <dspbridge/reg.h>
@@ -26,7 +26,6 @@
#include <dspbridge/dbc.h>
/* ----------------------------------- OS Adaptation Layer */
-#include <dspbridge/mem.h>
#include <dspbridge/drv.h>
/* ----------------------------------- Link Driver */
@@ -26,7 +26,6 @@
/* ----------------------------------- OS Adaptation Layer */
#include <dspbridge/list.h>
-#include <dspbridge/mem.h>
#include <dspbridge/sync.h>
/* ----------------------------------- Platform Manager */
@@ -31,7 +31,6 @@
#include <dspbridge/dbc.h>
/* ----------------------------------- OS Adaptation Layer */
-#include <dspbridge/mem.h>
#include <dspbridge/reg.h>
#include <dspbridge/cfg.h>
#include <dspbridge/drv.h>
@@ -23,9 +23,6 @@
#include <dspbridge/drv.h>
#include <dspbridge/io_sm.h>
-/* ----------------------------------- OS Adaptation Layer */
-#include <dspbridge/mem.h>
-
/* ----------------------------------- Platform Manager */
#include <dspbridge/brddefs.h>
#include <dspbridge/dev.h>
@@ -28,7 +28,6 @@
#include <dspbridge/drv.h>
/* ----------------------------------- OS Adaptation Layer */
-#include <dspbridge/mem.h>
#include <dspbridge/cfg.h>
#include <dspbridge/wdt.h>
@@ -29,7 +29,6 @@
/* ----------------------------------- OS Adaptation Layer */
#include <dspbridge/cfg.h>
-#include <dspbridge/mem.h>
#include <dspbridge/ntfy.h>
#include <dspbridge/drv.h>