Commit 628aebf9 authored by Hari Kanigeri's avatar Hari Kanigeri

SYSLINK:ipc-de-couple sysmanager from Proc module

This patch de-couples SysManager calls from Proc module.
Added new SysManger calls that get invoked from user
space.
Signed-off-by: default avatarHari Kanigeri <h-kanigeri2@ti.com>
parent 22c5f8f7
...@@ -37,7 +37,7 @@ enum ipc_command_count { ...@@ -37,7 +37,7 @@ enum ipc_command_count {
MESSAGEQ_CMD_NOS = 17, MESSAGEQ_CMD_NOS = 17,
MESSAGEQ_TRANSPORTSHM_CMD_NOS = 9, MESSAGEQ_TRANSPORTSHM_CMD_NOS = 9,
NAMESERVERREMOTENOTIFY_CMD_NOS = 8, NAMESERVERREMOTENOTIFY_CMD_NOS = 8,
SYSMGR_CMD_NOS = 2, SYSMGR_CMD_NOS = 5,
SYSMEMMGR_CMD_NOS = 6 SYSMEMMGR_CMD_NOS = 6
}; };
......
...@@ -40,7 +40,10 @@ ...@@ -40,7 +40,10 @@
/* IOCTL command numbers for sysmgr */ /* IOCTL command numbers for sysmgr */
enum sysmgr_drv_cmd { enum sysmgr_drv_cmd {
SYSMGR_SETUP = SYSMGR_BASE_CMD, SYSMGR_SETUP = SYSMGR_BASE_CMD,
SYSMGR_DESTROY SYSMGR_DESTROY,
SYSMGR_LOADCALLBACK,
SYSMGR_STARTCALLBACK,
SYSMGR_STOPCALLBACK
}; };
/* Command for sysmgr_setup */ /* Command for sysmgr_setup */
...@@ -53,6 +56,21 @@ enum sysmgr_drv_cmd { ...@@ -53,6 +56,21 @@ enum sysmgr_drv_cmd {
_IOWR(SYSMGR_IOC_MAGIC, SYSMGR_DESTROY, \ _IOWR(SYSMGR_IOC_MAGIC, SYSMGR_DESTROY, \
struct sysmgr_cmd_args) struct sysmgr_cmd_args)
/* Command for load callback */
#define CMD_SYSMGR_LOADCALLBACK \
_IOWR(SYSMGR_IOC_MAGIC, SYSMGR_LOADCALLBACK, \
struct sysmgr_cmd_args)
/* Command for load callback */
#define CMD_SYSMGR_STARTCALLBACK \
_IOWR(SYSMGR_IOC_MAGIC, SYSMGR_STARTCALLBACK, \
struct sysmgr_cmd_args)
/* Command for stop callback */
#define CMD_SYSMGR_STOPCALLBACK \
_IOWR(SYSMGR_IOC_MAGIC, SYSMGR_STOPCALLBACK, \
struct sysmgr_cmd_args)
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
* Command arguments for sysmgr * Command arguments for sysmgr
...@@ -64,6 +82,8 @@ struct sysmgr_cmd_args { ...@@ -64,6 +82,8 @@ struct sysmgr_cmd_args {
struct { struct {
struct sysmgr_config *config; struct sysmgr_config *config;
} setup; } setup;
int proc_id;
} args; } args;
s32 api_status; s32 api_status;
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
/* Module Headers */ /* Module Headers */
#include <sysmgr.h> #include <sysmgr.h>
#include <sysmgr_ioctl.h> #include <sysmgr_ioctl.h>
#include <platform.h>
/* /*
* ======== sysmgr_ioctl_setup ======== * ======== sysmgr_ioctl_setup ========
* Purpose: * Purpose:
...@@ -103,6 +103,25 @@ int sysmgr_ioctl(struct inode *inode, struct file *filp, ...@@ -103,6 +103,25 @@ int sysmgr_ioctl(struct inode *inode, struct file *filp,
os_status = sysmgr_ioctl_destroy(&cargs); os_status = sysmgr_ioctl_destroy(&cargs);
break; break;
case CMD_SYSMGR_LOADCALLBACK:
#if defined CONFIG_SYSLINK_USE_SYSMGR
platform_load_callback((void *)(cargs.args.proc_id));
cargs.api_status = 0;
#endif
break;
case CMD_SYSMGR_STARTCALLBACK:
#if defined CONFIG_SYSLINK_USE_SYSMGR
platform_start_callback((void *)(cargs.args.proc_id));
cargs.api_status = 0;
#endif
break;
case CMD_SYSMGR_STOPCALLBACK:
#if defined CONFIG_SYSLINK_USE_SYSMGR
platform_stop_callback((void *)(cargs.args.proc_id));
#endif
break;
default: default:
WARN_ON(cmd); WARN_ON(cmd);
os_status = -ENOTTY; os_status = -ENOTTY;
......
...@@ -25,11 +25,6 @@ ...@@ -25,11 +25,6 @@
#include "procdefs.h" #include "procdefs.h"
#include "processor.h" #include "processor.h"
#include <syslink/atomic_linux.h> #include <syslink/atomic_linux.h>
#if defined CONFIG_SYSLINK_USE_SYSMGR
#include <sysmgr.h>
#include <platform.h>
#endif /* if defined (CONFIG_SYSLINK_USE_SYSMGR) */
/* ================================ /* ================================
* Macros and types * Macros and types
...@@ -583,9 +578,6 @@ int proc_mgr_start(void *handle, u32 entry_point, ...@@ -583,9 +578,6 @@ int proc_mgr_start(void *handle, u32 entry_point,
proc_mgr_get_start_params(handle, &tmp_params); proc_mgr_get_start_params(handle, &tmp_params);
params = &tmp_params; params = &tmp_params;
} }
#if defined CONFIG_SYSLINK_USE_SYSMGR
platform_load_callback((void *)params->proc_id); /* FIXME */
#endif
WARN_ON(mutex_lock_interruptible(proc_mgr_obj_state.gate_handle)); WARN_ON(mutex_lock_interruptible(proc_mgr_obj_state.gate_handle));
memcpy(&(proc_mgr_handle->start_params), params, memcpy(&(proc_mgr_handle->start_params), params,
sizeof(struct proc_mgr_start_params)); sizeof(struct proc_mgr_start_params));
...@@ -595,13 +587,6 @@ int proc_mgr_start(void *handle, u32 entry_point, ...@@ -595,13 +587,6 @@ int proc_mgr_start(void *handle, u32 entry_point,
entry_point, &proc_params); entry_point, &proc_params);
mutex_unlock(proc_mgr_obj_state.gate_handle); mutex_unlock(proc_mgr_obj_state.gate_handle);
#if defined CONFIG_SYSLINK_USE_SYSMGR
if (retval == 0) {
/* TBD: should be removed when notify local is implemepented */
platform_start_callback((void *)params->proc_id);
}
#endif /* defined (CONFIG_SYSLINK_USE_SYSMGR)*/
return retval;; return retval;;
} }
EXPORT_SYMBOL(proc_mgr_start); EXPORT_SYMBOL(proc_mgr_start);
...@@ -629,11 +614,6 @@ int proc_mgr_stop(void *handle, struct proc_mgr_stop_params *params) ...@@ -629,11 +614,6 @@ int proc_mgr_stop(void *handle, struct proc_mgr_stop_params *params)
return -EFAULT; return -EFAULT;
} }
BUG_ON(handle == NULL); BUG_ON(handle == NULL);
#if defined CONFIG_SYSLINK_USE_SYSMGR
/* TBD: should be removed when notify local is implemepented */
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)); WARN_ON(mutex_lock_interruptible(proc_mgr_obj_state.gate_handle));
proc_params.params = params; proc_params.params = params;
retval = processor_stop(proc_mgr_handle->proc_handle, retval = processor_stop(proc_mgr_handle->proc_handle,
......
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