• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/staging/tidspbridge/dynload/

Lines Matching defs:dlthis

30 static int priv_tramp_sect_tgt_alloc(struct dload_state *dlthis)
39 sect_info = &dlthis->ldr_sections[dlthis->allocated_secn_count];
41 sect_info->name = dlthis->tramp.final_string_table;
42 sect_info->size = dlthis->tramp.tramp_sect_next_addr;
49 ret_val = dlthis->myalloc->dload_allocate(dlthis->myalloc,
55 dload_error(dlthis, "Failed to allocate target memory for"
130 static struct tramp_string *priv_tramp_string_create(struct dload_state *dlthis,
138 (struct tramp_string *)dlthis->mysym->dload_allocate(dlthis->mysym,
153 new_string->index = dlthis->tramp.tramp_string_next_index;
154 dlthis->tramp.tramp_string_next_index++;
155 dlthis->tramp.tramp_string_size += str_len + 1;
158 if (dlthis->tramp.string_head == NULL)
159 dlthis->tramp.string_head = new_string;
161 dlthis->tramp.string_tail->next = new_string;
163 dlthis->tramp.string_tail = new_string;
178 static struct tramp_string *priv_tramp_string_find(struct dload_state *dlthis,
186 for (cur_str = dlthis->tramp.string_head;
215 static int priv_string_tbl_finalize(struct dload_state *dlthis)
225 dlthis->tramp.final_string_table =
226 (char *)dlthis->mysym->dload_allocate(dlthis->mysym,
227 dlthis->tramp.
229 if (dlthis->tramp.final_string_table != NULL) {
232 cur_loc = dlthis->tramp.final_string_table;
233 cur_string = dlthis->tramp.string_head;
236 dlthis->tramp.string_head = cur_string->next;
237 if (dlthis->tramp.string_tail == cur_string)
238 dlthis->tramp.string_tail = NULL;
251 dlthis->mysym->dload_deallocate(dlthis->mysym,
255 cur_string = dlthis->tramp.string_head;
261 dload_error(dlthis, "Failed to allocate trampoline "
274 static u32 priv_tramp_sect_alloc(struct dload_state *dlthis, u32 tramp_size)
280 if (dlthis->tramp.tramp_sect_next_addr == 0) {
281 dload_syms_error(dlthis->mysym, "*** WARNING *** created "
283 dlthis->str_head);
287 ret_val = dlthis->tramp.tramp_sect_next_addr;
288 dlthis->tramp.tramp_sect_next_addr += tramp_size;
299 static struct tramp_sym *priv_tramp_sym_create(struct dload_state *dlthis,
308 (struct tramp_sym *)dlthis->mysym->dload_allocate(dlthis->mysym,
316 new_sym->index = dlthis->tramp.tramp_sym_next_index;
317 dlthis->tramp.tramp_sym_next_index++;
328 if (dlthis->tramp.symbol_head == NULL)
329 dlthis->tramp.symbol_head = new_sym;
331 dlthis->tramp.symbol_tail->next = new_sym;
333 dlthis->tramp.symbol_tail = new_sym;
345 static struct tramp_sym *priv_tramp_sym_get(struct dload_state *dlthis,
351 for (sym_found = dlthis->tramp.symbol_head;
366 static struct tramp_sym *priv_tramp_sym_find(struct dload_state *dlthis,
374 str_found = priv_tramp_string_find(dlthis, string);
376 sym_found = priv_tramp_sym_get(dlthis, str_found->index);
388 static int priv_tramp_sym_finalize(struct dload_state *dlthis)
393 &dlthis->ldr_sections[dlthis->allocated_secn_count];
398 dlthis->tramp.final_sym_table =
399 (struct local_symbol *)dlthis->mysym->dload_allocate(dlthis->mysym,
400 (sizeof(struct local_symbol) * dlthis->tramp.
402 if (dlthis->tramp.final_sym_table != NULL) {
406 new_sym = dlthis->tramp.final_sym_table;
407 cur_sym = dlthis->tramp.symbol_head;
410 dlthis->tramp.symbol_head = cur_sym->next;
411 if (cur_sym == dlthis->tramp.symbol_tail)
412 dlthis->tramp.symbol_tail = NULL;
431 dlthis->mysym->dload_deallocate(dlthis->mysym, cur_sym);
434 cur_sym = dlthis->tramp.symbol_head;
440 dload_error(dlthis, "Failed to alloc trampoline sym table");
452 static int priv_tgt_img_gen(struct dload_state *dlthis, u32 base,
465 (struct tramp_img_pkt *)dlthis->mysym->dload_allocate(dlthis->mysym,
488 new_img_pkt->next = dlthis->tramp.tramp_pkts;
489 dlthis->tramp.tramp_pkts = new_img_pkt;
506 static int priv_pkt_relo(struct dload_state *dlthis, tgt_au_t * data,
517 dload_relocate(dlthis, data, rp[i], &tmp, true);
531 static int priv_tramp_pkt_finalize(struct dload_state *dlthis)
540 &dlthis->ldr_sections[dlthis->allocated_secn_count];
545 cur_pkt = dlthis->tramp.tramp_pkts;
548 dlthis->tramp.tramp_pkts = cur_pkt->next;
551 dlthis->image_secn = sect_info;
552 dlthis->image_offset = cur_pkt->base;
553 dlthis->delta_runaddr = sect_info->run_addr;
561 dload_syms_error(dlthis->mysym,
564 dlthis->image_offset,
565 dlthis->
576 ret_val = priv_pkt_relo(dlthis,
580 dload_error(dlthis,
595 ret_val = dlthis->myio->writemem(dlthis->myio,
604 dload_error(dlthis,
611 dlthis->mysym->dload_deallocate(dlthis->mysym, cur_pkt);
614 cur_pkt = dlthis->tramp.tramp_pkts;
631 static int priv_dup_pkt_finalize(struct dload_state *dlthis)
645 cur_pkt = dlthis->tramp.dup_pkts;
649 dlthis->tramp.dup_pkts = cur_pkt->next;
652 dlthis->image_secn = &dlthis->ldr_sections[cur_pkt->secnn];
653 dlthis->image_offset = cur_pkt->offset;
658 i = (s32) (dlthis->image_secn - dlthis->ldr_sections);
659 sect_hdr = dlthis->sect_hdrs + i;
660 dlthis->delta_runaddr = sect_hdr->ds_paddr;
674 ret_val = priv_pkt_relo(dlthis,
678 dload_error(dlthis,
681 dlthis->image_secn->run_addr);
687 dlthis->mysym->dload_deallocate(dlthis->mysym,
702 ret_val = dlthis->myio->writemem(dlthis->myio,
705 dlthis->image_secn->
708 dlthis->image_secn,
713 dload_error(dlthis,
715 dlthis->image_secn->load_addr +
719 dlthis->mysym->dload_deallocate(dlthis->mysym, cur_pkt);
722 cur_pkt = dlthis->tramp.dup_pkts;
735 static struct tramp_img_dup_pkt *priv_dup_find(struct dload_state *dlthis,
740 for (cur_pkt = dlthis->tramp.dup_pkts;
764 static int priv_img_pkt_dup(struct dload_state *dlthis,
778 dup_pkt = priv_dup_find(dlthis, secnn, image_offset);
787 dlthis->mysym->dload_allocate(dlthis->mysym, new_dup_size);
802 dup_pkt->next = dlthis->tramp.dup_pkts;
803 dlthis->tramp.dup_pkts = dup_pkt;
805 dload_error(dlthis, "Failed to create dup packet!");
823 dup_relo = dlthis->mysym->dload_allocate(dlthis->mysym,
839 dload_error(dlthis, "Unable to alloc dup relo");
850 bool dload_tramp_avail(struct dload_state *dlthis, struct reloc_record_t *rp)
873 int dload_tramp_generate(struct dload_state *dlthis, s16 secnn,
895 if (dlthis->tramp.string_head == NULL) {
896 priv_tramp_string_create(dlthis,
901 dload_syms_error(dlthis->mysym,
903 dlthis->ldr_sections[secnn].run_addr +
905 dlthis->local_symtab[rp->SYMNDX].value);
914 dlthis->ldr_sections[secnn].run_addr;
915 ext_tmp_sym.delta = dlthis->sect_hdrs[secnn].ds_paddr;
918 ref_sym = &(dlthis->local_symtab[rp->SYMNDX]);
921 new_tramp_sym = priv_tramp_sym_find(dlthis, tramp_sym_str);
926 new_tramp_str = priv_tramp_string_create(dlthis,
931 dload_error(dlthis, "Failed to create new "
937 new_tramp_base = priv_tramp_sect_alloc(dlthis,
946 new_tramp_sym = priv_tramp_sym_create(dlthis,
951 new_ext_sym = priv_tramp_sym_create(dlthis, -1,
960 ret_val = priv_tgt_img_gen(dlthis,
968 dload_error(dlthis, "Failed to "
973 dload_error(dlthis, "Failed to create "
986 ret_val = priv_img_pkt_dup(dlthis, secnn, image_offset,
989 dload_error(dlthis, "Failed to create dup of "
1008 int dload_tramp_pkt_udpate(struct dload_state *dlthis, s16 secnn,
1017 dup_pkt = priv_dup_find(dlthis, secnn, image_offset);
1025 dload_error(dlthis,
1042 int dload_tramp_finalize(struct dload_state *dlthis)
1046 if (dlthis->tramp.tramp_sect_next_addr != 0) {
1049 ret_val = priv_string_tbl_finalize(dlthis);
1054 ret_val = priv_tramp_sect_tgt_alloc(dlthis);
1059 ret_val = priv_tramp_sym_finalize(dlthis);
1065 ret_val = priv_tramp_pkt_finalize(dlthis);
1069 ret_val = priv_dup_pkt_finalize(dlthis);
1083 void dload_tramp_cleanup(struct dload_state *dlthis)
1085 struct tramp_info *tramp = &dlthis->tramp;
1103 dlthis->mysym->dload_deallocate(dlthis->mysym, cur_sym);
1107 dlthis->mysym->dload_deallocate(dlthis->mysym,
1116 dlthis->mysym->dload_deallocate(dlthis->mysym, cur_string);
1120 dlthis->mysym->dload_deallocate(dlthis->mysym,
1126 dlthis->mysym->dload_deallocate(dlthis->mysym, cur_tramp_pkt);
1137 dlthis->mysym->dload_deallocate(dlthis->mysym,
1141 dlthis->mysym->dload_deallocate(dlthis->mysym, cur_dup_pkt);