/* ----------------------------------- Function Prototypes */
static struct lst_list *create_chirp_list(u32 chirps);
-static void free_chirp_list(struct lst_list *lst);
+static void free_chirp_list(struct lst_list *chirp_list);
static struct chnl_irp *make_new_chirp(void);
* Request chanenel I/O from the DSP. Sets flags in shared memory, then
* interrupts the DSP.
*/
-void io_request_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl,
+void io_request_chnl(struct io_mgr *io_manager, struct chnl_object *pchnl,
u8 io_mode, OUT u16 *mbx_val)
{
struct chnl_mgr *chnl_mgr_obj;
if (!pchnl || !mbx_val)
goto func_end;
- chnl_mgr_obj = pio_mgr->hchnl_mgr;
- sm = pio_mgr->shared_mem;
+ chnl_mgr_obj = io_manager->hchnl_mgr;
+ sm = io_manager->shared_mem;
if (io_mode == IO_INPUT) {
/*
* Assertion fires if CHNL_AddIOReq() called on a stream
DBC_ASSERT((pchnl->dw_state == CHNL_STATEREADY) ||
(pchnl->dw_state == CHNL_STATEEOS));
/* Indicate to the DSP we have a buffer available for input */
- IO_OR_VALUE(pio_mgr->hbridge_context, struct shm, sm,
+ IO_OR_VALUE(io_manager->hbridge_context, struct shm, sm,
host_free_mask, (1 << pchnl->chnl_id));
*mbx_val = MBX_PCPY_CLASS;
} else if (io_mode == IO_OUTPUT) {
* ======== iosm_schedule ========
* Schedule DPC for IO.
*/
-void iosm_schedule(struct io_mgr *pio_mgr)
+void iosm_schedule(struct io_mgr *io_manager)
{
unsigned long flags;
- if (!pio_mgr)
+ if (!io_manager)
return;
/* Increment count of DPC's pending. */
- spin_lock_irqsave(&pio_mgr->dpc_lock, flags);
- pio_mgr->dpc_req++;
- spin_unlock_irqrestore(&pio_mgr->dpc_lock, flags);
+ spin_lock_irqsave(&io_manager->dpc_lock, flags);
+ io_manager->dpc_req++;
+ spin_unlock_irqrestore(&io_manager->dpc_lock, flags);
/* Schedule DPC */
- tasklet_schedule(&pio_mgr->dpc_tasklet);
+ tasklet_schedule(&io_manager->dpc_tasklet);
}
/*
#define PHYS_TO_PAGE(phys) pfn_to_page((phys) >> PAGE_SHIFT)
/* Forward Declarations: */
-static int bridge_brd_monitor(struct bridge_dev_context *dev_context);
-static int bridge_brd_read(struct bridge_dev_context *dev_context,
+static int bridge_brd_monitor(struct bridge_dev_context *dev_ctxt);
+static int bridge_brd_read(struct bridge_dev_context *dev_ctxt,
OUT u8 *host_buff,
u32 dsp_addr, u32 ul_num_bytes,
u32 mem_type);
-static int bridge_brd_start(struct bridge_dev_context *dev_context,
+static int bridge_brd_start(struct bridge_dev_context *dev_ctxt,
u32 dsp_addr);
-static int bridge_brd_status(struct bridge_dev_context *dev_context,
+static int bridge_brd_status(struct bridge_dev_context *dev_ctxt,
int *board_state);
-static int bridge_brd_stop(struct bridge_dev_context *dev_context);
-static int bridge_brd_write(struct bridge_dev_context *dev_context,
+static int bridge_brd_stop(struct bridge_dev_context *dev_ctxt);
+static int bridge_brd_write(struct bridge_dev_context *dev_ctxt,
IN u8 *host_buff,
u32 dsp_addr, u32 ul_num_bytes,
u32 mem_type);
static int bridge_brd_mem_copy(struct bridge_dev_context *dev_ctxt,
u32 dsp_dest_addr, u32 dsp_src_addr,
u32 ul_num_bytes, u32 mem_type);
-static int bridge_brd_mem_write(struct bridge_dev_context *dev_context,
+static int bridge_brd_mem_write(struct bridge_dev_context *dev_ctxt,
IN u8 *host_buff, u32 dsp_addr,
u32 ul_num_bytes, u32 mem_type);
static int bridge_brd_mem_map(struct bridge_dev_context *dev_ctxt,
IN struct cfg_hostres *config_param);
static int bridge_dev_ctrl(struct bridge_dev_context *dev_context,
u32 dw_cmd, IN OUT void *pargs);
-static int bridge_dev_destroy(struct bridge_dev_context *dev_context);
+static int bridge_dev_destroy(struct bridge_dev_context *dev_ctxt);
static u32 user_va2_pa(struct mm_struct *mm, u32 address);
static int pte_update(struct bridge_dev_context *dev_ctxt, u32 pa,
u32 va, u32 size,
struct hw_mmu_map_attrs_t *map_attrs);
static int pte_set(struct pg_table_attrs *pt, u32 pa, u32 va,
u32 size, struct hw_mmu_map_attrs_t *attrs);
-static int mem_map_vmalloc(struct bridge_dev_context *dev_ctxt,
+static int mem_map_vmalloc(struct bridge_dev_context *dev_context,
u32 ul_mpu_addr, u32 virt_addr,
u32 ul_num_bytes,
struct hw_mmu_map_attrs_t *hw_attrs);
* purpose:
* Copies buffers to the DSP internal/external memory.
*/
-int write_dsp_data(struct bridge_dev_context *dev_ctxt,
+int write_dsp_data(struct bridge_dev_context *dev_context,
IN u8 *host_buff, u32 dsp_addr, u32 ul_num_bytes,
u32 mem_type)
{
u32 offset;
- u32 dw_base_addr = dev_ctxt->dw_dsp_base_addr;
- struct cfg_hostres *resources = dev_ctxt->resources;
+ u32 dw_base_addr = dev_context->dw_dsp_base_addr;
+ struct cfg_hostres *resources = dev_context->resources;
int status = 0;
u32 base1, base2, base3;
base1 = OMAP_DSP_MEM1_SIZE;
if (!resources)
return -EPERM;
- offset = dsp_addr - dev_ctxt->dw_dsp_start_add;
+ offset = dsp_addr - dev_context->dw_dsp_start_add;
if (offset < base1) {
dw_base_addr = MEM_LINEAR_ADDRESS(resources->dw_mem_base[2],
resources->dw_mem_length[2]);
* Reads it from DSP External memory. The external memory for the DSP
* is configured by the combination of DSP MMU and shm Memory manager in the CDB
*/
-extern int read_ext_dsp_data(struct bridge_dev_context *dev_context,
+extern int read_ext_dsp_data(struct bridge_dev_context *dev_ctxt,
OUT u8 *host_buff, u32 dsp_addr,
u32 ul_num_bytes, u32 mem_type);
* Performs the specified relocation operation
************************************************************************* */
void dload_relocate(struct dload_state *dlthis, tgt_au_t * data,
- struct reloc_record_t *rp, bool * tramps_genereted,
+ struct reloc_record_t *rp, bool *tramps_generated,
bool second_pass)
{
rvalue val, reloc_amt, orig_val = 0;
dlthis->image_offset +
rp->vaddr);
} else
- *tramps_genereted = true;
+ *tramps_generated = true;
} else {
dload_error(dlthis, "Relocation value "
FMT_UI32 " overflows %d bits in %s"
struct hw_mmu_map_attrs_t *map_attrs);
extern hw_status hw_mmu_pte_clear(const u32 pg_tbl_va,
- u32 page_size, u32 virtual_addr);
+ u32 virtual_addr, u32 page_size);
void hw_mmu_tlb_flush_all(const void __iomem *base);
s8 c_factor,
unsigned int dw_dsp_base,
u32 ul_dsp_size,
- u32 *sgmt_id, u32 gpp_base_ba);
+ u32 *sgmt_id, u32 gpp_base_va);
/*
* ======== cmm_un_register_gppsm_seg ========
* str_zl_file != NULL
* Ensures:
*/
-extern int cod_create(OUT struct cod_manager **manager,
+extern int cod_create(OUT struct cod_manager **mgr,
char *str_zl_file,
IN OPTIONAL CONST struct cod_attrs *attrs);
extern bool symbols_reloaded;
-extern void dbll_close(struct dbll_library_obj *lib);
+extern void dbll_close(struct dbll_library_obj *zl_lib);
extern int dbll_create(struct dbll_tar_obj **target_obj,
struct dbll_attrs *pattrs);
extern void dbll_delete(struct dbll_tar_obj *target);
extern void dbll_exit(void);
-extern bool dbll_get_addr(struct dbll_library_obj *lib, char *name,
+extern bool dbll_get_addr(struct dbll_library_obj *zl_lib, char *name,
struct dbll_sym_val **sym_val);
extern void dbll_get_attrs(struct dbll_tar_obj *target,
struct dbll_attrs *pattrs);
-extern bool dbll_get_c_addr(struct dbll_library_obj *lib, char *name,
+extern bool dbll_get_c_addr(struct dbll_library_obj *zl_lib, char *name,
struct dbll_sym_val **sym_val);
extern int dbll_get_sect(struct dbll_library_obj *lib, char *name,
u32 *paddr, u32 *psize);
extern int dbll_load(struct dbll_library_obj *lib,
dbll_flags flags,
struct dbll_attrs *attrs, u32 * entry);
-extern int dbll_load_sect(struct dbll_library_obj *lib,
+extern int dbll_load_sect(struct dbll_library_obj *zl_lib,
char *sec_name, struct dbll_attrs *attrs);
extern int dbll_open(struct dbll_tar_obj *target, char *file,
dbll_flags flags,
struct dbll_library_obj **lib_obj);
extern int dbll_read_sect(struct dbll_library_obj *lib,
- char *name, char *pbuf, u32 size);
+ char *name, char *buf, u32 size);
extern void dbll_set_attrs(struct dbll_tar_obj *target,
struct dbll_attrs *pattrs);
extern void dbll_unload(struct dbll_library_obj *lib, struct dbll_attrs *attrs);
extern int disp_node_change_priority(struct disp_object
*disp_obj,
struct node_object *hnode,
- u32 ul_fxn_addr,
+ u32 rms_fxn,
nodeenv node_env, s32 prio);
/*
*/
extern int disp_node_create(struct disp_object *disp_obj,
struct node_object *hnode,
- u32 ul_fxn_addr,
+ u32 rms_fxn,
u32 ul_create_fxn,
IN CONST struct node_createargs
*pargs, OUT nodeenv *node_env);
*/
extern int disp_node_delete(struct disp_object *disp_obj,
struct node_object *hnode,
- u32 ul_fxn_addr,
+ u32 rms_fxn,
u32 ul_delete_fxn, nodeenv node_env);
/*
*/
extern int disp_node_run(struct disp_object *disp_obj,
struct node_object *hnode,
- u32 ul_fxn_addr,
+ u32 rms_fxn,
u32 ul_execute_fxn, nodeenv node_env);
#endif /* DISP_ */
* and destroy the DRV object
* Called upon driver unLoading.or unsuccesful loading of the driver.
* Parameters:
- * hdrv_obj: Handle to Driver object .
+ * driver_obj: Handle to Driver object .
* Returns:
* 0: Success.
* -EPERM: Failed to destroy DRV Object
* DRV handle.
* - Registry is updated with "0" as the DRV Object.
*/
-extern int drv_destroy(struct drv_object *hdrv_obj);
+extern int drv_destroy(struct drv_object *driver_obj);
/*
* ======== drv_exit ========
* Purpose:
* Insert a DeviceObject into the list of Driver object.
* Parameters:
- * hdrv_obj: Handle to DrvObject
+ * driver_obj: Handle to DrvObject
* hdev_obj: Handle to DeviceObject to insert.
* Returns:
* 0: If successful.
* Ensures:
* 0: Device Object is inserted and the List is not empty.
*/
-extern int drv_insert_dev_object(struct drv_object *hdrv_obj,
+extern int drv_insert_dev_object(struct drv_object *driver_obj,
struct dev_object *hdev_obj);
/*
* Search for and remove a Device object from the given list of Device Obj
* objects.
* Parameters:
- * hdrv_obj: Handle to DrvObject
+ * driver_obj: Handle to DrvObject
* hdev_obj: Handle to DevObject to Remove
* Returns:
* 0: Success.
* Ensures:
* List either does not exist (NULL), or is not empty if it does exist.
*/
-extern int drv_remove_dev_object(struct drv_object *hdrv_obj,
+extern int drv_remove_dev_object(struct drv_object *driver_obj,
struct dev_object *hdev_obj);
/*
extern int bridge_msg_create_queue(struct msg_mgr *hmsg_mgr,
OUT struct msg_queue **msgq,
- u32 msgq_id, u32 max_msgs, void *h);
+ u32 msgq_id, u32 max_msgs, void *arg);
extern void bridge_msg_delete(struct msg_mgr *hmsg_mgr);
* pchnl != NULL
* Ensures:
*/
-extern void io_request_chnl(struct io_mgr *hio_mgr,
+extern void io_request_chnl(struct io_mgr *io_manager,
struct chnl_object *pchnl,
u8 io_mode, OUT u16 *mbx_val);
* pchnl != NULL
* Ensures:
*/
-extern void iosm_schedule(struct io_mgr *hio_mgr);
+extern void iosm_schedule(struct io_mgr *io_manager);
/*
* DSP-DMA IO functions
* Details:
* DCD Dll is loaded and MGR Object stores the handle of the DLL.
*/
-extern int mgr_create(OUT struct mgr_object **hmgr_obj,
+extern int mgr_create(OUT struct mgr_object **mgr_obj,
struct cfg_devnode *dev_node_obj);
/*
* This function Calls bridge_dev_ctrl.
*/
extern int proc_ctrl(void *hprocessor,
- u32 dw_cmd, IN struct dsp_cbdata *pargs);
+ u32 dw_cmd, IN struct dsp_cbdata *arg);
/*
* ======== proc_detach ========
* Ensures:
* Details:
*/
-extern int proc_get_processor_id(void *hprocessor, u32 * proc_id);
+extern int proc_get_processor_id(void *proc, u32 * proc_id);
/*
* ======== proc_get_trace ========
extern int drv_insert_proc_context(struct drv_object *driver_obj,
void *process_ctxt);
-extern int drv_remove_all_dmm_res_elements(void *ctxt);
+extern int drv_remove_all_dmm_res_elements(void *process_ctxt);
-extern int drv_remove_all_node_res_elements(void *ctxt);
+extern int drv_remove_all_node_res_elements(void *process_ctxt);
extern int drv_proc_set_pid(void *ctxt, s32 process);
-extern int drv_remove_all_resources(void *pctxt);
+extern int drv_remove_all_resources(void *process_ctxt);
extern int drv_remove_proc_context(struct drv_object *driver_obj,
void *pr_ctxt);
-extern int drv_get_node_res_element(void *hnode, void *node_res,
- void *ctxt);
+extern int drv_get_node_res_element(void *hnode, void *node_resource,
+ void *process_ctx);
-extern int drv_insert_node_res_element(void *hnode, void *node_res,
- void *ctxt);
+extern int drv_insert_node_res_element(void *hnode, void *node_resource,
+ void *process_ctxt);
extern void drv_proc_node_update_heap_status(void *node_resource, s32 status);
-extern int drv_remove_node_res_element(void *node_res, void *status);
+extern int drv_remove_node_res_element(void *node_resource,
+ void *process_ctxt);
extern void drv_proc_node_update_status(void *node_resource, s32 status);
-extern int drv_proc_update_strm_res(u32 num_bufs, void *strm_res);
+extern int drv_proc_update_strm_res(u32 num_bufs, void *strm_resources);
extern int drv_proc_insert_strm_res_element(void *stream_obj,
void *strm_res,
- void *pctxt);
+ void *process_ctxt);
-extern int drv_get_strm_res_element(void *stream_obj, void *strm_res,
- void *ctxt);
+extern int drv_get_strm_res_element(void *stream_obj, void *strm_resources,
+ void *process_ctxt);
extern int drv_proc_remove_strm_res_element(void *strm_res,
- void *ctxt);
+ void *process_ctxt);
-extern int drv_remove_all_strm_res_elements(void *ctxt);
+extern int drv_remove_all_strm_res_elements(void *process_ctxt);
extern enum node_state node_get_state(void *hnode);
* Ensures:
*/
extern int rmm_alloc(struct rmm_target_obj *target, u32 segid, u32 size,
- u32 align, u32 *dsp_adr, bool reserve);
+ u32 align, u32 *dsp_address, bool reserve);
/*
* ======== rmm_create ========
* reserve || [dsp_address, dsp_address + size] is a valid memory range.
* Ensures:
*/
-extern bool rmm_free(struct rmm_target_obj *target, u32 segid, u32 dsp_address,
+extern bool rmm_free(struct rmm_target_obj *target, u32 segid, u32 dsp_addr,
u32 size, bool reserved);
/*
static struct cmm_mnode *get_node(struct cmm_object *cmm_mgr_obj, u32 dw_pa,
u32 dw_va, u32 ul_size);
/* get available slot for new allocator */
-static s32 get_slot(struct cmm_object *hcmm_mgr);
+static s32 get_slot(struct cmm_object *cmm_mgr_obj);
static void un_register_gppsm_seg(struct cmm_allocator *psma);
/*
u32 dw_gpp_base_pa, u32 ul_size,
u32 dsp_addr_offset, s8 c_factor,
u32 dw_dsp_base, u32 ul_dsp_size,
- u32 *sgmt_id, u32 dw_gpp_base_va)
+ u32 *sgmt_id, u32 gpp_base_va)
{
struct cmm_object *cmm_mgr_obj = (struct cmm_object *)hcmm_mgr;
struct cmm_allocator *psma = NULL;
DBC_REQUIRE(ul_size > 0);
DBC_REQUIRE(sgmt_id != NULL);
DBC_REQUIRE(dw_gpp_base_pa != 0);
- DBC_REQUIRE(dw_gpp_base_va != 0);
+ DBC_REQUIRE(gpp_base_va != 0);
DBC_REQUIRE((c_factor <= CMM_ADDTODSPPA) &&
(c_factor >= CMM_SUBFROMDSPPA));
dev_dbg(bridge, "%s: dw_gpp_base_pa %x ul_size %x dsp_addr_offset %x "
- "dw_dsp_base %x ul_dsp_size %x dw_gpp_base_va %x\n", __func__,
+ "dw_dsp_base %x ul_dsp_size %x gpp_base_va %x\n", __func__,
dw_gpp_base_pa, ul_size, dsp_addr_offset, dw_dsp_base,
- ul_dsp_size, dw_gpp_base_va);
+ ul_dsp_size, gpp_base_va);
if (!hcmm_mgr) {
status = -EFAULT;
return status;
psma->hcmm_mgr = hcmm_mgr; /* ref to parent */
psma->shm_base = dw_gpp_base_pa; /* SM Base phys */
psma->ul_sm_size = ul_size; /* SM segment size in bytes */
- psma->dw_vm_base = dw_gpp_base_va;
+ psma->dw_vm_base = gpp_base_va;
psma->dw_dsp_phys_addr_offset = dsp_addr_offset;
psma->c_factor = c_factor;
psma->dw_dsp_base = dw_dsp_base;
* dynamically loaded object files.
*
*/
-int cod_create(OUT struct cod_manager **mgr, char *str_dummy_file,
+int cod_create(OUT struct cod_manager **mgr, char *str_zl_file,
IN OPTIONAL CONST struct cod_attrs *attrs)
{
struct cod_manager *mgr_new;
* Purpose:
* Delete a code manager object.
*/
-void cod_delete(struct cod_manager *hmgr)
+void cod_delete(struct cod_manager *cod_mgr_obj)
{
DBC_REQUIRE(refs > 0);
- DBC_REQUIRE(IS_VALID(hmgr));
+ DBC_REQUIRE(IS_VALID(cod_mgr_obj));
- if (hmgr->base_lib) {
- if (hmgr->loaded)
- hmgr->fxns.unload_fxn(hmgr->base_lib, &hmgr->attrs);
+ if (cod_mgr_obj->base_lib) {
+ if (cod_mgr_obj->loaded)
+ cod_mgr_obj->fxns.unload_fxn(cod_mgr_obj->base_lib,
+ &cod_mgr_obj->attrs);
- hmgr->fxns.close_fxn(hmgr->base_lib);
+ cod_mgr_obj->fxns.close_fxn(cod_mgr_obj->base_lib);
}
- if (hmgr->target) {
- hmgr->fxns.delete_fxn(hmgr->target);
- hmgr->fxns.exit_fxn();
+ if (cod_mgr_obj->target) {
+ cod_mgr_obj->fxns.delete_fxn(cod_mgr_obj->target);
+ cod_mgr_obj->fxns.exit_fxn();
}
- hmgr->ul_magic = ~MAGIC;
- kfree(hmgr);
+ cod_mgr_obj->ul_magic = ~MAGIC;
+ kfree(cod_mgr_obj);
}
/*
* C symbol.
*
*/
-int cod_get_sym_value(struct cod_manager *hmgr, char *str_sym,
+int cod_get_sym_value(struct cod_manager *cod_mgr_obj, char *str_sym,
u32 *pul_value)
{
struct dbll_sym_val *dbll_sym;
DBC_REQUIRE(refs > 0);
- DBC_REQUIRE(IS_VALID(hmgr));
+ DBC_REQUIRE(IS_VALID(cod_mgr_obj));
DBC_REQUIRE(str_sym != NULL);
DBC_REQUIRE(pul_value != NULL);
- dev_dbg(bridge, "%s: hmgr: %p str_sym: %s pul_value: %p\n",
- __func__, hmgr, str_sym, pul_value);
- if (hmgr->base_lib) {
- if (!hmgr->fxns.
- get_addr_fxn(hmgr->base_lib, str_sym, &dbll_sym)) {
- if (!hmgr->fxns.
- get_c_addr_fxn(hmgr->base_lib, str_sym, &dbll_sym))
+ dev_dbg(bridge, "%s: cod_mgr_obj: %p str_sym: %s pul_value: %p\n",
+ __func__, cod_mgr_obj, str_sym, pul_value);
+ if (cod_mgr_obj->base_lib) {
+ if (!cod_mgr_obj->fxns.
+ get_addr_fxn(cod_mgr_obj->base_lib, str_sym, &dbll_sym)) {
+ if (!cod_mgr_obj->fxns.
+ get_c_addr_fxn(cod_mgr_obj->base_lib, str_sym,
+ &dbll_sym))
return -ESPIPE;
}
} else {
* recalculated to reflect this. In this way, we can support NULL
* terminating args arrays, if num_argc is very large.
*/
-int cod_load_base(struct cod_manager *hmgr, u32 num_argc, char *args[],
+int cod_load_base(struct cod_manager *cod_mgr_obj, u32 num_argc, char *args[],
cod_writefxn pfn_write, void *arb, char *envp[])
{
dbll_flags flags;
u32 i;
DBC_REQUIRE(refs > 0);
- DBC_REQUIRE(IS_VALID(hmgr));
+ DBC_REQUIRE(IS_VALID(cod_mgr_obj));
DBC_REQUIRE(num_argc > 0);
DBC_REQUIRE(args != NULL);
DBC_REQUIRE(args[0] != NULL);
DBC_REQUIRE(pfn_write != NULL);
- DBC_REQUIRE(hmgr->base_lib != NULL);
+ DBC_REQUIRE(cod_mgr_obj->base_lib != NULL);
/*
* Make sure every argv[] stated in argc has a value, or change argc to
}
/* set the write function for this operation */
- hmgr->fxns.get_attrs_fxn(hmgr->target, &save_attrs);
+ cod_mgr_obj->fxns.get_attrs_fxn(cod_mgr_obj->target, &save_attrs);
new_attrs = save_attrs;
new_attrs.write = (dbll_write_fxn) pfn_write;
/* Load the image */
flags = DBLL_CODE | DBLL_DATA | DBLL_SYMB;
- status = hmgr->fxns.load_fxn(hmgr->base_lib, flags, &new_attrs,
- &hmgr->ul_entry);
+ status = cod_mgr_obj->fxns.load_fxn(cod_mgr_obj->base_lib, flags,
+ &new_attrs,
+ &cod_mgr_obj->ul_entry);
if (DSP_FAILED(status))
- hmgr->fxns.close_fxn(hmgr->base_lib);
+ cod_mgr_obj->fxns.close_fxn(cod_mgr_obj->base_lib);
if (DSP_SUCCEEDED(status))
- hmgr->loaded = true;
+ cod_mgr_obj->loaded = true;
else
- hmgr->base_lib = NULL;
+ cod_mgr_obj->base_lib = NULL;
return status;
}
static void dof_close(struct dbll_library_obj *zl_lib);
static int dof_open(struct dbll_library_obj *zl_lib);
static s32 no_op(struct dynamic_loader_initialize *thisptr, void *bufr,
- ldr_addr locn, struct ldr_section_info *info, unsigned bytsiz);
+ ldr_addr locn, struct ldr_section_info *info,
+ unsigned bytsize);
/*
* Functions called by dynamic loader
static int connect(struct dynamic_loader_initialize *this);
static int read_mem(struct dynamic_loader_initialize *this, void *buf,
ldr_addr addr, struct ldr_section_info *info,
- unsigned nbytes);
+ unsigned bytes);
static int write_mem(struct dynamic_loader_initialize *this, void *buf,
ldr_addr addr, struct ldr_section_info *info,
unsigned nbytes);
static int fill_mem(struct dynamic_loader_initialize *this, ldr_addr addr,
- struct ldr_section_info *info, unsigned nbytes,
+ struct ldr_section_info *info, unsigned bytes,
unsigned val);
static int execute(struct dynamic_loader_initialize *this, ldr_addr start);
static void release(struct dynamic_loader_initialize *this);
/* symbol table hash functions */
-static u16 name_hash(void *name, u16 max_bucket);
-static bool name_match(void *name, void *sp);
-static void sym_delete(void *sp);
+static u16 name_hash(void *key, u16 max_bucket);
+static bool name_match(void *key, void *sp);
+static void sym_delete(void *value);
static u32 refs; /* module reference count */
* Get the content of a COFF section.
*/
int dbll_read_sect(struct dbll_library_obj *lib, char *name,
- char *content, u32 size)
+ char *buf, u32 size)
{
struct dbll_library_obj *zl_lib = (struct dbll_library_obj *)lib;
bool opened_doff = false;
DBC_REQUIRE(refs > 0);
DBC_REQUIRE(zl_lib);
DBC_REQUIRE(name != NULL);
- DBC_REQUIRE(content != NULL);
+ DBC_REQUIRE(buf != NULL);
DBC_REQUIRE(size != 0);
/* If DOFF file is not open, we open it. */
}
/*
* Ensure the supplied buffer size is sufficient to store
- * the section content to be read.
+ * the section buf to be read.
*/
ul_sect_size = sect->size * byte_size;
/* Make sure size is even for good swap */
if (ul_sect_size > size) {
status = -EPERM;
} else {
- if (!dload_get_section(zl_lib->desc, sect, content))
+ if (!dload_get_section(zl_lib->desc, sect, buf))
status = -EBADF;
}
opened_doff = false;
}
- dev_dbg(bridge, "%s: lib: %p name: %s content: %p size: 0x%x, "
- "status 0x%x\n", __func__, lib, name, content, size, status);
+ dev_dbg(bridge, "%s: lib: %p name: %s buf: %p size: 0x%x, "
+ "status 0x%x\n", __func__, lib, name, buf, size, status);
return status;
}
/*
* ======== name_match ========
*/
-static bool name_match(void *key, void *value)
+static bool name_match(void *key, void *sp)
{
DBC_REQUIRE(key != NULL);
- DBC_REQUIRE(value != NULL);
+ DBC_REQUIRE(sp != NULL);
- if ((key != NULL) && (value != NULL)) {
- if (strcmp((char *)key, ((struct dbll_symbol *)value)->name) ==
+ if ((key != NULL) && (sp != NULL)) {
+ if (strcmp((char *)key, ((struct dbll_symbol *)sp)->name) ==
0)
return true;
}
* Purpose:
* Returns a region containing the specified memory region
*/
-static struct map_page *get_region(u32 addrs)
+static struct map_page *get_region(u32 addr)
{
struct map_page *curr_region = NULL;
u32 i = 0;
if (virtual_mapping_table != NULL) {
/* find page mapped by this address */
- i = DMM_ADDR_TO_INDEX(addrs);
+ i = DMM_ADDR_TO_INDEX(addr);
if (i < table_size)
curr_region = virtual_mapping_table + i;
}
/* Allocate the STRM resource element
* This is called after the actual resource is allocated
*/
-int drv_proc_insert_strm_res_element(void *stream_handle,
- void *hstrm_res, void *process_ctxt)
+int drv_proc_insert_strm_res_element(void *stream_obj,
+ void *strm_res, void *process_ctxt)
{
struct strm_res_object **pstrm_res =
- (struct strm_res_object **)hstrm_res;
+ (struct strm_res_object **)strm_res;
struct process_context *ctxt = (struct process_context *)process_ctxt;
int status = 0;
struct strm_res_object *temp_strm_res = NULL;
kfree(*pstrm_res);
return -EPERM;
}
- (*pstrm_res)->hstream = stream_handle;
+ (*pstrm_res)->hstream = stream_obj;
if (ctxt->pstrm_list != NULL) {
temp_strm_res = ctxt->pstrm_list;
while (temp_strm_res->next != NULL)
/* Release Stream resource element context
* This function called after the actual resource is freed
*/
-int drv_proc_remove_strm_res_element(void *hstrm_res, void *process_ctxt)
+int drv_proc_remove_strm_res_element(void *strm_res, void *process_ctxt)
{
- struct strm_res_object *pstrm_res = (struct strm_res_object *)hstrm_res;
+ struct strm_res_object *pstrm_res = (struct strm_res_object *)strm_res;
struct process_context *ctxt = (struct process_context *)process_ctxt;
struct strm_res_object *temp_strm_res;
int status = 0;
}
/* Getting the stream resource element */
-int drv_get_strm_res_element(void *stream_obj, void *hstrm_res,
+int drv_get_strm_res_element(void *stream_obj, void *strm_resources,
void *process_ctxt)
{
struct strm_res_object **strm_res =
- (struct strm_res_object **)hstrm_res;
+ (struct strm_res_object **)strm_resources;
struct process_context *ctxt = (struct process_context *)process_ctxt;
int status = 0;
struct strm_res_object *temp_strm2 = NULL;
}
/* Updating the stream resource element */
-int drv_proc_update_strm_res(u32 num_bufs, void *hstrm_res)
+int drv_proc_update_strm_res(u32 num_bufs, void *strm_resources)
{
int status = 0;
struct strm_res_object **strm_res =
- (struct strm_res_object **)hstrm_res;
+ (struct strm_res_object **)strm_resources;
(*strm_res)->num_bufs = num_bufs;
return status;
/* Prototypes for all functions in this bridge */
static int __init bridge_init(void); /* Initialize bridge */
static void __exit bridge_exit(void); /* Opposite of initialize */
-static int bridge_open(struct inode *, struct file *); /* Open */
-static int bridge_release(struct inode *, struct file *); /* Release */
-static long bridge_ioctl(struct file *, unsigned int, unsigned long);
+static int bridge_open(struct inode *ip, struct file *filp); /* Open */
+static int bridge_release(struct inode *ip, struct file *filp); /* Release */
+static long bridge_ioctl(struct file *filp, unsigned int code,
+ unsigned long args);
static int bridge_mmap(struct file *filp, struct vm_area_struct *vma);
#endif /* ifndef _DRV_INTERFACE_H_ */
* ======== dsp_deinit ========
* Frees the resources allocated for bridge.
*/
-bool dsp_deinit(u32 device_ctxt)
+bool dsp_deinit(u32 device_context)
{
bool ret = true;
u32 device_node;
(void)dev_remove_device((struct cfg_devnode *)device_node);
(void)drv_release_resources((u32) device_node,
- (struct drv_object *)device_ctxt);
+ (struct drv_object *)device_context);
}
- (void)drv_destroy((struct drv_object *)device_ctxt);
+ (void)drv_destroy((struct drv_object *)device_context);
/* Get the Manager Object from Registry
* MGR Destroy will unload the DCD dll */
enum nldr_phase phase, u16 depth);
static int load_ovly(struct nldr_nodeobject *nldr_node_obj,
enum nldr_phase phase);
-static int remote_alloc(void **ref, u16 mem_sect_type, u32 size,
+static int remote_alloc(void **ref, u16 mem_sect, u32 size,
u32 align, u32 *dsp_address,
OPTIONAL s32 segmnt_id,
OPTIONAL s32 req, bool reserve);
* libraries.
*/
static bool get_symbol_value(void *handle, void *parg, void *rmm_handle,
- char *name, struct dbll_sym_val **sym)
+ char *sym_name, struct dbll_sym_val **sym)
{
struct nldr_object *nldr_obj = (struct nldr_object *)handle;
struct nldr_nodeobject *nldr_node_obj =
bool status = false;
/* check the base image */
- status = nldr_obj->ldr_fxns.get_addr_fxn(nldr_obj->base_lib, name, sym);
+ status = nldr_obj->ldr_fxns.get_addr_fxn(nldr_obj->base_lib,
+ sym_name, sym);
if (!status)
status =
- nldr_obj->ldr_fxns.get_c_addr_fxn(nldr_obj->base_lib, name,
- sym);
+ nldr_obj->ldr_fxns.get_c_addr_fxn(nldr_obj->base_lib,
+ sym_name, sym);
/*
* Check in root lib itself. If the library consists of
* library may need to be resolved.
*/
if (!status) {
- status = nldr_obj->ldr_fxns.get_addr_fxn(root->lib, name, sym);
+ status = nldr_obj->ldr_fxns.get_addr_fxn(root->lib, sym_name,
+ sym);
if (!status) {
status =
- nldr_obj->ldr_fxns.get_c_addr_fxn(root->lib, name,
- sym);
+ nldr_obj->ldr_fxns.get_c_addr_fxn(root->lib,
+ sym_name, sym);
}
}
if (!status) {
for (i = 0; i < root->dep_libs; i++) {
status =
- nldr_obj->ldr_fxns.get_addr_fxn(root->dep_libs_tree
- [i].lib, name, sym);
+ nldr_obj->ldr_fxns.get_addr_fxn(root->
+ dep_libs_tree
+ [i].lib,
+ sym_name, sym);
if (!status) {
status =
nldr_obj->ldr_fxns.
get_c_addr_fxn(root->dep_libs_tree[i].lib,
- name, sym);
+ sym_name, sym);
}
if (status) {
/* Symbol found */
status =
nldr_obj->ldr_fxns.
get_addr_fxn(nldr_node_obj->pers_lib_table[i].lib,
- name, sym);
+ sym_name, sym);
if (!status) {
status = nldr_obj->ldr_fxns.get_c_addr_fxn
- (nldr_node_obj->pers_lib_table[i].lib, name,
- sym);
+ (nldr_node_obj->pers_lib_table[i].lib,
+ sym_name, sym);
}
if (status) {
/* Symbol found */
/*
* ======== remote_alloc ========
*/
-static int remote_alloc(void **ref, u16 space, u32 size,
+static int remote_alloc(void **ref, u16 mem_sect, u32 size,
u32 align, u32 *dsp_address,
OPTIONAL s32 segmnt_id, OPTIONAL s32 req,
bool reserve)
bool mem_load_req = false;
int status = -ENOMEM; /* Set to fail */
DBC_REQUIRE(hnode);
- DBC_REQUIRE(space == DBLL_CODE || space == DBLL_DATA ||
- space == DBLL_BSS);
+ DBC_REQUIRE(mem_sect == DBLL_CODE || mem_sect == DBLL_DATA ||
+ mem_sect == DBLL_BSS);
nldr_obj = hnode->nldr_obj;
rmm = nldr_obj->rmm;
/* Convert size to DSP words */
DBC_ASSERT(false);
break;
}
- if (space == DBLL_CODE)
+ if (mem_sect == DBLL_CODE)
mem_phase_bit++;
if (mem_phase_bit < MAXFLAGS)
mem_load_req = true;
}
- mem_sect_type = (space == DBLL_CODE) ? DYNM_CODE : DYNM_DATA;
+ mem_sect_type = (mem_sect == DBLL_CODE) ? DYNM_CODE : DYNM_DATA;
- /* Find an appropriate segment based on space */
+ /* Find an appropriate segment based on mem_sect */
if (segid == NULLID) {
/* No memory requirements of preferences */
DBC_ASSERT(!mem_load_req);
* Retrieve a message from a node on the DSP.
*/
int node_get_message(struct node_object *hnode,
- OUT struct dsp_msg *pmsg, u32 utimeout)
+ OUT struct dsp_msg *message, u32 utimeout)
{
struct node_mgr *hnode_mgr;
enum node_type node_type;
struct proc_object *hprocessor;
DBC_REQUIRE(refs > 0);
- DBC_REQUIRE(pmsg != NULL);
+ DBC_REQUIRE(message != NULL);
if (!hnode) {
status = -EFAULT;
* available. */
intf_fxns = hnode_mgr->intf_fxns;
status =
- (*intf_fxns->pfn_msg_get) (hnode->msg_queue_obj, pmsg, utimeout);
+ (*intf_fxns->pfn_msg_get) (hnode->msg_queue_obj, message, utimeout);
/* Check if message contains SM descriptor */
- if (DSP_FAILED(status) || !(pmsg->dw_cmd & DSP_RMSBUFDESC))
+ if (DSP_FAILED(status) || !(message->dw_cmd & DSP_RMSBUFDESC))
goto func_end;
/* Translate DSP byte addr to GPP Va. */
tmp_buf = cmm_xlator_translate(hnode->xlator,
- (void *)(pmsg->dw_arg1 *
+ (void *)(message->dw_arg1 *
hnode->hnode_mgr->
udsp_word_size), CMM_DSPPA2PA);
if (tmp_buf != NULL) {
CMM_PA2VA);
if (tmp_buf != NULL) {
/* Adjust SM size in msg */
- pmsg->dw_arg1 = (u32) tmp_buf;
- pmsg->dw_arg2 *= hnode->hnode_mgr->udsp_word_size;
+ message->dw_arg1 = (u32) tmp_buf;
+ message->dw_arg2 *= hnode->hnode_mgr->udsp_word_size;
} else {
status = -ESRCH;
}
status = -ESRCH;
}
func_end:
- dev_dbg(bridge, "%s: hnode: %p pmsg: %p utimeout: 0x%x\n", __func__,
- hnode, pmsg, utimeout);
+ dev_dbg(bridge, "%s: hnode: %p message: %p utimeout: 0x%x\n", __func__,
+ hnode, message, utimeout);
return status;
}
DEFINE_MUTEX(proc_lock); /* For critical sections */
/* ----------------------------------- Function Prototypes */
-static int proc_monitor(struct proc_object *hprocessor);
+static int proc_monitor(struct proc_object *proc_obj);
static s32 get_envp_count(char **envp);
static char **prepend_envp(char **new_envp, char **envp, s32 envp_elems,
s32 cnew_envp, char *sz_var);
* Ensures:
* Success: ProcObject state is PROC_IDLE
*/
-static int proc_monitor(struct proc_object *p_proc_object)
+static int proc_monitor(struct proc_object *proc_obj)
{
int status = -EPERM;
struct msg_mgr *hmsg_mgr;
int brd_state;
DBC_REQUIRE(refs > 0);
- DBC_REQUIRE(p_proc_object);
+ DBC_REQUIRE(proc_obj);
/* This is needed only when Device is loaded when it is
* already 'ACTIVE' */
/* Destory the Node Manager, msg_ctrl Manager */
- if (DSP_SUCCEEDED(dev_destroy2(p_proc_object->hdev_obj))) {
+ if (DSP_SUCCEEDED(dev_destroy2(proc_obj->hdev_obj))) {
/* Destroy the msg_ctrl by calling msg_delete */
- dev_get_msg_mgr(p_proc_object->hdev_obj, &hmsg_mgr);
+ dev_get_msg_mgr(proc_obj->hdev_obj, &hmsg_mgr);
if (hmsg_mgr) {
msg_delete(hmsg_mgr);
- dev_set_msg_mgr(p_proc_object->hdev_obj, NULL);
+ dev_set_msg_mgr(proc_obj->hdev_obj, NULL);
}
}
/* Place the Board in the Monitor State */
- if (DSP_SUCCEEDED((*p_proc_object->intf_fxns->pfn_brd_monitor)
- (p_proc_object->hbridge_context))) {
+ if (DSP_SUCCEEDED((*proc_obj->intf_fxns->pfn_brd_monitor)
+ (proc_obj->hbridge_context))) {
status = 0;
- if (DSP_SUCCEEDED((*p_proc_object->intf_fxns->pfn_brd_status)
- (p_proc_object->hbridge_context, &brd_state)))
+ if (DSP_SUCCEEDED((*proc_obj->intf_fxns->pfn_brd_status)
+ (proc_obj->hbridge_context, &brd_state)))
DBC_ASSERT(brd_state == BRD_IDLE);
}
/*
* ======== rmm_free ========
*/
-bool rmm_free(struct rmm_target_obj *target, u32 segid, u32 addr, u32 size,
+bool rmm_free(struct rmm_target_obj *target, u32 segid, u32 dsp_addr, u32 size,
bool reserved)
{
struct rmm_ovly_sect *sect;
DBC_REQUIRE(target);
DBC_REQUIRE(reserved || segid < target->num_segs);
- DBC_REQUIRE(reserved || (addr >= target->seg_tab[segid].base &&
- (addr + size) <= (target->seg_tab[segid].base +
+ DBC_REQUIRE(reserved || (dsp_addr >= target->seg_tab[segid].base &&
+ (dsp_addr + size) <= (target->seg_tab[segid].
+ base +
target->seg_tab[segid].
length)));
* Free or unreserve memory.
*/
if (!reserved) {
- ret = free_block(target, segid, addr, size);
+ ret = free_block(target, segid, dsp_addr, size);
if (ret)
target->seg_tab[segid].number--;
/* Unreserve memory */
sect = (struct rmm_ovly_sect *)lst_first(target->ovly_list);
while (sect != NULL) {
- if (addr == sect->addr) {
+ if (dsp_addr == sect->addr) {
DBC_ASSERT(size == sect->size);
/* Remove from list */
lst_remove_elem(target->ovly_list,
* Purpose:
* Retreive the default executable, if any, for this board.
*/
-int cfg_get_exec_file(struct cfg_devnode *dev_node_obj, u32 ul_buf_size,
+int cfg_get_exec_file(struct cfg_devnode *dev_node_obj, u32 buf_size,
OUT char *str_exec_file)
{
int status = 0;
else if (!str_exec_file || !drv_datap)
status = -EFAULT;
- if (strlen(drv_datap->base_img) > ul_buf_size)
+ if (strlen(drv_datap->base_img) > buf_size)
status = -EINVAL;
if (DSP_SUCCEEDED(status) && drv_datap->base_img)
if (DSP_FAILED(status))
pr_err("%s: Failed, status 0x%x\n", __func__, status);
DBC_ENSURE(((status == 0) &&
- (strlen(str_exec_file) <= ul_buf_size))
+ (strlen(str_exec_file) <= buf_size))
|| (status != 0));
return status;
}