Commit 959992b4 authored by Suman Anna's avatar Suman Anna Committed by Hari Kanigeri

SYSLINK: ipc - removed gt_traces from listmp modules

This patch cleaned up all the gt_traces in listmp_sharedmemory and listmp
modules. Duplicate BUG_ONs have also been removed. return statements have
been added in couple of functions for successful execution scenarions.
Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
parent 43b340cf
...@@ -63,27 +63,18 @@ ...@@ -63,27 +63,18 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/list.h> #include <linux/list.h>
/* Syslink headers */
#include <gt.h>
/* Module level headers */ /* Module level headers */
#include <nameserver.h> #include <nameserver.h>
#include <listmp.h> #include <listmp.h>
#include <listmp_sharedmemory.h> #include <listmp_sharedmemory.h>
#if GT_TRACE
static struct GT_Mask listmp_debugmask = { NULL, NULL }; /* GT trace variable */
EXPORT_SYMBOL(listmp_debugmask);
#endif
/* /*
* ======== listmp_params_init ======== * ======== listmp_params_init ========
* Purpose: * Purpose:
* Function initializes listmp parameters * Function initializes listmp parameters
*/ */
void listmp_params_init(void *listmp_handle, void listmp_params_init(void *listmp_handle, struct listmp_params *params)
struct listmp_params *params)
{ {
BUG_ON(params == NULL); BUG_ON(params == NULL);
listmp_sharedmemory_params_init(listmp_handle, params); listmp_sharedmemory_params_init(listmp_handle, params);
...@@ -115,20 +106,17 @@ void *listmp_create(struct listmp_params *params) ...@@ -115,20 +106,17 @@ void *listmp_create(struct listmp_params *params)
{ {
struct listmp_object *handle = NULL; struct listmp_object *handle = NULL;
gt_1trace(listmp_debugmask, GT_ENTER, "listmp_create", params);
BUG_ON(params == NULL);
if (WARN_ON(params == NULL)) if (WARN_ON(params == NULL))
goto exit; goto exit;
if (params->list_type == listmp_type_SHARED) if (params->list_type == listmp_type_SHARED)
handle = (struct listmp_object *) handle = (struct listmp_object *)
listmp_sharedmemory_create(params); listmp_sharedmemory_create(params);
return (void *)handle;
exit: exit:
gt_1trace(listmp_debugmask, GT_LEAVE, "listmp_create", handle); printk(KERN_ERR "listmp_create: listmp_params passed are NULL!\n");
return (void *)handle; return NULL;
} }
/* /*
...@@ -140,10 +128,6 @@ int listmp_delete(void **listmp_handle_ptr) ...@@ -140,10 +128,6 @@ int listmp_delete(void **listmp_handle_ptr)
{ {
int status = 0; int status = 0;
gt_1trace(listmp_debugmask, GT_ENTER, "listmp_delete",
listmp_handle_ptr);
BUG_ON(*listmp_handle_ptr == NULL);
if (WARN_ON(*listmp_handle_ptr == NULL)) { if (WARN_ON(*listmp_handle_ptr == NULL)) {
status = -EINVAL; status = -EINVAL;
goto exit; goto exit;
...@@ -154,7 +138,10 @@ int listmp_delete(void **listmp_handle_ptr) ...@@ -154,7 +138,10 @@ int listmp_delete(void **listmp_handle_ptr)
status = listmp_sharedmemory_delete(listmp_handle_ptr); status = listmp_sharedmemory_delete(listmp_handle_ptr);
exit: exit:
gt_1trace(listmp_debugmask, GT_LEAVE, "listmp_delete", status); if (status < 0) {
printk(KERN_ERR "listmp_delete failed! status = 0x%x\n",
status);
}
return status; return status;
} }
...@@ -167,11 +154,6 @@ int listmp_open(void **listmp_handle_ptr, struct listmp_params *params) ...@@ -167,11 +154,6 @@ int listmp_open(void **listmp_handle_ptr, struct listmp_params *params)
{ {
int status = 0; int status = 0;
gt_2trace(listmp_debugmask, GT_ENTER, "listmp_open", listmp_handle_ptr,
params);
BUG_ON(listmp_handle_ptr == NULL);
BUG_ON(params == NULL);
if (WARN_ON(listmp_handle_ptr == NULL)) { if (WARN_ON(listmp_handle_ptr == NULL)) {
status = -EINVAL; status = -EINVAL;
goto exit; goto exit;
...@@ -185,7 +167,8 @@ int listmp_open(void **listmp_handle_ptr, struct listmp_params *params) ...@@ -185,7 +167,8 @@ int listmp_open(void **listmp_handle_ptr, struct listmp_params *params)
status = listmp_sharedmemory_open(listmp_handle_ptr, params); status = listmp_sharedmemory_open(listmp_handle_ptr, params);
exit: exit:
gt_1trace(listmp_debugmask, GT_LEAVE, "listmp_open", status); if (status < 0)
printk(KERN_ERR "listmp_open failed! status = 0x%x\n", status);
return status; return status;
} }
...@@ -198,9 +181,6 @@ int listmp_close(void *listmp_handle) ...@@ -198,9 +181,6 @@ int listmp_close(void *listmp_handle)
{ {
int status = 0; int status = 0;
gt_1trace(listmp_debugmask, GT_ENTER, "listmp_close", listmp_handle);
BUG_ON(listmp_handle == NULL);
if (WARN_ON(listmp_handle == NULL)) { if (WARN_ON(listmp_handle == NULL)) {
status = -EINVAL; status = -EINVAL;
goto exit; goto exit;
...@@ -211,7 +191,8 @@ int listmp_close(void *listmp_handle) ...@@ -211,7 +191,8 @@ int listmp_close(void *listmp_handle)
status = listmp_sharedmemory_close(listmp_handle); status = listmp_sharedmemory_close(listmp_handle);
exit: exit:
gt_1trace(listmp_debugmask, GT_LEAVE, "listmp_close", status); if (status < 0)
printk(KERN_ERR "listmp_close failed! status = 0x%x\n", status);
return status; return status;
} }
...@@ -225,9 +206,6 @@ bool listmp_empty(void *listmp_handle) ...@@ -225,9 +206,6 @@ bool listmp_empty(void *listmp_handle)
bool isEmpty = false; bool isEmpty = false;
struct listmp_object *handle = NULL; struct listmp_object *handle = NULL;
gt_1trace(listmp_debugmask, GT_ENTER, "listmp_empty", listmp_handle);
BUG_ON(listmp_handle == NULL);
if (WARN_ON(listmp_handle == NULL)) if (WARN_ON(listmp_handle == NULL))
goto exit; goto exit;
...@@ -237,7 +215,6 @@ bool listmp_empty(void *listmp_handle) ...@@ -237,7 +215,6 @@ bool listmp_empty(void *listmp_handle)
isEmpty = handle->empty(listmp_handle); isEmpty = handle->empty(listmp_handle);
exit: exit:
gt_1trace(listmp_debugmask, GT_LEAVE, "listmp_empty", isEmpty);
return isEmpty; return isEmpty;
} }
...@@ -251,9 +228,6 @@ void *listmp_get_head(void *listmp_handle) ...@@ -251,9 +228,6 @@ void *listmp_get_head(void *listmp_handle)
struct listmp_object *handle = NULL; struct listmp_object *handle = NULL;
struct listmp_elem *elem = NULL; struct listmp_elem *elem = NULL;
gt_1trace(listmp_debugmask, GT_ENTER, "listmp_get_head", listmp_handle);
BUG_ON(listmp_handle == NULL);
if (WARN_ON(listmp_handle == NULL)) if (WARN_ON(listmp_handle == NULL))
goto exit; goto exit;
...@@ -263,7 +237,6 @@ void *listmp_get_head(void *listmp_handle) ...@@ -263,7 +237,6 @@ void *listmp_get_head(void *listmp_handle)
elem = handle->get_head(listmp_handle); elem = handle->get_head(listmp_handle);
exit: exit:
gt_1trace(listmp_debugmask, GT_LEAVE, "listmp_get_head", elem);
return elem; return elem;
} }
...@@ -277,9 +250,6 @@ void *listmp_get_tail(void *listmp_handle) ...@@ -277,9 +250,6 @@ void *listmp_get_tail(void *listmp_handle)
struct listmp_object *handle = NULL; struct listmp_object *handle = NULL;
struct listmp_elem *elem = NULL; struct listmp_elem *elem = NULL;
gt_1trace(listmp_debugmask, GT_ENTER, "listmp_get_tail", listmp_handle);
BUG_ON(listmp_handle == NULL);
if (WARN_ON(listmp_handle == NULL)) if (WARN_ON(listmp_handle == NULL))
goto exit; goto exit;
...@@ -289,7 +259,6 @@ void *listmp_get_tail(void *listmp_handle) ...@@ -289,7 +259,6 @@ void *listmp_get_tail(void *listmp_handle)
elem = handle->get_tail(listmp_handle); elem = handle->get_tail(listmp_handle);
exit: exit:
gt_1trace(listmp_debugmask, GT_LEAVE, "listmp_get_tail", elem);
return elem; return elem;
} }
...@@ -303,11 +272,6 @@ int listmp_put_head(void *listmp_handle, struct listmp_elem *elem) ...@@ -303,11 +272,6 @@ int listmp_put_head(void *listmp_handle, struct listmp_elem *elem)
int status = 0; int status = 0;
struct listmp_object *handle = NULL; struct listmp_object *handle = NULL;
gt_2trace(listmp_debugmask, GT_ENTER, "listmp_put_head",
listmp_handle,
elem);
BUG_ON(listmp_handle == NULL);
if (WARN_ON(listmp_handle == NULL)) { if (WARN_ON(listmp_handle == NULL)) {
status = -EINVAL; status = -EINVAL;
goto exit; goto exit;
...@@ -323,7 +287,10 @@ int listmp_put_head(void *listmp_handle, struct listmp_elem *elem) ...@@ -323,7 +287,10 @@ int listmp_put_head(void *listmp_handle, struct listmp_elem *elem)
status = handle->put_head(listmp_handle, elem); status = handle->put_head(listmp_handle, elem);
exit: exit:
gt_1trace(listmp_debugmask, GT_LEAVE, "listmp_put_head", status); if (status < 0) {
printk(KERN_ERR "listmp_put_head failed! status = 0x%x\n",
status);
}
return status; return status;
} }
...@@ -337,10 +304,6 @@ int listmp_put_tail(void *listmp_handle, struct listmp_elem *elem) ...@@ -337,10 +304,6 @@ int listmp_put_tail(void *listmp_handle, struct listmp_elem *elem)
int status = 0; int status = 0;
struct listmp_object *handle = NULL; struct listmp_object *handle = NULL;
gt_2trace(listmp_debugmask, GT_ENTER, "listmp_put_tail", listmp_handle,
elem);
BUG_ON(listmp_handle == NULL);
if (WARN_ON(listmp_handle == NULL)) { if (WARN_ON(listmp_handle == NULL)) {
status = -EINVAL; status = -EINVAL;
goto exit; goto exit;
...@@ -356,7 +319,10 @@ int listmp_put_tail(void *listmp_handle, struct listmp_elem *elem) ...@@ -356,7 +319,10 @@ int listmp_put_tail(void *listmp_handle, struct listmp_elem *elem)
status = handle->put_tail(listmp_handle, elem); status = handle->put_tail(listmp_handle, elem);
exit: exit:
gt_1trace(listmp_debugmask, GT_LEAVE, "listmp_put_tail", status); if (status < 0) {
printk(KERN_ERR "listmp_put_tail failed! status = 0x%x\n",
status);
}
return status; return status;
} }
...@@ -371,12 +337,6 @@ int listmp_insert(void *listmp_handle, struct listmp_elem *elem, ...@@ -371,12 +337,6 @@ int listmp_insert(void *listmp_handle, struct listmp_elem *elem,
int status = 0; int status = 0;
struct listmp_object *handle = NULL; struct listmp_object *handle = NULL;
gt_3trace(listmp_debugmask, GT_ENTER, "listmp_insert",
listmp_handle,
elem,
curElem);
BUG_ON(listmp_handle == NULL);
if (WARN_ON(listmp_handle == NULL)) { if (WARN_ON(listmp_handle == NULL)) {
status = -EINVAL; status = -EINVAL;
goto exit; goto exit;
...@@ -396,7 +356,10 @@ int listmp_insert(void *listmp_handle, struct listmp_elem *elem, ...@@ -396,7 +356,10 @@ int listmp_insert(void *listmp_handle, struct listmp_elem *elem,
status = handle->insert(listmp_handle, elem, curElem); status = handle->insert(listmp_handle, elem, curElem);
exit: exit:
gt_1trace(listmp_debugmask, GT_LEAVE, "listmp_insert", status); if (status < 0) {
printk(KERN_ERR "listmp_insert failed! status = 0x%x\n",
status);
}
return status; return status;
} }
...@@ -410,10 +373,6 @@ int listmp_remove(void *listmp_handle, struct listmp_elem *elem) ...@@ -410,10 +373,6 @@ int listmp_remove(void *listmp_handle, struct listmp_elem *elem)
int status = LISTMP_SUCCESS; int status = LISTMP_SUCCESS;
struct listmp_object *handle = NULL; struct listmp_object *handle = NULL;
gt_2trace(listmp_debugmask, GT_ENTER, "listmp_remove", listmp_handle,
elem);
BUG_ON(listmp_handle == NULL);
if (WARN_ON(listmp_handle == NULL)) { if (WARN_ON(listmp_handle == NULL)) {
status = -EINVAL; status = -EINVAL;
goto exit; goto exit;
...@@ -429,7 +388,10 @@ int listmp_remove(void *listmp_handle, struct listmp_elem *elem) ...@@ -429,7 +388,10 @@ int listmp_remove(void *listmp_handle, struct listmp_elem *elem)
status = handle->remove(listmp_handle, elem); status = handle->remove(listmp_handle, elem);
exit: exit:
gt_1trace(listmp_debugmask, GT_LEAVE, "listmp_remove", status); if (status < 0) {
printk(KERN_ERR "listmp_remove failed! status = 0x%x\n",
status);
}
return status ; return status ;
} }
...@@ -443,9 +405,6 @@ void *listmp_next(void *listmp_handle, struct listmp_elem *elem) ...@@ -443,9 +405,6 @@ void *listmp_next(void *listmp_handle, struct listmp_elem *elem)
struct listmp_object *handle = NULL; struct listmp_object *handle = NULL;
struct listmp_elem *nextElem = NULL; struct listmp_elem *nextElem = NULL;
gt_1trace(listmp_debugmask, GT_ENTER, "listmp_next", listmp_handle);
BUG_ON(listmp_handle == NULL);
if (WARN_ON(listmp_handle == NULL)) if (WARN_ON(listmp_handle == NULL))
goto exit; goto exit;
...@@ -455,7 +414,6 @@ void *listmp_next(void *listmp_handle, struct listmp_elem *elem) ...@@ -455,7 +414,6 @@ void *listmp_next(void *listmp_handle, struct listmp_elem *elem)
nextElem = handle->next(listmp_handle, elem); nextElem = handle->next(listmp_handle, elem);
exit: exit:
gt_1trace(listmp_debugmask, GT_LEAVE, "listmp_next", nextElem);
return nextElem; return nextElem;
} }
...@@ -469,9 +427,6 @@ void *listmp_prev(void *listmp_handle, struct listmp_elem *elem) ...@@ -469,9 +427,6 @@ void *listmp_prev(void *listmp_handle, struct listmp_elem *elem)
struct listmp_object *handle = NULL; struct listmp_object *handle = NULL;
struct listmp_elem *prevElem = NULL; struct listmp_elem *prevElem = NULL;
gt_1trace(listmp_debugmask, GT_ENTER, "listmp_prev", listmp_handle);
BUG_ON(listmp_handle == NULL);
if (WARN_ON(listmp_handle == NULL)) if (WARN_ON(listmp_handle == NULL))
goto exit; goto exit;
...@@ -481,7 +436,5 @@ void *listmp_prev(void *listmp_handle, struct listmp_elem *elem) ...@@ -481,7 +436,5 @@ void *listmp_prev(void *listmp_handle, struct listmp_elem *elem)
prevElem = handle->prev(listmp_handle, elem); prevElem = handle->prev(listmp_handle, elem);
exit: exit:
gt_1trace(listmp_debugmask, GT_LEAVE, "listmp_prev", prevElem);
return prevElem; return prevElem;
} }
...@@ -66,8 +66,8 @@ ...@@ -66,8 +66,8 @@
#include <linux/string.h> #include <linux/string.h>
/* Syslink headers */ /* Syslink headers */
#include <gt.h>
#include <syslink/atomic_linux.h> #include <syslink/atomic_linux.h>
/* Module level headers */ /* Module level headers */
#include <nameserver.h> #include <nameserver.h>
#include <sharedregion.h> #include <sharedregion.h>
...@@ -97,8 +97,6 @@ ...@@ -97,8 +97,6 @@
#define LISTMP_SHAREDMEMORY_CACHESIZE 128 #define LISTMP_SHAREDMEMORY_CACHESIZE 128
#define VOLATILE volatile
/* ============================================================================= /* =============================================================================
* Structures and Enums * Structures and Enums
...@@ -158,11 +156,6 @@ struct listmp_sharedmemory_obj{ ...@@ -158,11 +156,6 @@ struct listmp_sharedmemory_obj{
/*!< Pointer to the top Object */ /*!< Pointer to the top Object */
}; };
#if GT_TRACE
/* GT trace variable */
static struct GT_Mask listmpshm_debugmask = { NULL, NULL };
EXPORT_SYMBOL(listmpshm_debugmask);
#endif
/* ============================================================================= /* =============================================================================
* Function definitions * Function definitions
...@@ -194,10 +187,6 @@ int listmp_sharedmemory_get_config(struct listmp_config *cfgParams) ...@@ -194,10 +187,6 @@ int listmp_sharedmemory_get_config(struct listmp_config *cfgParams)
{ {
int status = 0; int status = 0;
gt_1trace(listmpshm_debugmask, GT_ENTER,
"listmp_sharedmemory_get_config", cfgParams);
BUG_ON(cfgParams == NULL);
if (WARN_ON(cfgParams == NULL)) { if (WARN_ON(cfgParams == NULL)) {
status = -EINVAL; status = -EINVAL;
goto exit; goto exit;
...@@ -212,10 +201,11 @@ int listmp_sharedmemory_get_config(struct listmp_config *cfgParams) ...@@ -212,10 +201,11 @@ int listmp_sharedmemory_get_config(struct listmp_config *cfgParams)
else else
memcpy(cfgParams, &listmp_sharedmemory_state.cfg, memcpy(cfgParams, &listmp_sharedmemory_state.cfg,
sizeof(struct listmp_config)); sizeof(struct listmp_config));
return 0;
exit: exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE, printk(KERN_ERR "listmp_sharedmemory_get_config failed: "
"listmp_sharedmemory_get_config", status); "status = 0x%x\n", status);
return status; return status;
} }
...@@ -232,8 +222,6 @@ int listmp_sharedmemory_setup(struct listmp_config *config) ...@@ -232,8 +222,6 @@ int listmp_sharedmemory_setup(struct listmp_config *config)
struct nameserver_params params; struct nameserver_params params;
struct listmp_config tmp_cfg; struct listmp_config tmp_cfg;
gt_1trace(listmpshm_debugmask, GT_ENTER, "ListMPSharedmemsetup",
config);
/* This sets the refCount variable is not initialized, upper 16 bits is /* This sets the refCount variable is not initialized, upper 16 bits is
* written with module Id to ensure correctness of refCount variable. * written with module Id to ensure correctness of refCount variable.
*/ */
...@@ -277,11 +265,6 @@ int listmp_sharedmemory_setup(struct listmp_config *config) ...@@ -277,11 +265,6 @@ int listmp_sharedmemory_setup(struct listmp_config *config)
listmp_sharedmemory_state.local_gate = \ listmp_sharedmemory_state.local_gate = \
kmalloc(sizeof(struct mutex), GFP_KERNEL); kmalloc(sizeof(struct mutex), GFP_KERNEL);
if (listmp_sharedmemory_state.local_gate == NULL) { if (listmp_sharedmemory_state.local_gate == NULL) {
gt_2trace(listmpshm_debugmask,
GT_4CLASS,
"ListMPSharedmemsetup",
LISTMPSHAREDMEMORY_E_FAIL,
"Failed to create the local_gate!");
status = -ENOMEM; status = -ENOMEM;
goto clean_nameserver; goto clean_nameserver;
} }
...@@ -290,9 +273,11 @@ int listmp_sharedmemory_setup(struct listmp_config *config) ...@@ -290,9 +273,11 @@ int listmp_sharedmemory_setup(struct listmp_config *config)
/* Copy the cfg */ /* Copy the cfg */
memcpy(&listmp_sharedmemory_state.cfg, config, memcpy(&listmp_sharedmemory_state.cfg, config,
sizeof(struct listmp_config)); sizeof(struct listmp_config));
goto exit; return 0;
clean_nameserver: clean_nameserver:
printk(KERN_ERR "listmp_sharedmemory_setup: Failed to create the local "
"gate! status = 0x%x\n", status);
atomic_set(&listmp_sharedmemory_state.ref_count, atomic_set(&listmp_sharedmemory_state.ref_count,
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0)); LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0));
status1 = nameserver_delete status1 = nameserver_delete
...@@ -300,7 +285,7 @@ clean_nameserver: ...@@ -300,7 +285,7 @@ clean_nameserver:
BUG_ON(status1 < 0); BUG_ON(status1 < 0);
exit: exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE, "ListMPSharedmemsetup", printk(KERN_ERR "listmp_sharedmemory_setup failed! status = 0x%x\n",
status); status);
return status; return status;
} }
...@@ -318,8 +303,6 @@ int listmp_sharedmemory_destroy(void) ...@@ -318,8 +303,6 @@ int listmp_sharedmemory_destroy(void)
struct list_head *head = &listmp_sharedmemory_state.obj_list; struct list_head *head = &listmp_sharedmemory_state.obj_list;
struct list_head *next; struct list_head *next;
gt_0trace(listmpshm_debugmask, GT_ENTER, "listmp_sharedmemory_destroy");
if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count), if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0), LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) { LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) {
...@@ -376,37 +359,38 @@ int listmp_sharedmemory_destroy(void) ...@@ -376,37 +359,38 @@ int listmp_sharedmemory_destroy(void)
atomic_set(&listmp_sharedmemory_state.ref_count, atomic_set(&listmp_sharedmemory_state.ref_count,
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0)); LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0));
} }
exit: exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE, "listmp_sharedmemory_destroy", if (status < 0) {
status); printk(KERN_ERR "listmp_sharedmemory_destroy failed! "
"status = 0x%x\n", status);
}
return status; return status;
} }
/*! /*
* @brief Initialize this config-params structure with supplier-specified * ======== listmp_sharedmemory_params_init ========
* defaults before instance creation. * Purpose:
* * Function to initialize the config-params structure with supplier-specified
* @param handle Instance specific handle. * defaults before instance creation.
* @param params Instance creation structure.
*
* @sa listmp_sharedmemory_create
*/ */
void listmp_sharedmemory_params_init(listmp_sharedmemory_handle handle, void listmp_sharedmemory_params_init(listmp_sharedmemory_handle handle,
listmp_sharedmemory_params *params) listmp_sharedmemory_params *params)
{ {
s32 status = 0;
struct listmp_sharedmemory_obj *obj = NULL; struct listmp_sharedmemory_obj *obj = NULL;
gt_2trace(listmpshm_debugmask, GT_ENTER,
"listmp_sharedmemory_params_init", handle, params);
if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count), if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0), LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) {
status = -ENODEV;
goto exit; goto exit;
}
BUG_ON(params == NULL); if (WARN_ON(params == NULL)) {
if (WARN_ON(params == NULL)) status = -EINVAL;
goto exit; goto exit;
}
if (handle == NULL) { if (handle == NULL) {
memcpy(params, memcpy(params,
...@@ -420,10 +404,11 @@ void listmp_sharedmemory_params_init(listmp_sharedmemory_handle handle, ...@@ -420,10 +404,11 @@ void listmp_sharedmemory_params_init(listmp_sharedmemory_handle handle,
(void *)params, (void *)params,
sizeof(listmp_sharedmemory_params)); sizeof(listmp_sharedmemory_params));
} }
return;
exit: exit:
gt_0trace(listmpshm_debugmask, GT_LEAVE, printk(KERN_ERR "listmp_sharedmemory_params_init failed! "
"listmp_sharedmemory_params_init"); "status = 0x%x\n", status);
return; return;
} }
...@@ -438,10 +423,6 @@ listmp_sharedmemory_handle listmp_sharedmemory_create( ...@@ -438,10 +423,6 @@ listmp_sharedmemory_handle listmp_sharedmemory_create(
s32 status = 0; s32 status = 0;
listmp_sharedmemory_object *handle = NULL; listmp_sharedmemory_object *handle = NULL;
gt_1trace(listmpshm_debugmask, GT_ENTER, "listmp_sharedmemory_create",
params);
BUG_ON(params == NULL);
if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count), if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0), LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) { LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) {
...@@ -469,8 +450,10 @@ listmp_sharedmemory_handle listmp_sharedmemory_create( ...@@ -469,8 +450,10 @@ listmp_sharedmemory_handle listmp_sharedmemory_create(
_listmp_sharedmemory_create(params, true); _listmp_sharedmemory_create(params, true);
exit: exit:
gt_2trace(listmpshm_debugmask, GT_LEAVE, "listmp_sharedmemory_create", if (status < 0) {
status, handle); printk(KERN_ERR "listmp_sharedmemory_create failed! "
"status = 0x%x\n", status);
}
return (listmp_sharedmemory_handle) handle; return (listmp_sharedmemory_handle) handle;
} }
...@@ -485,12 +468,8 @@ int listmp_sharedmemory_delete(listmp_sharedmemory_handle *listmp_handleptr) ...@@ -485,12 +468,8 @@ int listmp_sharedmemory_delete(listmp_sharedmemory_handle *listmp_handleptr)
listmp_sharedmemory_object *handle = NULL; listmp_sharedmemory_object *handle = NULL;
struct listmp_sharedmemory_obj *obj = NULL; struct listmp_sharedmemory_obj *obj = NULL;
listmp_sharedmemory_params *params = NULL; listmp_sharedmemory_params *params = NULL;
u32 key; u32 key;
gt_1trace(listmpshm_debugmask, GT_ENTER, "listmp_sharedmemory_delete",
listmp_handleptr);
BUG_ON(listmp_handleptr == NULL);
if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count), if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0), LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) { LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) {
...@@ -557,6 +536,10 @@ int listmp_sharedmemory_delete(listmp_sharedmemory_handle *listmp_handleptr) ...@@ -557,6 +536,10 @@ int listmp_sharedmemory_delete(listmp_sharedmemory_handle *listmp_handleptr)
*listmp_handleptr = NULL; *listmp_handleptr = NULL;
exit: exit:
if (status < 0) {
printk(KERN_ERR "listmp_sharedmemory_delete failed! "
"status = 0x%x\n", status);
}
return status; return status;
} }
...@@ -572,9 +555,6 @@ int listmp_sharedmemory_shared_memreq(listmp_sharedmemory_params *params) ...@@ -572,9 +555,6 @@ int listmp_sharedmemory_shared_memreq(listmp_sharedmemory_params *params)
{ {
int retval = 0; int retval = 0;
gt_1trace(listmpshm_debugmask, GT_ENTER,
"listmp_sharedmemory_sharedMemReq", params);
if (WARN_ON(params == NULL)) { if (WARN_ON(params == NULL)) {
retval = -EINVAL; retval = -EINVAL;
goto exit; goto exit;
...@@ -584,8 +564,10 @@ int listmp_sharedmemory_shared_memreq(listmp_sharedmemory_params *params) ...@@ -584,8 +564,10 @@ int listmp_sharedmemory_shared_memreq(listmp_sharedmemory_params *params)
retval = (LISTMP_SHAREDMEMORY_CACHESIZE * 2); retval = (LISTMP_SHAREDMEMORY_CACHESIZE * 2);
exit: exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE, if (retval < 0) {
"listmp_sharedmemory_sharedMemReq", retVal); printk(KERN_ERR "listmp_sharedmemory_shared_memreq failed! "
"retval = 0x%x\n", retval);
}
/*! @retval ((1 * sizeof(struct listmp_elem)) /*! @retval ((1 * sizeof(struct listmp_elem))
*! + 1 * sizeof(struct listmp_attrs)) if params is null */ *! + 1 * sizeof(struct listmp_attrs)) if params is null */
/*! @retval (2 * cacheSize) if params is provided */ /*! @retval (2 * cacheSize) if params is provided */
...@@ -608,11 +590,6 @@ int listmp_sharedmemory_open(listmp_sharedmemory_handle *listmp_handleptr, ...@@ -608,11 +590,6 @@ int listmp_sharedmemory_open(listmp_sharedmemory_handle *listmp_handleptr,
u32 shared_shm_base; u32 shared_shm_base;
struct listmp_attrs *attrs; struct listmp_attrs *attrs;
gt_1trace(listmpshm_debugmask, GT_ENTER,
"listmp_sharedmemory_open", params);
BUG_ON(listmp_handleptr == NULL);
BUG_ON(params == NULL);
if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count), if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0), LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) { LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) {
...@@ -714,10 +691,12 @@ int listmp_sharedmemory_open(listmp_sharedmemory_handle *listmp_handleptr, ...@@ -714,10 +691,12 @@ int listmp_sharedmemory_open(listmp_sharedmemory_handle *listmp_handleptr,
if (likely(status >= 0)) if (likely(status >= 0))
*listmp_handleptr = (listmp_sharedmemory_handle) *listmp_handleptr = (listmp_sharedmemory_handle)
_listmp_sharedmemory_create(params, false); _listmp_sharedmemory_create(params, false);
exit: exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE, "listmp_sharedmemory_open", if (status < 0) {
status); printk(KERN_ERR "listmp_sharedmemory_open failed! "
/*! @retval LISTMPSHAREDMEMORY_SUCCESS Operation Successful*/ "status = 0x%x\n", status);
}
return status; return status;
} }
...@@ -732,12 +711,8 @@ int listmp_sharedmemory_close(listmp_sharedmemory_handle listmp_handle) ...@@ -732,12 +711,8 @@ int listmp_sharedmemory_close(listmp_sharedmemory_handle listmp_handle)
listmp_sharedmemory_object *handle = NULL; listmp_sharedmemory_object *handle = NULL;
struct listmp_sharedmemory_obj *obj = NULL; struct listmp_sharedmemory_obj *obj = NULL;
listmp_sharedmemory_params *params = NULL; listmp_sharedmemory_params *params = NULL;
u32 key; u32 key;
gt_1trace(listmpshm_debugmask, GT_ENTER, "listmp_sharedmemory_close",
listmp_handle);
BUG_ON(listmp_handle == NULL);
if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count), if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0), LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) { LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) {
...@@ -745,7 +720,7 @@ int listmp_sharedmemory_close(listmp_sharedmemory_handle listmp_handle) ...@@ -745,7 +720,7 @@ int listmp_sharedmemory_close(listmp_sharedmemory_handle listmp_handle)
goto exit; goto exit;
} }
if (listmp_handle == NULL) { if (WARN_ON(listmp_handle == NULL)) {
status = -EINVAL; status = -EINVAL;
goto exit; goto exit;
} }
...@@ -781,8 +756,10 @@ int listmp_sharedmemory_close(listmp_sharedmemory_handle listmp_handle) ...@@ -781,8 +756,10 @@ int listmp_sharedmemory_close(listmp_sharedmemory_handle listmp_handle)
mutex_unlock(listmp_sharedmemory_state.local_gate); mutex_unlock(listmp_sharedmemory_state.local_gate);
exit: exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE, "listmp_sharedmemory_close", if (status < 0) {
status); printk(KERN_ERR "listmp_sharedmemory_close failed! "
"status = 0x%x\n", status);
}
return status; return status;
} }
...@@ -801,9 +778,6 @@ bool listmp_sharedmemory_empty(listmp_sharedmemory_handle listmp_handle) ...@@ -801,9 +778,6 @@ bool listmp_sharedmemory_empty(listmp_sharedmemory_handle listmp_handle)
s32 retval = 0; s32 retval = 0;
struct listmp_elem *sharedHead; struct listmp_elem *sharedHead;
gt_1trace(listmpshm_debugmask, GT_ENTER, "listmp_sharedmemory_empty",
listmp_handle);
if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count), if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0), LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) { LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) {
...@@ -838,8 +812,6 @@ bool listmp_sharedmemory_empty(listmp_sharedmemory_handle listmp_handle) ...@@ -838,8 +812,6 @@ bool listmp_sharedmemory_empty(listmp_sharedmemory_handle listmp_handle)
gatepeterson_leave(obj->params.gate, 0); gatepeterson_leave(obj->params.gate, 0);
exit: exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE, "listmp_sharedmemory_empty",
is_empty);
return is_empty; return is_empty;
} }
...@@ -858,9 +830,6 @@ void *listmp_sharedmemory_get_head(listmp_sharedmemory_handle listmp_handle) ...@@ -858,9 +830,6 @@ void *listmp_sharedmemory_get_head(listmp_sharedmemory_handle listmp_handle)
struct listmp_elem *sharedHead = NULL; struct listmp_elem *sharedHead = NULL;
s32 retval = 0; s32 retval = 0;
gt_1trace(listmpshm_debugmask, GT_ENTER, "listmp_sharedmemory_get_head",
listmp_handle);
if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count), if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0), LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true)
...@@ -906,8 +875,6 @@ void *listmp_sharedmemory_get_head(listmp_sharedmemory_handle listmp_handle) ...@@ -906,8 +875,6 @@ void *listmp_sharedmemory_get_head(listmp_sharedmemory_handle listmp_handle)
gatepeterson_leave(obj->params.gate, 0); gatepeterson_leave(obj->params.gate, 0);
exit: exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE, "listmp_sharedmemory_get_head",
elem);
return elem; return elem;
} }
...@@ -927,9 +894,6 @@ void *listmp_sharedmemory_get_tail(listmp_sharedmemory_handle listmp_handle) ...@@ -927,9 +894,6 @@ void *listmp_sharedmemory_get_tail(listmp_sharedmemory_handle listmp_handle)
struct listmp_elem *sharedHead = NULL; struct listmp_elem *sharedHead = NULL;
s32 retval = 0; s32 retval = 0;
gt_1trace(listmpshm_debugmask, GT_ENTER,
"listmp_sharedmemory_get_tail", listmp_handle);
if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count), if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0), LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true)
...@@ -976,8 +940,6 @@ void *listmp_sharedmemory_get_tail(listmp_sharedmemory_handle listmp_handle) ...@@ -976,8 +940,6 @@ void *listmp_sharedmemory_get_tail(listmp_sharedmemory_handle listmp_handle)
gatepeterson_leave(obj->params.gate, 0); gatepeterson_leave(obj->params.gate, 0);
exit: exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE, "listmp_sharedmemory_get_tail",
elem);
return elem; return elem;
} }
...@@ -998,9 +960,6 @@ int listmp_sharedmemory_put_head(listmp_sharedmemory_handle listmp_handle, ...@@ -998,9 +960,6 @@ int listmp_sharedmemory_put_head(listmp_sharedmemory_handle listmp_handle,
s32 retval = 0; s32 retval = 0;
u32 index; u32 index;
gt_1trace(listmpshm_debugmask, GT_ENTER,
"listmp_sharedmemory_put_head", listmp_handle);
if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count), if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0), LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) { LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) {
...@@ -1040,9 +999,10 @@ int listmp_sharedmemory_put_head(listmp_sharedmemory_handle listmp_handle, ...@@ -1040,9 +999,10 @@ int listmp_sharedmemory_put_head(listmp_sharedmemory_handle listmp_handle,
gatepeterson_leave(obj->params.gate, 0); gatepeterson_leave(obj->params.gate, 0);
exit: exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE, "listmp_sharedmemory_put_head", if (status < 0) {
status); printk(KERN_ERR "listmp_sharedmemory_put_head failed! "
/*! @retval LISTMPSHAREDMEMORY_SUCCESS Operation Successful*/ "status = 0x%x\n", status);
}
return status; return status;
} }
...@@ -1063,9 +1023,6 @@ int listmp_sharedmemory_put_tail(listmp_sharedmemory_handle listmp_handle, ...@@ -1063,9 +1023,6 @@ int listmp_sharedmemory_put_tail(listmp_sharedmemory_handle listmp_handle,
s32 retval = 0; s32 retval = 0;
u32 index; u32 index;
gt_2trace(listmpshm_debugmask, GT_ENTER, "listmp_sharedmemory_put_tail",
listmp_handle, elem);
if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count), if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0), LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) { LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) {
...@@ -1108,8 +1065,10 @@ int listmp_sharedmemory_put_tail(listmp_sharedmemory_handle listmp_handle, ...@@ -1108,8 +1065,10 @@ int listmp_sharedmemory_put_tail(listmp_sharedmemory_handle listmp_handle,
gatepeterson_leave(obj->params.gate, 0); gatepeterson_leave(obj->params.gate, 0);
exit: exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE, "listmp_sharedmemory_put_tail", if (status < 0) {
status); printk(KERN_ERR "listmp_sharedmemory_put_tail failed! "
"status = 0x%x\n", status);
}
return status; return status;
} }
...@@ -1131,10 +1090,6 @@ int listmp_sharedmemory_insert(listmp_sharedmemory_handle listmp_handle, ...@@ -1131,10 +1090,6 @@ int listmp_sharedmemory_insert(listmp_sharedmemory_handle listmp_handle,
s32 retval = 0; s32 retval = 0;
u32 index; u32 index;
gt_3trace(listmpshm_debugmask, GT_ENTER, "listmp_sharedmemory_insert",
listmp_handle, new_elem, cur_elem);
if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count), if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0), LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) { LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) {
...@@ -1184,8 +1139,10 @@ int listmp_sharedmemory_insert(listmp_sharedmemory_handle listmp_handle, ...@@ -1184,8 +1139,10 @@ int listmp_sharedmemory_insert(listmp_sharedmemory_handle listmp_handle,
gatepeterson_leave(obj->params.gate, 0); gatepeterson_leave(obj->params.gate, 0);
exit: exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE, "listmp_sharedmemory_insert", if (status < 0) {
status); printk(KERN_ERR "listmp_sharedmemory_insert failed! "
"status = 0x%x\n", status);
}
return status; return status;
} }
...@@ -1204,10 +1161,6 @@ int listmp_sharedmemory_remove(listmp_sharedmemory_handle listmp_handle, ...@@ -1204,10 +1161,6 @@ int listmp_sharedmemory_remove(listmp_sharedmemory_handle listmp_handle,
struct listmp_elem *localNextElem = NULL; struct listmp_elem *localNextElem = NULL;
s32 retval = 0; s32 retval = 0;
gt_2trace(listmpshm_debugmask, GT_ENTER, "listmp_sharedmemory_remove",
listmp_handle,
elem);
if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count), if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0), LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) { LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) {
...@@ -1241,8 +1194,10 @@ int listmp_sharedmemory_remove(listmp_sharedmemory_handle listmp_handle, ...@@ -1241,8 +1194,10 @@ int listmp_sharedmemory_remove(listmp_sharedmemory_handle listmp_handle,
gatepeterson_leave(obj->params.gate, 0); gatepeterson_leave(obj->params.gate, 0);
exit: exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE, "listmp_sharedmemory_remove", if (status < 0) {
status); printk(KERN_ERR "listmp_sharedmemory_remove failed! "
"status = 0x%x\n", status);
}
return status; return status;
} }
...@@ -1260,11 +1215,6 @@ void *listmp_sharedmemory_next(listmp_sharedmemory_handle listmp_handle, ...@@ -1260,11 +1215,6 @@ void *listmp_sharedmemory_next(listmp_sharedmemory_handle listmp_handle,
struct listmp_elem *sharedNextElem = NULL; struct listmp_elem *sharedNextElem = NULL;
s32 retval = 0; s32 retval = 0;
gt_2trace(listmpshm_debugmask, GT_ENTER, "listmp_sharedmemory_next",
listmp_handle,
elem);
if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count), if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0), LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true)
...@@ -1294,8 +1244,6 @@ void *listmp_sharedmemory_next(listmp_sharedmemory_handle listmp_handle, ...@@ -1294,8 +1244,6 @@ void *listmp_sharedmemory_next(listmp_sharedmemory_handle listmp_handle,
gatepeterson_leave(obj->params.gate, 0); gatepeterson_leave(obj->params.gate, 0);
exit: exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE, "listmp_sharedmemory_next",
retElem);
return retElem; return retElem;
} }
...@@ -1308,15 +1256,11 @@ void *listmp_sharedmemory_prev(listmp_sharedmemory_handle listmp_handle, ...@@ -1308,15 +1256,11 @@ void *listmp_sharedmemory_prev(listmp_sharedmemory_handle listmp_handle,
struct listmp_elem *elem) struct listmp_elem *elem)
{ {
listmp_sharedmemory_object *handle = NULL; listmp_sharedmemory_object *handle = NULL;
struct listmp_sharedmemory_obj *obj = NULL; struct listmp_sharedmemory_obj *obj = NULL;
struct listmp_elem *retElem = NULL; struct listmp_elem *retElem = NULL;
struct listmp_elem *sharedPrevElem = NULL; struct listmp_elem *sharedPrevElem = NULL;
s32 retval = 0; s32 retval = 0;
gt_2trace(listmpshm_debugmask, GT_ENTER, "listmp_sharedmemory_prev",
listmp_handle,
elem);
if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count), if (atomic_cmpmask_and_lt(&(listmp_sharedmemory_state.ref_count),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0), LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(0),
LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true) LISTMPSHAREDMEMORY_MAKE_MAGICSTAMP(1)) == true)
...@@ -1348,8 +1292,6 @@ void *listmp_sharedmemory_prev(listmp_sharedmemory_handle listmp_handle, ...@@ -1348,8 +1292,6 @@ void *listmp_sharedmemory_prev(listmp_sharedmemory_handle listmp_handle,
gatepeterson_leave(obj->params.gate, 0); gatepeterson_leave(obj->params.gate, 0);
exit: exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE, "listmp_sharedmemory_prev",
retElem);
return retElem; return retElem;
} }
...@@ -1370,9 +1312,6 @@ listmp_sharedmemory_handle _listmp_sharedmemory_create( ...@@ -1370,9 +1312,6 @@ listmp_sharedmemory_handle _listmp_sharedmemory_create(
u32 shmIndex; u32 shmIndex;
u32 *sharedShmBase; u32 *sharedShmBase;
gt_1trace(listmpshm_debugmask, GT_ENTER, "_listmp_sharedmemory_create",
params);
BUG_ON(params == NULL); BUG_ON(params == NULL);
/* Allow local lock not being provided. Don't do protection if local /* Allow local lock not being provided. Don't do protection if local
...@@ -1448,15 +1387,10 @@ listmp_sharedmemory_handle _listmp_sharedmemory_create( ...@@ -1448,15 +1387,10 @@ listmp_sharedmemory_handle _listmp_sharedmemory_create(
obj->owner = kmalloc(sizeof(struct listmp_proc_attrs), obj->owner = kmalloc(sizeof(struct listmp_proc_attrs),
GFP_KERNEL); GFP_KERNEL);
if (obj->owner == NULL) { if (obj->owner == NULL) {
gt_2trace(listmpshm_debugmask, printk(KERN_ERR "_listmp_sharedmemory_create: Memory "
GT_4CLASS, "allocation failed for processor information!\n");
"_listmp_sharedmemory_create",
status,
"Memory allocation failed"
"for processor information!");
status = -ENOMEM; status = -ENOMEM;
} else { } else {
/* Update owner and opener details */ /* Update owner and opener details */
if (create_flag == true) { if (create_flag == true) {
obj->owner->creator = true; obj->owner->creator = true;
...@@ -1531,7 +1465,9 @@ listmp_sharedmemory_handle _listmp_sharedmemory_create( ...@@ -1531,7 +1465,9 @@ listmp_sharedmemory_handle _listmp_sharedmemory_create(
} }
exit: exit:
gt_1trace(listmpshm_debugmask, GT_LEAVE, "_listmp_sharedmemory_create", if (status < 0) {
handle); printk(KERN_ERR "_listmp_sharedmemory_create failed! "
"status = 0x%x\n", status);
}
return (listmp_sharedmemory_handle) handle; return (listmp_sharedmemory_handle) handle;
} }
...@@ -23,8 +23,6 @@ ...@@ -23,8 +23,6 @@
#include <linux/bug.h> #include <linux/bug.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/mm.h> #include <linux/mm.h>
/* Syslink headers */
#include <gt.h>
/* Module Headers */ /* Module Headers */
#include <listmp.h> #include <listmp.h>
...@@ -573,10 +571,6 @@ int listmp_sharedmemory_ioctl(struct inode *inode, struct file *filp, ...@@ -573,10 +571,6 @@ int listmp_sharedmemory_ioctl(struct inode *inode, struct file *filp,
struct listmp_sharedmemory_cmd_args cargs; struct listmp_sharedmemory_cmd_args cargs;
unsigned long size; unsigned long size;
gt_4trace(curTrace, GT_ENTER, "listmp_sharedmemory_ioctl"
"inode: %x, filp: %x,\n cmd: %x, args: %x",
inode, filp, cmd, args);
if (_IOC_DIR(cmd) & _IOC_READ) if (_IOC_DIR(cmd) & _IOC_READ)
os_status = !access_ok(VERIFY_WRITE, uarg, _IOC_SIZE(cmd)); os_status = !access_ok(VERIFY_WRITE, uarg, _IOC_SIZE(cmd));
else if (_IOC_DIR(cmd) & _IOC_WRITE) else if (_IOC_DIR(cmd) & _IOC_WRITE)
...@@ -682,8 +676,10 @@ int listmp_sharedmemory_ioctl(struct inode *inode, struct file *filp, ...@@ -682,8 +676,10 @@ int listmp_sharedmemory_ioctl(struct inode *inode, struct file *filp,
os_status = -EFAULT; os_status = -EFAULT;
goto exit; goto exit;
} }
return os_status;
exit: exit:
gt_1trace(curTrace, GT_LEAVE, "listmp_sharedmemory_ioctl", os_status); printk(KERN_ERR "listmp_sharedmemory_ioctl failed: status = 0x%x\n",
os_status);
return os_status; return os_status;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment