diff options
author | David S. Miller <davem@davemloft.net> | 2010-09-09 10:49:04 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-09-09 10:49:04 +0400 |
commit | e199e6136ce6b151e6638ae93dca60748424d900 (patch) | |
tree | 0d66e0b5d227c36b005e4f5537f4bbcfc6ed4904 /drivers/staging/tidspbridge/gen/gs.c | |
parent | 972c40b5bee429c84ba727f8ac0a08292bc5dc3d (diff) | |
parent | d56557af19867edb8c0e96f8e26399698a08857f (diff) | |
download | linux-e199e6136ce6b151e6638ae93dca60748424d900.tar.xz |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/staging/tidspbridge/gen/gs.c')
-rw-r--r-- | drivers/staging/tidspbridge/gen/gs.c | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/drivers/staging/tidspbridge/gen/gs.c b/drivers/staging/tidspbridge/gen/gs.c new file mode 100644 index 000000000000..9fc614439baa --- /dev/null +++ b/drivers/staging/tidspbridge/gen/gs.c @@ -0,0 +1,89 @@ +/* + * gs.c + * + * DSP-BIOS Bridge driver support functions for TI OMAP processors. + * + * General storage memory allocator 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. + */ + +#include <linux/types.h> +/* ----------------------------------- DSP/BIOS Bridge */ +#include <dspbridge/dbdefs.h> +#include <linux/types.h> + +/* ----------------------------------- This */ +#include <dspbridge/gs.h> + +#include <linux/slab.h> + +/* ----------------------------------- Globals */ +static u32 cumsize; + +/* + * ======== gs_alloc ======== + * purpose: + * Allocates memory of the specified size. + */ +void *gs_alloc(u32 size) +{ + void *p; + + p = kzalloc(size, GFP_KERNEL); + if (p == NULL) + return NULL; + cumsize += size; + return p; +} + +/* + * ======== gs_exit ======== + * purpose: + * Discontinue the usage of the GS module. + */ +void gs_exit(void) +{ + /* Do nothing */ +} + +/* + * ======== gs_free ======== + * purpose: + * Frees the memory. + */ +void gs_free(void *ptr) +{ + kfree(ptr); + /* ack! no size info */ + /* cumsize -= size; */ +} + +/* + * ======== gs_frees ======== + * purpose: + * Frees the memory. + */ +void gs_frees(void *ptr, u32 size) +{ + kfree(ptr); + cumsize -= size; +} + +/* + * ======== gs_init ======== + * purpose: + * Initializes the GS module. + */ +void gs_init(void) +{ + /* Do nothing */ +} |