diff options
Diffstat (limited to 'drivers/staging/tidspbridge/rmgr/proc.c')
-rw-r--r-- | drivers/staging/tidspbridge/rmgr/proc.c | 170 |
1 files changed, 84 insertions, 86 deletions
diff --git a/drivers/staging/tidspbridge/rmgr/proc.c b/drivers/staging/tidspbridge/rmgr/proc.c index b47d7aa747b..54f61336d77 100644 --- a/drivers/staging/tidspbridge/rmgr/proc.c +++ b/drivers/staging/tidspbridge/rmgr/proc.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <dspbridge/dbc.h> | 29 | #include <dspbridge/dbc.h> |
30 | 30 | ||
31 | /* ----------------------------------- OS Adaptation Layer */ | 31 | /* ----------------------------------- OS Adaptation Layer */ |
32 | #include <dspbridge/list.h> | ||
33 | #include <dspbridge/ntfy.h> | 32 | #include <dspbridge/ntfy.h> |
34 | #include <dspbridge/sync.h> | 33 | #include <dspbridge/sync.h> |
35 | /* ----------------------------------- Bridge Driver */ | 34 | /* ----------------------------------- Bridge Driver */ |
@@ -81,24 +80,24 @@ extern struct device *bridge; | |||
81 | /* The proc_object structure. */ | 80 | /* The proc_object structure. */ |
82 | struct proc_object { | 81 | struct proc_object { |
83 | struct list_head link; /* Link to next proc_object */ | 82 | struct list_head link; /* Link to next proc_object */ |
84 | struct dev_object *hdev_obj; /* Device this PROC represents */ | 83 | struct dev_object *dev_obj; /* Device this PROC represents */ |
85 | u32 process; /* Process owning this Processor */ | 84 | u32 process; /* Process owning this Processor */ |
86 | struct mgr_object *hmgr_obj; /* Manager Object Handle */ | 85 | struct mgr_object *mgr_obj; /* Manager Object Handle */ |
87 | u32 attach_count; /* Processor attach count */ | 86 | u32 attach_count; /* Processor attach count */ |
88 | u32 processor_id; /* Processor number */ | 87 | u32 processor_id; /* Processor number */ |
89 | u32 utimeout; /* Time out count */ | 88 | u32 timeout; /* Time out count */ |
90 | enum dsp_procstate proc_state; /* Processor state */ | 89 | enum dsp_procstate proc_state; /* Processor state */ |
91 | u32 ul_unit; /* DDSP unit number */ | 90 | u32 unit; /* DDSP unit number */ |
92 | bool is_already_attached; /* | 91 | bool is_already_attached; /* |
93 | * True if the Device below has | 92 | * True if the Device below has |
94 | * GPP Client attached | 93 | * GPP Client attached |
95 | */ | 94 | */ |
96 | struct ntfy_object *ntfy_obj; /* Manages notifications */ | 95 | struct ntfy_object *ntfy_obj; /* Manages notifications */ |
97 | /* Bridge Context Handle */ | 96 | /* Bridge Context Handle */ |
98 | struct bridge_dev_context *hbridge_context; | 97 | struct bridge_dev_context *bridge_context; |
99 | /* Function interface to Bridge driver */ | 98 | /* Function interface to Bridge driver */ |
100 | struct bridge_drv_interface *intf_fxns; | 99 | struct bridge_drv_interface *intf_fxns; |
101 | char *psz_last_coff; | 100 | char *last_coff; |
102 | struct list_head proc_list; | 101 | struct list_head proc_list; |
103 | }; | 102 | }; |
104 | 103 | ||
@@ -285,8 +284,8 @@ proc_attach(u32 processor_id, | |||
285 | DBC_REQUIRE(refs > 0); | 284 | DBC_REQUIRE(refs > 0); |
286 | DBC_REQUIRE(ph_processor != NULL); | 285 | DBC_REQUIRE(ph_processor != NULL); |
287 | 286 | ||
288 | if (pr_ctxt->hprocessor) { | 287 | if (pr_ctxt->processor) { |
289 | *ph_processor = pr_ctxt->hprocessor; | 288 | *ph_processor = pr_ctxt->processor; |
290 | return status; | 289 | return status; |
291 | } | 290 | } |
292 | 291 | ||
@@ -316,8 +315,8 @@ proc_attach(u32 processor_id, | |||
316 | status = -ENOMEM; | 315 | status = -ENOMEM; |
317 | goto func_end; | 316 | goto func_end; |
318 | } | 317 | } |
319 | p_proc_object->hdev_obj = hdev_obj; | 318 | p_proc_object->dev_obj = hdev_obj; |
320 | p_proc_object->hmgr_obj = hmgr_obj; | 319 | p_proc_object->mgr_obj = hmgr_obj; |
321 | p_proc_object->processor_id = dev_type; | 320 | p_proc_object->processor_id = dev_type; |
322 | /* Store TGID instead of process handle */ | 321 | /* Store TGID instead of process handle */ |
323 | p_proc_object->process = current->tgid; | 322 | p_proc_object->process = current->tgid; |
@@ -325,14 +324,14 @@ proc_attach(u32 processor_id, | |||
325 | INIT_LIST_HEAD(&p_proc_object->proc_list); | 324 | INIT_LIST_HEAD(&p_proc_object->proc_list); |
326 | 325 | ||
327 | if (attr_in) | 326 | if (attr_in) |
328 | p_proc_object->utimeout = attr_in->utimeout; | 327 | p_proc_object->timeout = attr_in->timeout; |
329 | else | 328 | else |
330 | p_proc_object->utimeout = PROC_DFLT_TIMEOUT; | 329 | p_proc_object->timeout = PROC_DFLT_TIMEOUT; |
331 | 330 | ||
332 | status = dev_get_intf_fxns(hdev_obj, &p_proc_object->intf_fxns); | 331 | status = dev_get_intf_fxns(hdev_obj, &p_proc_object->intf_fxns); |
333 | if (!status) { | 332 | if (!status) { |
334 | status = dev_get_bridge_context(hdev_obj, | 333 | status = dev_get_bridge_context(hdev_obj, |
335 | &p_proc_object->hbridge_context); | 334 | &p_proc_object->bridge_context); |
336 | if (status) | 335 | if (status) |
337 | kfree(p_proc_object); | 336 | kfree(p_proc_object); |
338 | } else | 337 | } else |
@@ -357,8 +356,7 @@ proc_attach(u32 processor_id, | |||
357 | * Return handle to this Processor Object: | 356 | * Return handle to this Processor Object: |
358 | * Find out if the Device is already attached to a | 357 | * Find out if the Device is already attached to a |
359 | * Processor. If so, return AlreadyAttached status */ | 358 | * Processor. If so, return AlreadyAttached status */ |
360 | lst_init_elem(&p_proc_object->link); | 359 | status = dev_insert_proc_object(p_proc_object->dev_obj, |
361 | status = dev_insert_proc_object(p_proc_object->hdev_obj, | ||
362 | (u32) p_proc_object, | 360 | (u32) p_proc_object, |
363 | &p_proc_object-> | 361 | &p_proc_object-> |
364 | is_already_attached); | 362 | is_already_attached); |
@@ -375,7 +373,7 @@ proc_attach(u32 processor_id, | |||
375 | } | 373 | } |
376 | if (!status) { | 374 | if (!status) { |
377 | *ph_processor = (void *)p_proc_object; | 375 | *ph_processor = (void *)p_proc_object; |
378 | pr_ctxt->hprocessor = *ph_processor; | 376 | pr_ctxt->processor = *ph_processor; |
379 | (void)proc_notify_clients(p_proc_object, | 377 | (void)proc_notify_clients(p_proc_object, |
380 | DSP_PROCESSORATTACH); | 378 | DSP_PROCESSORATTACH); |
381 | } | 379 | } |
@@ -465,12 +463,12 @@ int proc_auto_start(struct cfg_devnode *dev_node_obj, | |||
465 | status = -ENOMEM; | 463 | status = -ENOMEM; |
466 | goto func_end; | 464 | goto func_end; |
467 | } | 465 | } |
468 | p_proc_object->hdev_obj = hdev_obj; | 466 | p_proc_object->dev_obj = hdev_obj; |
469 | p_proc_object->hmgr_obj = hmgr_obj; | 467 | p_proc_object->mgr_obj = hmgr_obj; |
470 | status = dev_get_intf_fxns(hdev_obj, &p_proc_object->intf_fxns); | 468 | status = dev_get_intf_fxns(hdev_obj, &p_proc_object->intf_fxns); |
471 | if (!status) | 469 | if (!status) |
472 | status = dev_get_bridge_context(hdev_obj, | 470 | status = dev_get_bridge_context(hdev_obj, |
473 | &p_proc_object->hbridge_context); | 471 | &p_proc_object->bridge_context); |
474 | if (status) | 472 | if (status) |
475 | goto func_cont; | 473 | goto func_cont; |
476 | 474 | ||
@@ -493,8 +491,8 @@ int proc_auto_start(struct cfg_devnode *dev_node_obj, | |||
493 | if (!status) | 491 | if (!status) |
494 | status = proc_start(p_proc_object); | 492 | status = proc_start(p_proc_object); |
495 | } | 493 | } |
496 | kfree(p_proc_object->psz_last_coff); | 494 | kfree(p_proc_object->last_coff); |
497 | p_proc_object->psz_last_coff = NULL; | 495 | p_proc_object->last_coff = NULL; |
498 | func_cont: | 496 | func_cont: |
499 | kfree(p_proc_object); | 497 | kfree(p_proc_object); |
500 | func_end: | 498 | func_end: |
@@ -542,8 +540,8 @@ int proc_ctrl(void *hprocessor, u32 dw_cmd, struct dsp_cbdata * arg) | |||
542 | /* timeout = arg->cb_data; */ | 540 | /* timeout = arg->cb_data; */ |
543 | status = pwr_wake_dsp(timeout); | 541 | status = pwr_wake_dsp(timeout); |
544 | } else | 542 | } else |
545 | if (!((*p_proc_object->intf_fxns->pfn_dev_cntrl) | 543 | if (!((*p_proc_object->intf_fxns->dev_cntrl) |
546 | (p_proc_object->hbridge_context, dw_cmd, | 544 | (p_proc_object->bridge_context, dw_cmd, |
547 | arg))) { | 545 | arg))) { |
548 | status = 0; | 546 | status = 0; |
549 | } else { | 547 | } else { |
@@ -569,7 +567,7 @@ int proc_detach(struct process_context *pr_ctxt) | |||
569 | 567 | ||
570 | DBC_REQUIRE(refs > 0); | 568 | DBC_REQUIRE(refs > 0); |
571 | 569 | ||
572 | p_proc_object = (struct proc_object *)pr_ctxt->hprocessor; | 570 | p_proc_object = (struct proc_object *)pr_ctxt->processor; |
573 | 571 | ||
574 | if (p_proc_object) { | 572 | if (p_proc_object) { |
575 | /* Notify the Client */ | 573 | /* Notify the Client */ |
@@ -580,14 +578,14 @@ int proc_detach(struct process_context *pr_ctxt) | |||
580 | kfree(p_proc_object->ntfy_obj); | 578 | kfree(p_proc_object->ntfy_obj); |
581 | } | 579 | } |
582 | 580 | ||
583 | kfree(p_proc_object->psz_last_coff); | 581 | kfree(p_proc_object->last_coff); |
584 | p_proc_object->psz_last_coff = NULL; | 582 | p_proc_object->last_coff = NULL; |
585 | /* Remove the Proc from the DEV List */ | 583 | /* Remove the Proc from the DEV List */ |
586 | (void)dev_remove_proc_object(p_proc_object->hdev_obj, | 584 | (void)dev_remove_proc_object(p_proc_object->dev_obj, |
587 | (u32) p_proc_object); | 585 | (u32) p_proc_object); |
588 | /* Free the Processor Object */ | 586 | /* Free the Processor Object */ |
589 | kfree(p_proc_object); | 587 | kfree(p_proc_object); |
590 | pr_ctxt->hprocessor = NULL; | 588 | pr_ctxt->processor = NULL; |
591 | } else { | 589 | } else { |
592 | status = -EFAULT; | 590 | status = -EFAULT; |
593 | } | 591 | } |
@@ -615,7 +613,7 @@ int proc_enum_nodes(void *hprocessor, void **node_tab, | |||
615 | DBC_REQUIRE(pu_allocated != NULL); | 613 | DBC_REQUIRE(pu_allocated != NULL); |
616 | 614 | ||
617 | if (p_proc_object) { | 615 | if (p_proc_object) { |
618 | if (!(dev_get_node_manager(p_proc_object->hdev_obj, | 616 | if (!(dev_get_node_manager(p_proc_object->dev_obj, |
619 | &hnode_mgr))) { | 617 | &hnode_mgr))) { |
620 | if (hnode_mgr) { | 618 | if (hnode_mgr) { |
621 | status = node_enum_nodes(hnode_mgr, node_tab, | 619 | status = node_enum_nodes(hnode_mgr, node_tab, |
@@ -892,7 +890,7 @@ int proc_get_resource_info(void *hprocessor, u32 resource_type, | |||
892 | case DSP_RESOURCE_DYNSARAM: | 890 | case DSP_RESOURCE_DYNSARAM: |
893 | case DSP_RESOURCE_DYNEXTERNAL: | 891 | case DSP_RESOURCE_DYNEXTERNAL: |
894 | case DSP_RESOURCE_DYNSRAM: | 892 | case DSP_RESOURCE_DYNSRAM: |
895 | status = dev_get_node_manager(p_proc_object->hdev_obj, | 893 | status = dev_get_node_manager(p_proc_object->dev_obj, |
896 | &hnode_mgr); | 894 | &hnode_mgr); |
897 | if (!hnode_mgr) { | 895 | if (!hnode_mgr) { |
898 | status = -EFAULT; | 896 | status = -EFAULT; |
@@ -915,11 +913,11 @@ int proc_get_resource_info(void *hprocessor, u32 resource_type, | |||
915 | } | 913 | } |
916 | break; | 914 | break; |
917 | case DSP_RESOURCE_PROCLOAD: | 915 | case DSP_RESOURCE_PROCLOAD: |
918 | status = dev_get_io_mgr(p_proc_object->hdev_obj, &hio_mgr); | 916 | status = dev_get_io_mgr(p_proc_object->dev_obj, &hio_mgr); |
919 | if (hio_mgr) | 917 | if (hio_mgr) |
920 | status = | 918 | status = |
921 | p_proc_object->intf_fxns-> | 919 | p_proc_object->intf_fxns-> |
922 | pfn_io_get_proc_load(hio_mgr, | 920 | io_get_proc_load(hio_mgr, |
923 | (struct dsp_procloadstat *) | 921 | (struct dsp_procloadstat *) |
924 | &(resource_info->result. | 922 | &(resource_info->result. |
925 | proc_load_stat)); | 923 | proc_load_stat)); |
@@ -965,7 +963,7 @@ int proc_get_dev_object(void *hprocessor, | |||
965 | DBC_REQUIRE(device_obj != NULL); | 963 | DBC_REQUIRE(device_obj != NULL); |
966 | 964 | ||
967 | if (p_proc_object) { | 965 | if (p_proc_object) { |
968 | *device_obj = p_proc_object->hdev_obj; | 966 | *device_obj = p_proc_object->dev_obj; |
969 | status = 0; | 967 | status = 0; |
970 | } else { | 968 | } else { |
971 | *device_obj = NULL; | 969 | *device_obj = NULL; |
@@ -997,8 +995,8 @@ int proc_get_state(void *hprocessor, | |||
997 | 995 | ||
998 | if (p_proc_object) { | 996 | if (p_proc_object) { |
999 | /* First, retrieve BRD state information */ | 997 | /* First, retrieve BRD state information */ |
1000 | status = (*p_proc_object->intf_fxns->pfn_brd_status) | 998 | status = (*p_proc_object->intf_fxns->brd_status) |
1001 | (p_proc_object->hbridge_context, &brd_status); | 999 | (p_proc_object->bridge_context, &brd_status); |
1002 | if (!status) { | 1000 | if (!status) { |
1003 | switch (brd_status) { | 1001 | switch (brd_status) { |
1004 | case BRD_STOPPED: | 1002 | case BRD_STOPPED: |
@@ -1117,7 +1115,7 @@ int proc_load(void *hprocessor, const s32 argc_index, | |||
1117 | status = -EFAULT; | 1115 | status = -EFAULT; |
1118 | goto func_end; | 1116 | goto func_end; |
1119 | } | 1117 | } |
1120 | dev_get_cod_mgr(p_proc_object->hdev_obj, &cod_mgr); | 1118 | dev_get_cod_mgr(p_proc_object->dev_obj, &cod_mgr); |
1121 | if (!cod_mgr) { | 1119 | if (!cod_mgr) { |
1122 | status = -EPERM; | 1120 | status = -EPERM; |
1123 | goto func_end; | 1121 | goto func_end; |
@@ -1149,7 +1147,7 @@ int proc_load(void *hprocessor, const s32 argc_index, | |||
1149 | prepend_envp(new_envp, (char **)user_envp, | 1147 | prepend_envp(new_envp, (char **)user_envp, |
1150 | envp_elems, cnew_envp, sz_proc_id); | 1148 | envp_elems, cnew_envp, sz_proc_id); |
1151 | /* Get the DCD Handle */ | 1149 | /* Get the DCD Handle */ |
1152 | status = mgr_get_dcd_handle(p_proc_object->hmgr_obj, | 1150 | status = mgr_get_dcd_handle(p_proc_object->mgr_obj, |
1153 | (u32 *) &hdcd_handle); | 1151 | (u32 *) &hdcd_handle); |
1154 | if (!status) { | 1152 | if (!status) { |
1155 | /* Before proceeding with new load, | 1153 | /* Before proceeding with new load, |
@@ -1158,16 +1156,16 @@ int proc_load(void *hprocessor, const s32 argc_index, | |||
1158 | * If yes, unregister nodes in previously | 1156 | * If yes, unregister nodes in previously |
1159 | * registered COFF. If any error occurred, | 1157 | * registered COFF. If any error occurred, |
1160 | * set previously registered COFF to NULL. */ | 1158 | * set previously registered COFF to NULL. */ |
1161 | if (p_proc_object->psz_last_coff != NULL) { | 1159 | if (p_proc_object->last_coff != NULL) { |
1162 | status = | 1160 | status = |
1163 | dcd_auto_unregister(hdcd_handle, | 1161 | dcd_auto_unregister(hdcd_handle, |
1164 | p_proc_object-> | 1162 | p_proc_object-> |
1165 | psz_last_coff); | 1163 | last_coff); |
1166 | /* Regardless of auto unregister status, | 1164 | /* Regardless of auto unregister status, |
1167 | * free previously allocated | 1165 | * free previously allocated |
1168 | * memory. */ | 1166 | * memory. */ |
1169 | kfree(p_proc_object->psz_last_coff); | 1167 | kfree(p_proc_object->last_coff); |
1170 | p_proc_object->psz_last_coff = NULL; | 1168 | p_proc_object->last_coff = NULL; |
1171 | } | 1169 | } |
1172 | } | 1170 | } |
1173 | /* On success, do cod_open_base() */ | 1171 | /* On success, do cod_open_base() */ |
@@ -1180,7 +1178,7 @@ int proc_load(void *hprocessor, const s32 argc_index, | |||
1180 | if (!status) { | 1178 | if (!status) { |
1181 | /* Auto-register data base */ | 1179 | /* Auto-register data base */ |
1182 | /* Get the DCD Handle */ | 1180 | /* Get the DCD Handle */ |
1183 | status = mgr_get_dcd_handle(p_proc_object->hmgr_obj, | 1181 | status = mgr_get_dcd_handle(p_proc_object->mgr_obj, |
1184 | (u32 *) &hdcd_handle); | 1182 | (u32 *) &hdcd_handle); |
1185 | if (!status) { | 1183 | if (!status) { |
1186 | /* Auto register nodes in specified COFF | 1184 | /* Auto register nodes in specified COFF |
@@ -1197,15 +1195,15 @@ int proc_load(void *hprocessor, const s32 argc_index, | |||
1197 | if (status) { | 1195 | if (status) { |
1198 | status = -EPERM; | 1196 | status = -EPERM; |
1199 | } else { | 1197 | } else { |
1200 | DBC_ASSERT(p_proc_object->psz_last_coff == | 1198 | DBC_ASSERT(p_proc_object->last_coff == |
1201 | NULL); | 1199 | NULL); |
1202 | /* Allocate memory for pszLastCoff */ | 1200 | /* Allocate memory for pszLastCoff */ |
1203 | p_proc_object->psz_last_coff = | 1201 | p_proc_object->last_coff = |
1204 | kzalloc((strlen(user_args[0]) + | 1202 | kzalloc((strlen(user_args[0]) + |
1205 | 1), GFP_KERNEL); | 1203 | 1), GFP_KERNEL); |
1206 | /* If memory allocated, save COFF file name */ | 1204 | /* If memory allocated, save COFF file name */ |
1207 | if (p_proc_object->psz_last_coff) { | 1205 | if (p_proc_object->last_coff) { |
1208 | strncpy(p_proc_object->psz_last_coff, | 1206 | strncpy(p_proc_object->last_coff, |
1209 | (char *)user_args[0], | 1207 | (char *)user_args[0], |
1210 | (strlen((char *)user_args[0]) + | 1208 | (strlen((char *)user_args[0]) + |
1211 | 1)); | 1209 | 1)); |
@@ -1217,19 +1215,19 @@ int proc_load(void *hprocessor, const s32 argc_index, | |||
1217 | if (!status) { | 1215 | if (!status) { |
1218 | /* Create the message manager. This must be done | 1216 | /* Create the message manager. This must be done |
1219 | * before calling the IOOnLoaded function. */ | 1217 | * before calling the IOOnLoaded function. */ |
1220 | dev_get_msg_mgr(p_proc_object->hdev_obj, &hmsg_mgr); | 1218 | dev_get_msg_mgr(p_proc_object->dev_obj, &hmsg_mgr); |
1221 | if (!hmsg_mgr) { | 1219 | if (!hmsg_mgr) { |
1222 | status = msg_create(&hmsg_mgr, p_proc_object->hdev_obj, | 1220 | status = msg_create(&hmsg_mgr, p_proc_object->dev_obj, |
1223 | (msg_onexit) node_on_exit); | 1221 | (msg_onexit) node_on_exit); |
1224 | DBC_ASSERT(!status); | 1222 | DBC_ASSERT(!status); |
1225 | dev_set_msg_mgr(p_proc_object->hdev_obj, hmsg_mgr); | 1223 | dev_set_msg_mgr(p_proc_object->dev_obj, hmsg_mgr); |
1226 | } | 1224 | } |
1227 | } | 1225 | } |
1228 | if (!status) { | 1226 | if (!status) { |
1229 | /* Set the Device object's message manager */ | 1227 | /* Set the Device object's message manager */ |
1230 | status = dev_get_io_mgr(p_proc_object->hdev_obj, &hio_mgr); | 1228 | status = dev_get_io_mgr(p_proc_object->dev_obj, &hio_mgr); |
1231 | if (hio_mgr) | 1229 | if (hio_mgr) |
1232 | status = (*p_proc_object->intf_fxns->pfn_io_on_loaded) | 1230 | status = (*p_proc_object->intf_fxns->io_on_loaded) |
1233 | (hio_mgr); | 1231 | (hio_mgr); |
1234 | else | 1232 | else |
1235 | status = -EFAULT; | 1233 | status = -EFAULT; |
@@ -1244,7 +1242,7 @@ int proc_load(void *hprocessor, const s32 argc_index, | |||
1244 | #endif | 1242 | #endif |
1245 | status = cod_load_base(cod_mgr, argc_index, (char **)user_args, | 1243 | status = cod_load_base(cod_mgr, argc_index, (char **)user_args, |
1246 | dev_brd_write_fxn, | 1244 | dev_brd_write_fxn, |
1247 | p_proc_object->hdev_obj, NULL); | 1245 | p_proc_object->dev_obj, NULL); |
1248 | if (status) { | 1246 | if (status) { |
1249 | if (status == -EBADF) { | 1247 | if (status == -EBADF) { |
1250 | dev_dbg(bridge, "%s: Failure to Load the EXE\n", | 1248 | dev_dbg(bridge, "%s: Failure to Load the EXE\n", |
@@ -1264,8 +1262,8 @@ int proc_load(void *hprocessor, const s32 argc_index, | |||
1264 | } | 1262 | } |
1265 | if (!status) { | 1263 | if (!status) { |
1266 | /* Update the Processor status to loaded */ | 1264 | /* Update the Processor status to loaded */ |
1267 | status = (*p_proc_object->intf_fxns->pfn_brd_set_state) | 1265 | status = (*p_proc_object->intf_fxns->brd_set_state) |
1268 | (p_proc_object->hbridge_context, BRD_LOADED); | 1266 | (p_proc_object->bridge_context, BRD_LOADED); |
1269 | if (!status) { | 1267 | if (!status) { |
1270 | p_proc_object->proc_state = PROC_LOADED; | 1268 | p_proc_object->proc_state = PROC_LOADED; |
1271 | if (p_proc_object->ntfy_obj) | 1269 | if (p_proc_object->ntfy_obj) |
@@ -1285,7 +1283,7 @@ int proc_load(void *hprocessor, const s32 argc_index, | |||
1285 | /* Reset DMM structs and add an initial free chunk */ | 1283 | /* Reset DMM structs and add an initial free chunk */ |
1286 | if (!status) { | 1284 | if (!status) { |
1287 | status = | 1285 | status = |
1288 | dev_get_dmm_mgr(p_proc_object->hdev_obj, | 1286 | dev_get_dmm_mgr(p_proc_object->dev_obj, |
1289 | &dmm_mgr); | 1287 | &dmm_mgr); |
1290 | if (dmm_mgr) { | 1288 | if (dmm_mgr) { |
1291 | /* Set dw_ext_end to DMM START u8 | 1289 | /* Set dw_ext_end to DMM START u8 |
@@ -1306,8 +1304,8 @@ int proc_load(void *hprocessor, const s32 argc_index, | |||
1306 | kfree(new_envp); | 1304 | kfree(new_envp); |
1307 | user_args[0] = pargv0; | 1305 | user_args[0] = pargv0; |
1308 | if (!status) { | 1306 | if (!status) { |
1309 | if (!((*p_proc_object->intf_fxns->pfn_brd_status) | 1307 | if (!((*p_proc_object->intf_fxns->brd_status) |
1310 | (p_proc_object->hbridge_context, &brd_state))) { | 1308 | (p_proc_object->bridge_context, &brd_state))) { |
1311 | pr_info("%s: Processor Loaded %s\n", __func__, pargv0); | 1309 | pr_info("%s: Processor Loaded %s\n", __func__, pargv0); |
1312 | kfree(drv_datap->base_img); | 1310 | kfree(drv_datap->base_img); |
1313 | drv_datap->base_img = kmalloc(strlen(pargv0) + 1, | 1311 | drv_datap->base_img = kmalloc(strlen(pargv0) + 1, |
@@ -1399,8 +1397,8 @@ int proc_map(void *hprocessor, void *pmpu_addr, u32 ul_size, | |||
1399 | if (!map_obj) | 1397 | if (!map_obj) |
1400 | status = -ENOMEM; | 1398 | status = -ENOMEM; |
1401 | else | 1399 | else |
1402 | status = (*p_proc_object->intf_fxns->pfn_brd_mem_map) | 1400 | status = (*p_proc_object->intf_fxns->brd_mem_map) |
1403 | (p_proc_object->hbridge_context, pa_align, va_align, | 1401 | (p_proc_object->bridge_context, pa_align, va_align, |
1404 | size_align, ul_map_attr, map_obj->pages); | 1402 | size_align, ul_map_attr, map_obj->pages); |
1405 | } | 1403 | } |
1406 | if (!status) { | 1404 | if (!status) { |
@@ -1477,7 +1475,7 @@ int proc_register_notify(void *hprocessor, u32 event_mask, | |||
1477 | */ | 1475 | */ |
1478 | if ((event_mask == 0) && status) { | 1476 | if ((event_mask == 0) && status) { |
1479 | status = | 1477 | status = |
1480 | dev_get_deh_mgr(p_proc_object->hdev_obj, | 1478 | dev_get_deh_mgr(p_proc_object->dev_obj, |
1481 | &hdeh_mgr); | 1479 | &hdeh_mgr); |
1482 | status = | 1480 | status = |
1483 | bridge_deh_register_notify(hdeh_mgr, | 1481 | bridge_deh_register_notify(hdeh_mgr, |
@@ -1486,7 +1484,7 @@ int proc_register_notify(void *hprocessor, u32 event_mask, | |||
1486 | hnotification); | 1484 | hnotification); |
1487 | } | 1485 | } |
1488 | } else { | 1486 | } else { |
1489 | status = dev_get_deh_mgr(p_proc_object->hdev_obj, | 1487 | status = dev_get_deh_mgr(p_proc_object->dev_obj, |
1490 | &hdeh_mgr); | 1488 | &hdeh_mgr); |
1491 | status = | 1489 | status = |
1492 | bridge_deh_register_notify(hdeh_mgr, | 1490 | bridge_deh_register_notify(hdeh_mgr, |
@@ -1572,7 +1570,7 @@ int proc_start(void *hprocessor) | |||
1572 | status = -EBADR; | 1570 | status = -EBADR; |
1573 | goto func_end; | 1571 | goto func_end; |
1574 | } | 1572 | } |
1575 | status = dev_get_cod_mgr(p_proc_object->hdev_obj, &cod_mgr); | 1573 | status = dev_get_cod_mgr(p_proc_object->dev_obj, &cod_mgr); |
1576 | if (!cod_mgr) { | 1574 | if (!cod_mgr) { |
1577 | status = -EFAULT; | 1575 | status = -EFAULT; |
1578 | goto func_cont; | 1576 | goto func_cont; |
@@ -1582,13 +1580,13 @@ int proc_start(void *hprocessor) | |||
1582 | if (status) | 1580 | if (status) |
1583 | goto func_cont; | 1581 | goto func_cont; |
1584 | 1582 | ||
1585 | status = (*p_proc_object->intf_fxns->pfn_brd_start) | 1583 | status = (*p_proc_object->intf_fxns->brd_start) |
1586 | (p_proc_object->hbridge_context, dw_dsp_addr); | 1584 | (p_proc_object->bridge_context, dw_dsp_addr); |
1587 | if (status) | 1585 | if (status) |
1588 | goto func_cont; | 1586 | goto func_cont; |
1589 | 1587 | ||
1590 | /* Call dev_create2 */ | 1588 | /* Call dev_create2 */ |
1591 | status = dev_create2(p_proc_object->hdev_obj); | 1589 | status = dev_create2(p_proc_object->dev_obj); |
1592 | if (!status) { | 1590 | if (!status) { |
1593 | p_proc_object->proc_state = PROC_RUNNING; | 1591 | p_proc_object->proc_state = PROC_RUNNING; |
1594 | /* Deep sleep switces off the peripheral clocks. | 1592 | /* Deep sleep switces off the peripheral clocks. |
@@ -1603,13 +1601,13 @@ int proc_start(void *hprocessor) | |||
1603 | /* Failed to Create Node Manager and DISP Object | 1601 | /* Failed to Create Node Manager and DISP Object |
1604 | * Stop the Processor from running. Put it in STOPPED State */ | 1602 | * Stop the Processor from running. Put it in STOPPED State */ |
1605 | (void)(*p_proc_object->intf_fxns-> | 1603 | (void)(*p_proc_object->intf_fxns-> |
1606 | pfn_brd_stop) (p_proc_object->hbridge_context); | 1604 | brd_stop) (p_proc_object->bridge_context); |
1607 | p_proc_object->proc_state = PROC_STOPPED; | 1605 | p_proc_object->proc_state = PROC_STOPPED; |
1608 | } | 1606 | } |
1609 | func_cont: | 1607 | func_cont: |
1610 | if (!status) { | 1608 | if (!status) { |
1611 | if (!((*p_proc_object->intf_fxns->pfn_brd_status) | 1609 | if (!((*p_proc_object->intf_fxns->brd_status) |
1612 | (p_proc_object->hbridge_context, &brd_state))) { | 1610 | (p_proc_object->bridge_context, &brd_state))) { |
1613 | pr_info("%s: dsp in running state\n", __func__); | 1611 | pr_info("%s: dsp in running state\n", __func__); |
1614 | DBC_ASSERT(brd_state != BRD_HIBERNATION); | 1612 | DBC_ASSERT(brd_state != BRD_HIBERNATION); |
1615 | } | 1613 | } |
@@ -1647,7 +1645,7 @@ int proc_stop(void *hprocessor) | |||
1647 | goto func_end; | 1645 | goto func_end; |
1648 | } | 1646 | } |
1649 | /* check if there are any running nodes */ | 1647 | /* check if there are any running nodes */ |
1650 | status = dev_get_node_manager(p_proc_object->hdev_obj, &hnode_mgr); | 1648 | status = dev_get_node_manager(p_proc_object->dev_obj, &hnode_mgr); |
1651 | if (!status && hnode_mgr) { | 1649 | if (!status && hnode_mgr) { |
1652 | status = node_enum_nodes(hnode_mgr, &hnode, node_tab_size, | 1650 | status = node_enum_nodes(hnode_mgr, &hnode, node_tab_size, |
1653 | &num_nodes, &nodes_allocated); | 1651 | &num_nodes, &nodes_allocated); |
@@ -1661,21 +1659,21 @@ int proc_stop(void *hprocessor) | |||
1661 | /* It is OK to stop a device that does n't have nodes OR not started */ | 1659 | /* It is OK to stop a device that does n't have nodes OR not started */ |
1662 | status = | 1660 | status = |
1663 | (*p_proc_object->intf_fxns-> | 1661 | (*p_proc_object->intf_fxns-> |
1664 | pfn_brd_stop) (p_proc_object->hbridge_context); | 1662 | brd_stop) (p_proc_object->bridge_context); |
1665 | if (!status) { | 1663 | if (!status) { |
1666 | dev_dbg(bridge, "%s: processor in standby mode\n", __func__); | 1664 | dev_dbg(bridge, "%s: processor in standby mode\n", __func__); |
1667 | p_proc_object->proc_state = PROC_STOPPED; | 1665 | p_proc_object->proc_state = PROC_STOPPED; |
1668 | /* Destory the Node Manager, msg_ctrl Manager */ | 1666 | /* Destory the Node Manager, msg_ctrl Manager */ |
1669 | if (!(dev_destroy2(p_proc_object->hdev_obj))) { | 1667 | if (!(dev_destroy2(p_proc_object->dev_obj))) { |
1670 | /* Destroy the msg_ctrl by calling msg_delete */ | 1668 | /* Destroy the msg_ctrl by calling msg_delete */ |
1671 | dev_get_msg_mgr(p_proc_object->hdev_obj, &hmsg_mgr); | 1669 | dev_get_msg_mgr(p_proc_object->dev_obj, &hmsg_mgr); |
1672 | if (hmsg_mgr) { | 1670 | if (hmsg_mgr) { |
1673 | msg_delete(hmsg_mgr); | 1671 | msg_delete(hmsg_mgr); |
1674 | dev_set_msg_mgr(p_proc_object->hdev_obj, NULL); | 1672 | dev_set_msg_mgr(p_proc_object->dev_obj, NULL); |
1675 | } | 1673 | } |
1676 | if (!((*p_proc_object-> | 1674 | if (!((*p_proc_object-> |
1677 | intf_fxns->pfn_brd_status) (p_proc_object-> | 1675 | intf_fxns->brd_status) (p_proc_object-> |
1678 | hbridge_context, | 1676 | bridge_context, |
1679 | &brd_state))) | 1677 | &brd_state))) |
1680 | DBC_ASSERT(brd_state == BRD_STOPPED); | 1678 | DBC_ASSERT(brd_state == BRD_STOPPED); |
1681 | } | 1679 | } |
@@ -1722,8 +1720,8 @@ int proc_un_map(void *hprocessor, void *map_addr, | |||
1722 | status = dmm_un_map_memory(dmm_mgr, (u32) va_align, &size_align); | 1720 | status = dmm_un_map_memory(dmm_mgr, (u32) va_align, &size_align); |
1723 | /* Remove mapping from the page tables. */ | 1721 | /* Remove mapping from the page tables. */ |
1724 | if (!status) { | 1722 | if (!status) { |
1725 | status = (*p_proc_object->intf_fxns->pfn_brd_mem_un_map) | 1723 | status = (*p_proc_object->intf_fxns->brd_mem_un_map) |
1726 | (p_proc_object->hbridge_context, va_align, size_align); | 1724 | (p_proc_object->bridge_context, va_align, size_align); |
1727 | } | 1725 | } |
1728 | 1726 | ||
1729 | mutex_unlock(&proc_lock); | 1727 | mutex_unlock(&proc_lock); |
@@ -1821,20 +1819,20 @@ static int proc_monitor(struct proc_object *proc_obj) | |||
1821 | /* This is needed only when Device is loaded when it is | 1819 | /* This is needed only when Device is loaded when it is |
1822 | * already 'ACTIVE' */ | 1820 | * already 'ACTIVE' */ |
1823 | /* Destory the Node Manager, msg_ctrl Manager */ | 1821 | /* Destory the Node Manager, msg_ctrl Manager */ |
1824 | if (!dev_destroy2(proc_obj->hdev_obj)) { | 1822 | if (!dev_destroy2(proc_obj->dev_obj)) { |
1825 | /* Destroy the msg_ctrl by calling msg_delete */ | 1823 | /* Destroy the msg_ctrl by calling msg_delete */ |
1826 | dev_get_msg_mgr(proc_obj->hdev_obj, &hmsg_mgr); | 1824 | dev_get_msg_mgr(proc_obj->dev_obj, &hmsg_mgr); |
1827 | if (hmsg_mgr) { | 1825 | if (hmsg_mgr) { |
1828 | msg_delete(hmsg_mgr); | 1826 | msg_delete(hmsg_mgr); |
1829 | dev_set_msg_mgr(proc_obj->hdev_obj, NULL); | 1827 | dev_set_msg_mgr(proc_obj->dev_obj, NULL); |
1830 | } | 1828 | } |
1831 | } | 1829 | } |
1832 | /* Place the Board in the Monitor State */ | 1830 | /* Place the Board in the Monitor State */ |
1833 | if (!((*proc_obj->intf_fxns->pfn_brd_monitor) | 1831 | if (!((*proc_obj->intf_fxns->brd_monitor) |
1834 | (proc_obj->hbridge_context))) { | 1832 | (proc_obj->bridge_context))) { |
1835 | status = 0; | 1833 | status = 0; |
1836 | if (!((*proc_obj->intf_fxns->pfn_brd_status) | 1834 | if (!((*proc_obj->intf_fxns->brd_status) |
1837 | (proc_obj->hbridge_context, &brd_state))) | 1835 | (proc_obj->bridge_context, &brd_state))) |
1838 | DBC_ASSERT(brd_state == BRD_IDLE); | 1836 | DBC_ASSERT(brd_state == BRD_IDLE); |
1839 | } | 1837 | } |
1840 | 1838 | ||
@@ -1931,7 +1929,7 @@ int proc_notify_all_clients(void *proc, u32 events) | |||
1931 | goto func_end; | 1929 | goto func_end; |
1932 | } | 1930 | } |
1933 | 1931 | ||
1934 | dev_notify_clients(p_proc_object->hdev_obj, events); | 1932 | dev_notify_clients(p_proc_object->dev_obj, events); |
1935 | 1933 | ||
1936 | func_end: | 1934 | func_end: |
1937 | return status; | 1935 | return status; |