Commit 82f79753 authored by Suman Anna's avatar Suman Anna Committed by Hari Kanigeri

syslink: messageq and multiproc synched to IPC-b33

Updated messageq and multiproc modules to be in sync with ipc-b33 tree.
No changes are required for messageq_transportshm, listmp, listmp_sharedmemory
modules also.

multiproc - changed the return type for multiproc_set_local_id
messageq - enhanced the functionality of messageq_put to deal with urgent messages
Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
parent 30fedfdf
......@@ -21,9 +21,7 @@
#include <linux/types.h>
/*
* Macro to define invalid processor id
*/
/* Macro to define invalid processor id */
#define MULTIPROC_INVALIDID ((u16)0xFFFF)
/*
......@@ -32,10 +30,20 @@
*/
#define MULTIPROC_MAXPROCESSORS 4
bool multiproc_set_local_id(u16 proc_id);
/* =============================================================================
* APIs
* =============================================================================
*/
/* Function to set Local processor Id */
int multiproc_set_local_id(u16 proc_id);
/* Function to get processor id from processor name. */
u16 multiproc_get_id(const char *proc_name);
/* Function to get name from processor id. */
char *multiproc_get_name(u16 proc_id);
/* Function to get maximum proc Id in the system. */
u16 multiproc_get_max_processors(void);
#endif /* _MULTIPROC_H_ */
......@@ -311,16 +311,6 @@ int messageq_setup(const struct messageq_config *cfg)
if (cfg->name_table_gate != NULL) {
messageq_state.gate_handle = cfg->name_table_gate;
if (messageq_state.gate_handle == NULL) {
/*! @retval MESSAGEQ_E_FAIL Failed to create lock! */
status = MESSAGEQ_E_FAIL;
gt_2trace(messageq_dbgmask,
GT_4CLASS,
"MessageQ_setup",
status,
"Failed to create GateSpinlock!");
goto exit;
}
} else {
/* User has not provided any gate handle, so create a default
* handle for protecting list object */
......@@ -346,8 +336,6 @@ int messageq_setup(const struct messageq_config *cfg)
params.max_name_len = cfg->max_name_len;
/* Create the nameserver for modules */
/*messageq_state.ns_handle = nameserver_create(MESSAGEQ_NAMESERVER,
&params);*/
messageq_state.ns_handle = nameserver_create(MESSAGEQ_NAMESERVER,
&params);
if (messageq_state.ns_handle == NULL) {
......@@ -1103,12 +1091,17 @@ int messageq_put(u32 queue_id, messageq_msg msg)
(messageq_state.queues[(u16)(queue_id)]);
key = mutex_lock_interruptible(messageq_state.gate_handle);
if ((msg->flags & MESSAGEQ_PRIORITYMASK) == \
MESSAGEQ_NORMALPRI) {
list_add_tail((struct list_head *) msg,
&obj->normal_list);
MESSAGEQ_URGENTPRI) {
list_add((struct list_head *) msg, &obj->high_list);
} else {
list_add_tail((struct list_head *) msg,
&obj->high_list);
if ((msg->flags & MESSAGEQ_PRIORITYMASK) == \
MESSAGEQ_NORMALPRI) {
list_add_tail((struct list_head *) msg,
&obj->normal_list);
} else {
list_add_tail((struct list_head *) msg,
&obj->high_list);
}
}
mutex_unlock(messageq_state.gate_handle);
......
......@@ -25,6 +25,7 @@
#include <linux/types.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <multiproc.h>
......@@ -57,14 +58,15 @@ static char *multiproc_namelist[] = { modena, tesla, sysm3, appm3 };
* Purpose:
* This will set the processor id of local processor on run time
*/
bool multiproc_set_local_id(u16 proc_id)
int multiproc_set_local_id(u16 proc_id)
{
bool status = true;
int status = 0;
if (proc_id >= MULTIPROC_MAXPROCESSORS)
status = false;
status = -EINVAL;
else
module->local_id = proc_id;
return 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