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