Commit 62ffe3e8 authored by Hari Kanigeri's avatar Hari Kanigeri

SYSLINK:proc-fixes to proc module

This patch handles the following
	- Adds checks for null pointers in proc attach
	- fixes the proc4430_proc_info to return correct
	  mem entries
	- fixes compile warnings in previous patch
Signed-off-by: default avatarHari Kanigeri <h-kanigeri2@ti.com>
parent dcbeac24
...@@ -247,9 +247,13 @@ void *proc4430_create(u16 proc_id, const struct proc4430_params *params) ...@@ -247,9 +247,13 @@ void *proc4430_create(u16 proc_id, const struct proc4430_params *params)
(sizeof(struct proc4430_object)); (sizeof(struct proc4430_object));
handle->proc_id = proc_id; handle->proc_id = proc_id;
object = (struct proc4430_object *)handle->object; object = (struct proc4430_object *)handle->object;
if (params != NULL) {
/* Copy params into instance object. */ /* Copy params into instance object. */
memcpy(&(object->params), (void *)params, memcpy(&(object->params), (void *)params,
sizeof(struct proc4430_params)); sizeof(struct proc4430_params));
}
if ((params != NULL) && (params->mem_entries != NULL)
&& (params->num_mem_entries > 0)) {
/* Allocate memory for, and copy mem_entries table*/ /* Allocate memory for, and copy mem_entries table*/
object->params.mem_entries = vmalloc(sizeof(struct object->params.mem_entries = vmalloc(sizeof(struct
proc4430_mem_entry) * proc4430_mem_entry) *
...@@ -258,6 +262,7 @@ void *proc4430_create(u16 proc_id, const struct proc4430_params *params) ...@@ -258,6 +262,7 @@ void *proc4430_create(u16 proc_id, const struct proc4430_params *params)
params->mem_entries, params->mem_entries,
(sizeof(struct proc4430_mem_entry) * (sizeof(struct proc4430_mem_entry) *
params->num_mem_entries)); params->num_mem_entries));
}
handle->boot_mode = PROC_MGR_BOOTMODE_NOLOAD; handle->boot_mode = PROC_MGR_BOOTMODE_NOLOAD;
/* Set the handle in the state object. */ /* Set the handle in the state object. */
proc4430_state.proc_handles[proc_id] = handle; proc4430_state.proc_handles[proc_id] = handle;
...@@ -643,10 +648,7 @@ int proc4430_proc_info(void *handle, struct proc_mgr_proc_info *procinfo) ...@@ -643,10 +648,7 @@ int proc4430_proc_info(void *handle, struct proc_mgr_proc_info *procinfo)
for (i = 0 ; i < object->params.num_mem_entries ; i++) { for (i = 0 ; i < object->params.num_mem_entries ; i++) {
entry = &(object->params.mem_entries[i]); entry = &(object->params.mem_entries[i]);
procinfo->mem_entries[i].is_init = true;
procinfo->mem_entries[i].addr[PROC_MGR_ADDRTYPE_MASTERKNLVIRT] procinfo->mem_entries[i].addr[PROC_MGR_ADDRTYPE_MASTERKNLVIRT]
= entry->phys_addr;
procinfo->mem_entries[i].addr[PROC_MGR_ADDRTYPE_MASTERUSRVIRT]
= entry->master_virt_addr; = entry->master_virt_addr;
procinfo->mem_entries[i].addr[PROC_MGR_ADDRTYPE_SLAVEVIRT] procinfo->mem_entries[i].addr[PROC_MGR_ADDRTYPE_SLAVEVIRT]
= entry->slave_virt_addr; = entry->slave_virt_addr;
......
...@@ -735,8 +735,6 @@ EXPORT_SYMBOL(proc_mgr_register_notify); ...@@ -735,8 +735,6 @@ EXPORT_SYMBOL(proc_mgr_register_notify);
*/ */
int proc_mgr_get_proc_info(void *handle, struct proc_mgr_proc_info *proc_info) int proc_mgr_get_proc_info(void *handle, struct proc_mgr_proc_info *proc_info)
{ {
int i;
int count = 0;
struct proc_mgr_object *proc_mgr_handle = struct proc_mgr_object *proc_mgr_handle =
(struct proc_mgr_object *)handle; (struct proc_mgr_object *)handle;
struct processor_object *proc_handle; struct processor_object *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