Commit 5fdac94e authored by Ramesh Gupta's avatar Ramesh Gupta Committed by Hari Kanigeri

SYSLINK Procmgr add proc id param for Proc stop.

This patch adds stop param to hold proc_id.
Signed-off-by: default avatarRamesh Gupta G <grgupta@ti.com>
parent e575ea16
......@@ -138,6 +138,13 @@ struct proc_mgr_start_params {
u32 proc_id;
};
/*
* Configuration parameters to be provided while stopping the slave
* processor.
*/
struct proc_mgr_stop_params {
u32 proc_id;
};
/*
* This structure defines information about memory regions mapped by
......@@ -224,7 +231,7 @@ int proc_mgr_start(void *handle, u32 entry_point,
struct proc_mgr_start_params *params);
/* Function to stop execution of the slave Processor. */
int proc_mgr_stop(void *handle);
int proc_mgr_stop(void *handle, struct proc_mgr_stop_params *params);
/* Function to get the current state of the slave Processor as maintained on
* the master Processor state machine.
......
......@@ -62,6 +62,13 @@ struct processor_start_params {
/* Common start parameters for ProcMgr */
};
/*
*Configuration parameters for stopping the slave Processor
*/
struct processor_stop_params {
struct proc_mgr_stop_params *params;
/* Common start parameters for ProcMgr */
};
/*
* Function pointer type for the function to attach to the processor.
*/
......
......@@ -55,6 +55,8 @@ struct proc_mgr_module_object {
/* Default parameters for the ProcMgr attach function */
struct proc_mgr_start_params def_start_params;
/* Default parameters for the ProcMgr start function */
struct proc_mgr_stop_params def_stop_params;
/* Default parameters for the ProcMgr stop function */
struct mutex *gate_handle;
/* handle of gate to be used for local thread safety */
void *proc_handles[MULTIPROC_MAXPROCESSORS];
......@@ -80,6 +82,8 @@ struct proc_mgr_object {
/* ProcMgr attach params structure */
struct proc_mgr_start_params start_params;
/* ProcMgr start params structure */
struct proc_mgr_stop_params stop_params;
/* ProcMgr start params structure */
u32 file_id;
/*!< File ID of the loaded static executable */
u16 num_mem_entries;
......@@ -611,7 +615,7 @@ EXPORT_SYMBOL(proc_mgr_start);
* state.
*
*/
int proc_mgr_stop(void *handle)
int proc_mgr_stop(void *handle, struct proc_mgr_stop_params *params)
{
int retval = 0;
struct proc_mgr_object *proc_mgr_handle =
......@@ -626,7 +630,7 @@ int proc_mgr_stop(void *handle)
BUG_ON(handle == NULL);
#if defined CONFIG_SYSLINK_USE_SYSMGR
/* TBD: should be removed when notify local is implemepented */
platform_stop_callback(proc_mgr_handle->proc_id);
platform_stop_callback((void *)params->proc_id);
#endif /* #if defined (CONFIG_SYSLINK_USE_SYSMGR) */
WARN_ON(mutex_lock_interruptible(proc_mgr_obj_state.gate_handle));
......
......@@ -378,14 +378,19 @@ static int proc_mgr_drv_ioctl(struct inode *inode, struct file *filp,
{
struct proc_mgr_cmd_args_stop src_args;
struct proc_mgr_stop_params params;
/* Copy the full args from user-side. */
retval = copy_from_user((void *)&src_args,
(const void *)(args),
sizeof(struct proc_mgr_cmd_args_stop));
/* Copy params from user-side. */
retval = copy_from_user((void *)&params,
(const void *)(src_args.params),
sizeof(struct proc_mgr_stop_params));
if (WARN_ON(retval != 0))
goto func_exit;
retval = proc_mgr_stop(src_args.handle);
retval = proc_mgr_stop(src_args.handle, &params);
WARN_ON(retval < 0);
}
break;
......
......@@ -352,6 +352,8 @@ struct proc_mgr_cmd_args_stop {
/*Common command args */
void *handle;
/*Handle to the ProcMgr object */
struct proc_mgr_stop_params *params;
/*Optional ProcMgr stop parameters. */
};
/*
......
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