- 根目录:
- drivers
- staging
- tidspbridge
- dynload
- cload.c
#include "header.h"
#include "module_list.h"
#define LINKER_MODULES_HEADER ("_" MODULES_HEADER)
static void dload_symbols(struct dload_state *dlthis);
static void dload_data(struct dload_state *dlthis);
static void allocate_sections(struct dload_state *dlthis);
static void string_table_free(struct dload_state *dlthis);
static void symbol_table_free(struct dload_state *dlthis);
static void section_table_free(struct dload_state *dlthis);
static void init_module_handle(struct dload_state *dlthis);
#if BITS_PER_AU > BITS_PER_BYTE
static char *unpack_name(struct dload_state *dlthis, u32 soffset);
#endif
static const char cinitname[] = { ".cinit" };
static const char loader_dllview_root[] = { "?DLModules?" };
static const char readstrm[] = { "Error reading %s from input stream" };
static const char err_alloc[] = { "Syms->dload_allocate( %d ) failed" };
static const char tgtalloc[] = {
"Target memory allocate failed, section %s size " FMT_UI32 };
static const char initfail[] = { "%s to target address " FMT_UI32 " failed" };
static const char dlvwrite[] = { "Write to DLLview list failed" };
static const char iconnect[] = { "Connect call to init interface failed" };
static const char err_checksum[] = { "Checksum failed on %s" };
void dload_error(struct dload_state *dlthis, const char *errtxt, ...)
{
va_list args;
va_start(args, errtxt);
dlthis->mysym->error_report(dlthis->mysym, errtxt, args);
va_end(args);
dlthis->dload_errcount += 1;
}
#define DL_ERROR(zza, zzb) dload_error(dlthis, zza, zzb)
void dload_syms_error(struct dynamic_loader_sym *syms, const char *errtxt, ...)
{
va_list args;
va_start(args, errtxt);
syms->error_report(syms, errtxt, args);
va_end(args);
}
int dynamic_load_module(struct dynamic_loader_stream *module,
struct dynamic_loader_sym *syms,
struct dynamic_loader_allocate *alloc,
struct dynamic_loader_initialize *init,
unsigned options, void **mhandle)
{
register unsigned *dp, sz;
struct dload_state dl_state;
dp = (unsigned *)&dl_state;
for (sz = sizeof(dl_state) / sizeof(unsigned); sz > 0; sz -= 1)
*dp++ = 0;
if ((options & DLOAD_INITBSS) == DLOAD_INITBSS)
dl_state.myoptions = DLOAD_INITBSS;
if (!module || !syms) {
dload_error(&dl_state, "Required parameter is NULL");
} else {
dl_state.strm = module;
dl_state.mysym = syms;
dload_headers(&dl_state);
if (!dl_state.dload_errcount)
dload_strings(&dl_state, false);
if (!dl_state.dload_errcount)
dload_sections(&dl_state);
if (init && !dl_state.dload_errcount) {
if (init->connect(init)) {
dl_state.myio = init;
dl_state.myalloc = alloc;
allocate_sections(&dl_state);
} else
dload_error(&dl_state, iconnect);
}
if (!dl_state.dload_errcount) {
unsigned sref = dl_state.dfile_hdr.df_entry_secn - 1;
if (sref < dl_state.allocated_secn_count)
dl_state.dfile_hdr.df_entrypt +=
dl_state.ldr_sections[sref].run_addr;
dload_symbols(&dl_state);
}
if (init && !dl_state.dload_errcount)
dload_data(&dl_state);
init_module_handle(&dl_state);
if (dl_state.myio) {
if ((!dl_state.dload_errcount) &&
(dl_state.dfile_hdr.df_entry_secn != DN_UNDEF) &&
(!init->execute(init,
dl_state.dfile_hdr.df_entrypt)))
dload_error(&dl_state, "Init->Execute Failed");
init->release(init);
}
symbol_table_free(&dl_state);
section_table_free(&dl_state);
string_table_free(&dl_state);
dload_tramp_cleanup(&dl_state);
if (dl_state.dload_errcount) {
dynamic_unload_module(dl_state.myhandle, syms, alloc,
init);
dl_state.myhandle = NULL;
}
}
if (mhandle)
*mhandle = dl_state.myhandle;
return dl_state.dload_errcount;
}
int
dynamic_open_module(struct dynamic_loader_stream *module,
struct dynamic_loader_sym *syms,
struct dynamic_loader_allocate *alloc,
struct dynamic_loader_initialize *init,
unsigned options, void **mhandle)
{
register unsigned *dp, sz;
struct dload_state dl_state;
dp = (unsigned *)&dl_state;
for (sz = sizeof(dl_state) / sizeof(unsigned); sz > 0; sz -= 1)
*dp++ = 0;
if ((options & DLOAD_INITBSS) == DLOAD_INITBSS)
dl_state.myoptions = DLOAD_INITBSS;
if (!module || !syms) {
dload_error(&dl_state, "Required parameter is NULL");
} else {
dl_state.strm = module;
dl_state.mysym = syms;
dload_headers(&dl_state);
if (!dl_state.dload_errcount)
dload_strings(&dl_state, false);
if (!dl_state.dload_errcount)
dload_sections(&dl_state);
if (init && !dl_state.dload_errcount) {
if (init->connect(init)) {
dl_state.myio = init;
dl_state.myalloc = alloc;
allocate_sections(&dl_state);
} else
dload_error(&dl_state, iconnect);
}
if (!dl_state.dload_errcount) {
unsigned sref = dl_state.dfile_hdr.df_entry_secn - 1;
if (sref < dl_state.allocated_secn_count)
dl_state.dfile_hdr.df_entrypt +=
dl_state.ldr_sections[sref].run_addr;
dload_symbols(&dl_state);
}
init_module_handle(&dl_state);
if (dl_state.myio) {
if ((!dl_state.dload_errcount) &&
(dl_state.dfile_hdr.df_entry_secn != DN_UNDEF) &&
(!init->execute(init,
dl_state.dfile_hdr.df_entrypt)))
dload_error(&dl_state, "Init->Execute Failed");
init->release(init);
}
symbol_table_free(&dl_state);
section_table_free(&dl_state);
string_table_free(&dl_state);
if (dl_state.dload_errcount) {
dynamic_unload_module(dl_state.myhandle, syms, alloc,
init);
dl_state.myhandle = NULL;
}
}
if (mhandle)
*mhandle = dl_state.myhandle;
return dl_state.dload_errcount;
}
#define COMBINED_HEADER_SIZE (sizeof(struct doff_filehdr_t)+ \
sizeof(struct doff_verify_rec_t))
void dload_headers(struct dload_state *dlthis)
{
u32 map;
if (dlthis->strm->read_buffer(dlthis->strm, &dlthis->dfile_hdr,
COMBINED_HEADER_SIZE) !=
COMBINED_HEADER_SIZE) {
DL_ERROR(readstrm, "File Headers");
return;
}
map = REORDER_MAP(dlthis->dfile_hdr.df_byte_reshuffle);
if (map != REORDER_MAP(BYTE_RESHUFFLE_VALUE)) {
if ((map & 0xFCFCFCFC) == 0) {
dload_reorder(&dlthis->dfile_hdr, COMBINED_HEADER_SIZE,
map);
}
if (dlthis->dfile_hdr.df_byte_reshuffle !=
BYTE_RESHUFFLE_VALUE) {
dload_error(dlthis,
"Bad byte swap map " FMT_UI32 " in header",
dlthis->dfile_hdr.df_byte_reshuffle);
return;
}
dlthis->reorder_map = map;
}
if (~dload_checksum(&dlthis->dfile_hdr,
sizeof(struct doff_filehdr_t)) ||
~dload_checksum(&dlthis->verify,
sizeof(struct doff_verify_rec_t))) {
DL_ERROR(err_checksum, "header or verify record");
return;
}
#if HOST_ENDIANNESS
dlthis->dfile_hdr.df_byte_reshuffle = map;
#endif
if ((dlthis->dfile_hdr.df_target_id != TARGET_ID) &&
-(dlthis->dfile_hdr.df_target_id != TMS470_ID)) {
dload_error(dlthis, "Bad target ID 0x%x and TARGET_ID 0x%x",
dlthis->dfile_hdr.df_target_id, TARGET_ID);
return;
}
if ((dlthis->dfile_hdr.df_doff_version != DOFF0)) {
dload_error(dlthis, "Bad DOFF version 0x%x",
dlthis->dfile_hdr.df_doff_version);
return;
}
if (dlthis->dfile_hdr.df_strtab_size > MAX_REASONABLE_STRINGTAB) {
dload_error(dlthis, "Excessive string table size " FMT_UI32,
dlthis->dfile_hdr.df_strtab_size);
return;
}
if (dlthis->dfile_hdr.df_no_scns > MAX_REASONABLE_SECTIONS) {
dload_error(dlthis, "Excessive section count 0x%x",
dlthis->dfile_hdr.df_no_scns);
return;
}
#ifndef TARGET_ENDIANNESS
if ((dlthis->dfile_hdr.df_flags >> ALIGN_COFF_ENDIANNESS) &
dlthis->myoptions & ENDIANNESS_MASK) {
dload_error(dlthis,
"Input endianness disagrees with specified option");
return;
}
dlthis->big_e_target = dlthis->dfile_hdr.df_flags & DF_BIG;
#endif
}
static const char secn_errid[] = { "section" };
void dload_sections(struct dload_state *dlthis)
{
s16 siz;
struct doff_scnhdr_t *shp;
unsigned nsecs = dlthis->dfile_hdr.df_no_scns;
siz = nsecs * sizeof(struct doff_scnhdr_t);
shp =
(struct doff_scnhdr_t *)dlthis->mysym->dload_allocate(dlthis->mysym,
siz);
if (!shp) {
DL_ERROR(err_alloc, siz);
return;
}
dlthis->sect_hdrs = shp;
if (dlthis->strm->read_buffer(dlthis->strm, shp, siz) != siz) {
DL_ERROR(readstrm, secn_errid);
return;
}
if (dlthis->reorder_map)
dload_reorder(shp, siz, dlthis->reorder_map);
if (~dload_checksum(dlthis->sect_hdrs, siz) !=
dlthis->verify.dv_scn_rec_checksum) {
DL_ERROR(err_checksum, secn_errid);
return;
}
}
static void allocate_sections(struct dload_state *dlthis)
{
u16 curr_sect, nsecs, siz;
struct doff_scnhdr_t *shp;
struct ldr_section_info *asecs;
struct my_handle *hndl;
nsecs = dlthis->dfile_hdr.df_no_scns;
if (!nsecs)
return;
if ((dlthis->myalloc == NULL) &&
(dlthis->dfile_hdr.df_target_scns > 0)) {
DL_ERROR("Arg 3 (alloc) required but NULL", 0);
return;
}
siz = (dlthis->dfile_hdr.df_target_scns + 1) *
sizeof(struct ldr_section_info) + MY_HANDLE_SIZE;
hndl =
(struct my_handle *)dlthis->mysym->dload_allocate(dlthis->mysym,
siz);
if (!hndl) {
DL_ERROR(err_alloc, siz);
return;
}
hndl->dm.next = hndl->dm.prev = hndl;
hndl->dm.root = NULL;
hndl->dm.dbthis = 0;
dlthis->myhandle = hndl;
dlthis->ldr_sections = asecs = hndl->secns;
shp = dlthis->sect_hdrs;
for (curr_sect = 0; curr_sect < nsecs; curr_sect++) {
u32 soffset = shp->ds_offset;
#if BITS_PER_AU <= BITS_PER_BYTE
if (soffset < dlthis->dfile_hdr.df_strtab_size)
((struct ldr_section_info *)shp)->name =
dlthis->str_head + soffset;
else {
dload_error(dlthis, "Bad name offset in section %d",
curr_sect);
((struct ldr_section_info *)shp)->name = NULL;
}
#endif
if (ds_needs_allocation(shp)) {
*asecs = *(struct ldr_section_info *)shp;
asecs->context = 0;
#if BITS_PER_AU > BITS_PER_BYTE
asecs->name = unpack_name(dlthis, soffset);
dlthis->debug_string_size = soffset + dlthis->temp_len;
#else
dlthis->debug_string_size = soffset;
#endif
if (dlthis->myalloc != NULL) {
if (!dlthis->myalloc->
dload_allocate(dlthis->myalloc, asecs,
ds_alignment(asecs->type))) {
dload_error(dlthis, tgtalloc,
asecs->name, asecs->size);
return;
}
}
shp->ds_vaddr = asecs->load_addr - shp->ds_vaddr;
shp->ds_paddr = asecs->run_addr - shp->ds_paddr;
dlthis->allocated_secn_count += 1;
}
shp += 1;
asecs += 1;
}
#if BITS_PER_AU <= BITS_PER_BYTE
dlthis->debug_string_size +=
strlen(dlthis->str_head + dlthis->debug_string_size) + 1;
#endif
}
static void section_table_free(struct dload_state *dlthis)
{
struct doff_scnhdr_t *shp;
shp = dlthis->sect_hdrs;
if (shp)
dlthis->mysym->dload_deallocate(dlthis->mysym, shp);
}
static const char stringtbl[] = { "string table" };
void dload_strings(struct dload_state *dlthis, bool sec_names_only)
{
u32 ssiz;
char *strbuf;
if (sec_names_only) {
ssiz = BYTE_TO_HOST(DOFF_ALIGN
(dlthis->dfile_hdr.df_scn_name_size));
} else {
ssiz = BYTE_TO_HOST(DOFF_ALIGN
(dlthis->dfile_hdr.df_strtab_size));
}
if (ssiz == 0)
return;
#if BITS_PER_AU > BITS_PER_BYTE
strbuf = (char *)dlthis->mysym->dload_allocate(dlthis->mysym, ssiz +
dlthis->dfile_hdr.
df_max_str_len);
#else
strbuf = (char *)dlthis->mysym->dload_allocate(dlthis->mysym, ssiz);
#endif
if (strbuf == NULL) {
DL_ERROR(err_alloc, ssiz);
return;
}
dlthis->str_head = strbuf;
#if BITS_PER_AU > BITS_PER_BYTE
dlthis->str_temp = strbuf + ssiz;
#endif
if ((unsigned)(dlthis->strm->read_buffer(dlthis->strm, strbuf,
ssiz)) != ssiz) {
DL_ERROR(readstrm, stringtbl);
}
#ifndef _BIG_ENDIAN
if (dlthis->reorder_map)
dload_reorder(strbuf, ssiz, dlthis->reorder_map);
if ((!sec_names_only) && (~dload_checksum(strbuf, ssiz) !=
dlthis->verify.dv_str_tab_checksum)) {
DL_ERROR(err_checksum, stringtbl);
}
#else
if (dlthis->dfile_hdr.df_byte_reshuffle !=
HOST_BYTE_ORDER(REORDER_MAP(BYTE_RESHUFFLE_VALUE))) {
dload_reorder(strbuf, ssiz,
HOST_BYTE_ORDER(dlthis->
dfile_hdr.df_byte_reshuffle));
}
if ((!sec_names_only) && (~dload_reverse_checksum(strbuf, ssiz) !=
dlthis->verify.dv_str_tab_checksum)) {
DL_ERROR(err_checksum, stringtbl);
}
#endif
}
static void string_table_free(struct dload_state *dlthis)
{
if (dlthis->str_head)
dlthis->mysym->dload_deallocate(dlthis->mysym,
dlthis->str_head);
}
#define DBG_HDR_SIZE (sizeof(struct dll_module) - sizeof(struct dll_sect))
static const char sym_errid[] = { "symbol" };
#define MY_SYM_BUF_SIZ (BYTE_TO_HOST(IMAGE_PACKET_SIZE)/\
sizeof(struct doff_syment_t))
static void dload_symbols(struct dload_state *dlthis)
{
u32 sym_count, siz, dsiz, symbols_left;
u32 checks;
struct local_symbol *sp;
struct dynload_symbol *symp;
struct dynload_symbol *newsym;
sym_count = dlthis->dfile_hdr.df_no_syms;
if (sym_count == 0)
return;
siz = sym_count * sizeof(struct local_symbol);
dsiz = DBG_HDR_SIZE +
(sizeof(struct dll_sect) * dlthis->allocated_secn_count) +
BYTE_TO_HOST_ROUND(dlthis->debug_string_size + 1);
if (dsiz > siz)
siz = dsiz;
sp = (struct local_symbol *)dlthis->mysym->dload_allocate(dlthis->mysym,
siz);
if (!sp) {
DL_ERROR(err_alloc, siz);
return;
}
dlthis->local_symtab = sp;
checks = dlthis->verify.dv_sym_tab_checksum;
symbols_left = sym_count;
do {
char *sname;
u32 val;
s32 delta;
struct doff_syment_t *input_sym;
unsigned syms_in_buf;
struct doff_syment_t my_sym_buf[MY_SYM_BUF_SIZ];
input_sym = my_sym_buf;
syms_in_buf = symbols_left > MY_SYM_BUF_SIZ ?
MY_SYM_BUF_SIZ : symbols_left;
siz = syms_in_buf * sizeof(struct doff_syment_t);
if (dlthis->strm->read_buffer(dlthis->strm, input_sym, siz) !=
siz) {
DL_ERROR(readstrm, sym_errid);
return;
}
if (dlthis->reorder_map)
dload_reorder(input_sym, siz, dlthis->reorder_map);
checks += dload_checksum(input_sym, siz);
do {
symbols_left -= 1;
sname = NULL;
if (input_sym->dn_offset > 0) {
#if BITS_PER_AU <= BITS_PER_BYTE
if ((u32) input_sym->dn_offset <
dlthis->dfile_hdr.df_strtab_size)
sname = dlthis->str_head +
BYTE_TO_HOST(input_sym->dn_offset);
else
dload_error(dlthis,
"Bad name offset in symbol "
" %d", symbols_left);
#else
sname = unpack_name(dlthis,
input_sym->dn_offset);
#endif
}
val = input_sym->dn_value;
delta = 0;
sp->sclass = input_sym->dn_sclass;
sp->secnn = input_sym->dn_scnum;
if (sp->secnn == DN_UNDEF) {
if (input_sym->dn_sclass != DN_EXT)
goto loop_cont;
symp = dlthis->mysym->find_matching_symbol
(dlthis->mysym, sname);
if (!symp) {
DL_ERROR
("Undefined external symbol %s",
sname);
goto loop_cont;
}
val = delta = symp->value;
#ifdef ENABLE_TRAMP_DEBUG
dload_syms_error(dlthis->mysym,
"===> ext sym [%s] at %x",
sname, val);
#endif
goto loop_cont;
}
if (sp->secnn > 0) {
if ((unsigned)sp->secnn <=
dlthis->allocated_secn_count) {
struct doff_scnhdr_t *srefp =
&dlthis->sect_hdrs[sp->secnn - 1];
if (input_sym->dn_sclass ==
DN_STATLAB ||
input_sym->dn_sclass == DN_EXTLAB) {
delta = srefp->ds_vaddr;
} else {
delta = srefp->ds_paddr;
}
val += delta;
}
goto loop_itr;
}
if (sp->secnn == DN_ABS && ((sp->sclass == DN_EXT) ||
(sp->sclass ==
DN_EXTLAB))) {
symp =
dlthis->mysym->find_matching_symbol(dlthis->
mysym,
sname);
if (!symp)
goto loop_itr;
if (symp->value == input_sym->dn_value) {
sp->value = val;
sp->delta = delta;
sp += 1;
input_sym += 1;
continue;
} else {
DL_ERROR("Absolute symbol %s is "
"defined multiple times with "
"different values", sname);
return;
}
}
loop_itr:
if (input_sym->dn_sclass == DN_EXT ||
input_sym->dn_sclass == DN_EXTLAB) {
if (!sname)
goto loop_cont;
newsym = dlthis->mysym->add_to_symbol_table
(dlthis->mysym, sname,
(unsigned)dlthis->myhandle);
if (newsym)
newsym->value = val;
}
loop_cont:
sp->value = val;
sp->delta = delta;
sp += 1;
input_sym += 1;
} while ((syms_in_buf -= 1) > 0);
} while (symbols_left > 0);
if (~checks)
dload_error(dlthis, "Checksum of symbols failed");
}
static void symbol_table_free(struct dload_state *dlthis)
{
if (dlthis->local_symtab) {
if (dlthis->dload_errcount) {
dlthis->mysym->purge_symbol_table(dlthis->mysym,
(unsigned)
dlthis->myhandle);
}
dlthis->mysym->dload_deallocate(dlthis->mysym,
dlthis->local_symtab);
}
}
static const struct ldr_section_info cinit_info_init = { cinitname, 0, 0,
(ldr_addr)-1, 0, DLOAD_BSS, 0
};
static void cload_cinit(struct dload_state *dlthis,
struct image_packet_t *ipacket)
{
#if TDATA_TO_HOST(CINIT_COUNT)*BITS_PER_AU > 16
s32 init_count, left;
#else
s16 init_count, left;
#endif
unsigned char *pktp = ipacket->img_data;
unsigned char *pktend = pktp + BYTE_TO_HOST_ROUND(ipacket->packet_size);
int temp;
ldr_addr atmp;
struct ldr_section_info cinit_info;
while (true) {
left = pktend - pktp;
switch (dlthis->cinit_state) {
case CI_COUNT:
if (left < TDATA_TO_HOST(CINIT_COUNT))
goto loopexit;
temp = dload_unpack(dlthis, (tgt_au_t *) pktp,
CINIT_COUNT * TDATA_AU_BITS, 0,
ROP_SGN);
pktp += TDATA_TO_HOST(CINIT_COUNT);
if (temp <= 0) {
dlthis->cinit_state = CI_DONE;
break;
}
dlthis->cinit_count = temp;
dlthis->cinit_state = CI_ADDRESS;
break;
#if CINIT_ALIGN < CINIT_ADDRESS
case CI_PARTADDRESS:
pktp -= TDATA_TO_HOST(CINIT_ALIGN);
*(uint16_t *) pktp = dlthis->cinit_addr;
#endif
case CI_ADDRESS:
if (left < TDATA_TO_HOST(CINIT_ADDRESS)) {
#if CINIT_ALIGN < CINIT_ADDRESS
if (left == TDATA_TO_HOST(CINIT_ALIGN)) {
dlthis->cinit_addr = *(uint16_t *) pktp;
dlthis->cinit_state = CI_PARTADDRESS;
left = 0;
}
#endif
goto loopexit;
}
atmp = dload_unpack(dlthis, (tgt_au_t *) pktp,
CINIT_ADDRESS * TDATA_AU_BITS, 0,
ROP_UNS);
pktp += TDATA_TO_HOST(CINIT_ADDRESS);
#if CINIT_PAGE_BITS > 0
dlthis->cinit_page = atmp &
((1 << CINIT_PAGE_BITS) - 1);
atmp >>= CINIT_PAGE_BITS;
#else
dlthis->cinit_page = CINIT_DEFAULT_PAGE;
#endif
dlthis->cinit_addr = atmp;
dlthis->cinit_state = CI_COPY;
break;
case CI_COPY:
init_count = HOST_TO_TDATA(left);
if (init_count > dlthis->cinit_count)
init_count = dlthis->cinit_count;
if (init_count == 0)
goto loopexit;
cinit_info = cinit_info_init;
cinit_info.page = dlthis->cinit_page;
if (!dlthis->myio->writemem(dlthis->myio, pktp,
TDATA_TO_TADDR
(dlthis->cinit_addr),
&cinit_info,
TDATA_TO_HOST(init_count))) {
dload_error(dlthis, initfail, "write",
dlthis->cinit_addr);
}
dlthis->cinit_count -= init_count;
if (dlthis->cinit_count <= 0) {
dlthis->cinit_state = CI_COUNT;
init_count = (init_count + CINIT_ALIGN - 1) &
-CINIT_ALIGN;
}
pktp += TDATA_TO_HOST(init_count);
dlthis->cinit_addr += init_count;
break;
case CI_DONE:
return;
}
}
loopexit:
if (left > 0) {
dload_error(dlthis, "%d bytes left over in cinit packet", left);
dlthis->cinit_state = CI_DONE;
}
}
#define MY_RELOC_BUF_SIZ 8
static int relocate_packet(struct dload_state *dlthis,
struct image_packet_t *ipacket,
u32 *checks, bool *tramps_generated)
{
u32 rnum;
*tramps_generated = false;
rnum = ipacket->num_relocs;
do {
unsigned rinbuf;
int siz;
struct reloc_record_t *rp, rrec[MY_RELOC_BUF_SIZ];
rp = rrec;
rinbuf = rnum > MY_RELOC_BUF_SIZ ? MY_RELOC_BUF_SIZ : rnum;
siz = rinbuf * sizeof(struct reloc_record_t);
if (dlthis->strm->read_buffer(dlthis->strm, rp, siz) != siz) {
DL_ERROR(readstrm, "relocation");
return 0;
}
if (dlthis->reorder_map)
dload_reorder(rp, siz, dlthis->reorder_map);
*checks += dload_checksum(rp, siz);
do {
dload_relocate(dlthis, (tgt_au_t *) ipacket->img_data,
rp, tramps_generated, false);
rp += 1;
rnum -= 1;
} while ((rinbuf -= 1) > 0);
} while (rnum > 0);
if (*tramps_generated == true) {
dload_tramp_pkt_udpate(dlthis,
(dlthis->image_secn -
dlthis->ldr_sections),
dlthis->image_offset, ipacket);
}
return 1;
}
#define IPH_SIZE (sizeof(struct image_packet_t) - sizeof(u32))
static const char imagepak[] = { "image packet" };
static void dload_data(struct dload_state *dlthis)
{
u16 curr_sect;
struct doff_scnhdr_t *sptr = dlthis->sect_hdrs;
struct ldr_section_info *lptr = dlthis->ldr_sections;
u8 *dest;
struct {
struct image_packet_t ipacket;
u8 bufr[BYTE_TO_HOST(IMAGE_PACKET_SIZE)];
} ibuf;
bool cinit_processed = false;
for (curr_sect = 0; curr_sect < dlthis->dfile_hdr.df_no_scns;
curr_sect += 1) {
if (ds_needs_download(sptr)) {
s32 nip;
ldr_addr image_offset = 0;
if (curr_sect < dlthis->allocated_secn_count)
dlthis->delta_runaddr = sptr->ds_paddr;
else {
lptr = (struct ldr_section_info *)sptr;
dlthis->delta_runaddr = 0;
}
dlthis->image_secn = lptr;
#if BITS_PER_AU > BITS_PER_BYTE
lptr->name = unpack_name(dlthis, sptr->ds_offset);
#endif
nip = sptr->ds_nipacks;
while ((nip -= 1) >= 0) {
s32 ipsize;
u32 checks;
bool tramp_generated = false;
if (dlthis->strm->read_buffer(dlthis->strm,
&ibuf.ipacket,
IPH_SIZE) !=
IPH_SIZE) {
DL_ERROR(readstrm, imagepak);
return;
}
if (dlthis->reorder_map) {
dload_reorder(&ibuf.ipacket, IPH_SIZE,
dlthis->reorder_map);
}
ipsize =
BYTE_TO_HOST(DOFF_ALIGN
(ibuf.ipacket.packet_size));
if (ipsize > BYTE_TO_HOST(IMAGE_PACKET_SIZE)) {
DL_ERROR("Bad image packet size %d",
ipsize);
return;
}
dest = ibuf.bufr;
if (dlthis->strm->read_buffer(dlthis->strm,
ibuf.bufr,
ipsize) !=
ipsize) {
DL_ERROR(readstrm, imagepak);
return;
}
ibuf.ipacket.img_data = dest;
#if !defined(_BIG_ENDIAN) || (TARGET_AU_BITS > 16)
if (dlthis->reorder_map) {
dload_reorder(dest, ipsize,
dlthis->reorder_map);
}
checks = dload_checksum(dest, ipsize);
#else
if (dlthis->dfile_hdr.df_byte_reshuffle !=
TARGET_ORDER(REORDER_MAP
(BYTE_RESHUFFLE_VALUE))) {
dload_reorder(dest, ipsize,
TARGET_ORDER
(dlthis->dfile_hdr.
df_byte_reshuffle));
}
#if TARGET_AU_BITS > 8
checks = dload_reverse_checksum16(dest, ipsize);
#else
checks = dload_reverse_checksum(dest, ipsize);
#endif
#endif
checks += dload_checksum(&ibuf.ipacket,
IPH_SIZE);
if (ibuf.ipacket.num_relocs) {
dlthis->image_offset = image_offset;
if (!relocate_packet(dlthis,
&ibuf.ipacket,
&checks,
&tramp_generated))
return;
}
if (~checks)
DL_ERROR(err_checksum, imagepak);
if (tramp_generated == false) {
if (dload_check_type(sptr,
DLOAD_CINIT)) {
cload_cinit(dlthis,
&ibuf.ipacket);
cinit_processed = true;
} else {
if (!dlthis->myio->
writemem(dlthis->
myio,
ibuf.bufr,
lptr->
load_addr +
image_offset,
lptr,
BYTE_TO_HOST
(ibuf.
ipacket.
packet_size))) {
DL_ERROR
("Write to "
FMT_UI32
" failed",
lptr->
load_addr +
image_offset);
}
}
}
image_offset +=
BYTE_TO_TADDR(ibuf.ipacket.packet_size);
}
if (!dload_check_type(sptr, DLOAD_BSS))
goto loop_cont;
if (!(dlthis->myoptions & DLOAD_INITBSS))
goto loop_cont;
if (cinit_processed) {
DL_ERROR
("Zero-initialization at " FMT_UI32
" after " "load-time initialization!",
lptr->load_addr);
goto loop_cont;
}
dlthis->myio->fillmem(dlthis->myio,
TADDR_TO_HOST(lptr->load_addr),
lptr, TADDR_TO_HOST(lptr->size),
DLOAD_FILL_BSS);
goto loop_cont;
}
if (!dload_check_type(sptr, DLOAD_BSS))
goto loop_cont;
if (!(dlthis->myoptions & DLOAD_INITBSS))
goto loop_cont;
if (curr_sect >= dlthis->allocated_secn_count)
lptr = (struct ldr_section_info *)sptr;
if (cinit_processed) {
DL_ERROR("Zero-initialization at " FMT_UI32
" attempted after "
"load-time initialization!", lptr->load_addr);
goto loop_cont;
}
dlthis->myio->fillmem(dlthis->myio,
TADDR_TO_HOST(lptr->load_addr), lptr,
TADDR_TO_HOST(lptr->size),
DLOAD_FILL_BSS);
loop_cont:
sptr += 1;
lptr += 1;
}
if (dload_tramp_finalize(dlthis) == 0) {
DL_ERROR("Finalization of auto-trampolines (size = " FMT_UI32
") failed", dlthis->tramp.tramp_sect_next_addr);
}
}
#define SHIFT_COUNT_MASK (3 << LOG_BITS_PER_BYTE)
void dload_reorder(void *data, int dsiz, unsigned int map)
{
register u32 tmp, tmap, datv;
u32 *dp = (u32 *) data;
map <<= LOG_BITS_PER_BYTE;
do {
tmp = 0;
datv = *dp;
tmap = map;
do {
tmp |= (datv & BYTE_MASK) << (tmap & SHIFT_COUNT_MASK);
tmap >>= BITS_PER_BYTE;
} while (datv >>= BITS_PER_BYTE);
*dp++ = tmp;
} while ((dsiz -= sizeof(u32)) > 0);
}
u32 dload_checksum(void *data, unsigned siz)
{
u32 sum;
u32 *dp;
int left;
sum = 0;
dp = (u32 *) data;
for (left = siz; left > 0; left -= sizeof(u32))
sum += *dp++;
return sum;
}
#if HOST_ENDIANNESS
u32 dload_reverse_checksum(void *data, unsigned siz)
{
u32 sum, temp;
u32 *dp;
int left;
sum = 0;
dp = (u32 *) data;
for (left = siz; left > 0; left -= sizeof(u32)) {
temp = *dp++;
sum += temp << BITS_PER_BYTE * 3;
sum += temp >> BITS_PER_BYTE * 3;
sum += (temp >> BITS_PER_BYTE) & (BYTE_MASK << BITS_PER_BYTE);
sum += (temp & (BYTE_MASK << BITS_PER_BYTE)) << BITS_PER_BYTE;
}
return sum;
}
#if (TARGET_AU_BITS > 8) && (TARGET_AU_BITS < 32)
u32 dload_reverse_checksum16(void *data, unsigned siz)
{
uint_fast32_t sum, temp;
u32 *dp;
int left;
sum = 0;
dp = (u32 *) data;
for (left = siz; left > 0; left -= sizeof(u32)) {
temp = *dp++;
sum += temp << BITS_PER_BYTE * 2;
sum += temp >> BITS_PER_BYTE * 2;
}
return sum;
}
#endif
#endif
static void swap_words(void *data, unsigned siz, unsigned bitmap)
{
register int i;
#if TARGET_AU_BITS < 16
register u16 *sp;
#endif
register u32 *lp;
siz /= sizeof(u16);
#if TARGET_AU_BITS < 16
i = siz;
sp = (u16 *) data;
do {
register u16 tmp;
tmp = *sp;
*sp++ = SWAP16BY8(tmp);
} while ((i -= 1) > 0);
#endif
#if TARGET_AU_BITS < 32
i = siz >> 1;
lp = (u32 *) data;
do {
if ((bitmap & 1) == 0) {
register u32 tmp;
tmp = *lp;
*lp = SWAP32BY16(tmp);
}
lp += 1;
bitmap >>= 1;
} while ((i -= 1) > 0);
#endif
}
static char *copy_tgt_strings(void *dstp, void *srcp, unsigned charcount)
{
register tgt_au_t *src = (tgt_au_t *) srcp;
register tgt_au_t *dst = (tgt_au_t *) dstp;
register int cnt = charcount;
do {
#if TARGET_AU_BITS <= BITS_PER_AU
*dst++ = *src++;
#else
*dst++ = *src++;
#endif
} while ((cnt -= (sizeof(tgt_au_t) * BITS_PER_AU / BITS_PER_BYTE)) > 0);
#if (BITS_PER_AU == BITS_PER_BYTE) && (TARGET_AU_BITS == BITS_PER_BYTE)
dst[-1] = 0;
#else
dst[-1] &= (1 << (BITS_PER_AU - BITS_PER_BYTE)) - 1;
#endif
return (char *)dst;
}
#ifndef _BIG_ENDIAN
static const struct ldr_section_info dllview_info_init = { ".dllview", 0, 0,
(ldr_addr)-1, DBG_LIST_PAGE, DLOAD_DATA, 0
};
#else
static const struct ldr_section_info dllview_info_init = { ".dllview", 0, 0,
(ldr_addr)-1, DLOAD_DATA, DBG_LIST_PAGE, 0
};
#endif
static void init_module_handle(struct dload_state *dlthis)
{
struct my_handle *hndl;
u16 curr_sect;
struct ldr_section_info *asecs;
struct dll_module *dbmod;
struct dll_sect *dbsec;
struct dbg_mirror_root *mlist;
register char *cp;
struct modules_header mhdr;
struct ldr_section_info dllview_info;
struct dynload_symbol *debug_mirror_sym;
hndl = dlthis->myhandle;
if (!hndl)
return;
hndl->secn_count = dlthis->allocated_secn_count;
if (dlthis->tramp.tramp_sect_next_addr != 0)
hndl->secn_count += 1;
hndl->secn_count = hndl->secn_count << 1;
hndl->secn_count = dlthis->allocated_secn_count << 1;
#ifndef TARGET_ENDIANNESS
if (dlthis->big_e_target)
hndl->secn_count += 1;
#endif
if (dlthis->dload_errcount)
return;
debug_mirror_sym = dlthis->mysym->find_matching_symbol(dlthis->mysym,
loader_dllview_root);
if (!debug_mirror_sym) {
struct dynload_symbol *dlmodsym;
struct dbg_mirror_root *mlst;
dlmodsym = dlthis->mysym->find_matching_symbol(dlthis->mysym,
LINKER_MODULES_HEADER);
if (!dlmodsym)
return;
mlst = (struct dbg_mirror_root *)
dlthis->mysym->dload_allocate(dlthis->mysym,
sizeof(struct
dbg_mirror_root));
if (!mlst) {
DL_ERROR(err_alloc, sizeof(struct dbg_mirror_root));
return;
}
mlst->next = NULL;
mlst->changes = 0;
mlst->refcount = 0;
mlst->dbthis = TDATA_TO_TADDR(dlmodsym->value);
debug_mirror_sym = dlthis->mysym->add_to_symbol_table
(dlthis->mysym, loader_dllview_root,
(unsigned)dlthis->myhandle);
if (!debug_mirror_sym) {
dlthis->mysym->dload_deallocate(dlthis->mysym, mlst);
return;
}
debug_mirror_sym->value = (u32) mlst;
}
#ifndef DEBUG_HEADER_IN_LOADER
mlist = (struct dbg_mirror_root *)debug_mirror_sym->value;
if (!mlist)
return;
#else
mlist = (struct dbg_mirror_root *)&debug_list_header;
#endif
hndl->dm.root = mlist;
if (!dlthis->allocated_secn_count)
return;
dbmod = (struct dll_module *)dlthis->local_symtab;
dbmod->num_sects = dlthis->allocated_secn_count;
dbmod->timestamp = dlthis->verify.dv_timdat;
dbmod->version = INIT_VERSION;
dbmod->verification = VERIFICATION;
asecs = dlthis->ldr_sections;
dbsec = dbmod->sects;
for (curr_sect = dlthis->allocated_secn_count;
curr_sect > 0; curr_sect -= 1) {
dbsec->sect_load_adr = asecs->load_addr;
dbsec->sect_run_adr = asecs->run_addr;
dbsec += 1;
asecs += 1;
}
if (dlthis->tramp.tramp_sect_next_addr != 0) {
dbmod->num_sects++;
dbsec->sect_load_adr = asecs->load_addr;
dbsec->sect_run_adr = asecs->run_addr;
dbsec++;
asecs++;
}
cp = copy_tgt_strings(dbsec, dlthis->str_head,
dlthis->debug_string_size);
if (dlthis->tramp.tramp_sect_next_addr != 0) {
cp = copy_tgt_strings(cp,
dlthis->tramp.final_string_table,
strlen(dlthis->tramp.final_string_table) +
1);
}
hndl->dm.dbsiz = HOST_TO_TDATA_ROUND(cp - (char *)dbmod);
*cp = 0;
dllview_info = dllview_info_init;
dllview_info.size = TDATA_TO_TADDR(hndl->dm.dbsiz);
dllview_info.context = 0;
hndl->dm.context = 0;
if (mlist->next) {
dbmod->next_module = TADDR_TO_TDATA(mlist->next->dm.dbthis);
dbmod->next_module_size = mlist->next->dm.dbsiz;
} else {
dbmod->next_module_size = 0;
dbmod->next_module = 0;
}
if (!dlthis->myalloc)
return;
if (!dlthis->myalloc->dload_allocate(dlthis->myalloc, &dllview_info,
HOST_TO_TADDR(sizeof(u32)))) {
return;
}
hndl->dm.dbthis = dllview_info.load_addr;
hndl->dm.context = dllview_info.context;
mlist->refcount += 1;
if (TARGET_ENDIANNESS_DIFFERS(TARGET_BIG_ENDIAN)) {
swap_words(dbmod, (char *)dbsec - (char *)dbmod,
DLL_MODULE_BITMAP);
}
if (!dlthis->myio->writemem(dlthis->myio, dbmod,
dllview_info.load_addr, &dllview_info,
TADDR_TO_HOST(dllview_info.size))) {
return;
}
mhdr.first_module_size = hndl->dm.dbsiz;
mhdr.first_module = TADDR_TO_TDATA(dllview_info.load_addr);
if (TARGET_ENDIANNESS_DIFFERS(TARGET_BIG_ENDIAN)) {
swap_words(&mhdr, sizeof(struct modules_header) - sizeof(u16),
MODULES_HEADER_BITMAP);
}
dllview_info = dllview_info_init;
if (!dlthis->myio->writemem(dlthis->myio, &mhdr, mlist->dbthis,
&dllview_info,
sizeof(struct modules_header) -
sizeof(u16))) {
return;
}
hndl->dm.next = mlist->next;
if (hndl->dm.next)
hndl->dm.next->dm.prev = hndl;
hndl->dm.prev = (struct my_handle *)mlist;
mlist->next = hndl;
}
int dynamic_unload_module(void *mhandle,
struct dynamic_loader_sym *syms,
struct dynamic_loader_allocate *alloc,
struct dynamic_loader_initialize *init)
{
s16 curr_sect;
struct ldr_section_info *asecs;
struct my_handle *hndl;
struct dbg_mirror_root *root;
unsigned errcount = 0;
struct ldr_section_info dllview_info = dllview_info_init;
struct modules_header mhdr;
hndl = (struct my_handle *)mhandle;
if (!hndl)
return 0;
if (!syms)
return 1;
syms->purge_symbol_table(syms, (unsigned)hndl);
asecs = hndl->secns;
if (alloc)
for (curr_sect = (hndl->secn_count >> 1); curr_sect > 0;
curr_sect -= 1) {
asecs->name = NULL;
alloc->dload_deallocate(alloc, asecs++);
}
root = hndl->dm.root;
if (!root) {
goto func_end;
}
if (!hndl->dm.dbthis) {
goto loop_end;
}
dllview_info.context = hndl->dm.context;
if (hndl->dm.prev == hndl)
goto exitunltgt;
hndl->dm.prev->dm.next = hndl->dm.next;
if (hndl->dm.next)
hndl->dm.next->dm.prev = hndl->dm.prev;
if (hndl->dm.next) {
mhdr.first_module = TADDR_TO_TDATA(hndl->dm.next->dm.dbthis);
mhdr.first_module_size = hndl->dm.next->dm.dbsiz;
} else {
mhdr.first_module = 0;
mhdr.first_module_size = 0;
}
if (!init)
goto exitunltgt;
if (!init->connect(init)) {
dload_syms_error(syms, iconnect);
errcount += 1;
goto exitunltgt;
}
if (TARGET_ENDIANNESS_DIFFERS(hndl->secn_count & 0x1)) {
swap_words(&mhdr, sizeof(struct modules_header) - sizeof(u16),
MODULES_HEADER_BITMAP);
}
if (!init->writemem(init, &mhdr, hndl->dm.prev->dm.dbthis,
&dllview_info, sizeof(struct modules_header) -
sizeof(mhdr.update_flag))) {
dload_syms_error(syms, dlvwrite);
errcount += 1;
}
root->changes += 1;
if (!init->writemem(init, &(root->changes),
root->dbthis + HOST_TO_TADDR
(sizeof(mhdr.first_module) +
sizeof(mhdr.first_module_size)),
&dllview_info, sizeof(mhdr.update_flag))) {
dload_syms_error(syms, dlvwrite);
errcount += 1;
}
init->release(init);
exitunltgt:
dllview_info.size = TDATA_TO_TADDR(hndl->dm.dbsiz);
dllview_info.load_addr = hndl->dm.dbthis;
if (alloc)
alloc->dload_deallocate(alloc, &dllview_info);
root->refcount -= 1;
loop_end:
#ifndef DEBUG_HEADER_IN_LOADER
if (root->refcount <= 0) {
if (syms->find_matching_symbol
(syms, loader_dllview_root) == NULL)
syms->dload_deallocate(syms, root);
}
#endif
func_end:
syms->dload_deallocate(syms, mhandle);
return errcount;
}
#if BITS_PER_AU > BITS_PER_BYTE
static char *unpack_name(struct dload_state *dlthis, u32 soffset)
{
u8 tmp, *src;
char *dst;
if (soffset >= dlthis->dfile_hdr.df_strtab_size) {
dload_error(dlthis, "Bad string table offset " FMT_UI32,
soffset);
return NULL;
}
src = (uint_least8_t *) dlthis->str_head +
(soffset >> (LOG_BITS_PER_AU - LOG_BITS_PER_BYTE));
dst = dlthis->str_temp;
if (soffset & 1)
*dst++ = *src++;
do {
tmp = *src++;
*dst = (tmp >> BITS_PER_BYTE);
if (!(*dst++))
break;
} while ((*dst++ = tmp & BYTE_MASK));
dlthis->temp_len = dst - dlthis->str_temp;
return dlthis->str_temp;
}
#endif
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
- 119
- 120
- 121
- 122
- 123
- 124
- 125
- 126
- 127
- 128
- 129
- 130
- 131
- 132
- 133
- 134
- 135
- 136
- 137
- 138
- 139
- 140
- 141
- 142
- 143
- 144
- 145
- 146
- 147
- 148
- 149
- 150
- 151
- 152
- 153
- 154
- 155
- 156
- 157
- 158
- 159
- 160
- 161
- 162
- 163
- 164
- 165
- 166
- 167
- 168
- 169
- 170
- 171
- 172
- 173
- 174
- 175
- 176
- 177
- 178
- 179
- 180
- 181
- 182
- 183
- 184
- 185
- 186
- 187
- 188
- 189
- 190
- 191
- 192
- 193
- 194
- 195
- 196
- 197
- 198
- 199
- 200
- 201
- 202
- 203
- 204
- 205
- 206
- 207
- 208
- 209
- 210
- 211
- 212
- 213
- 214
- 215
- 216
- 217
- 218
- 219
- 220
- 221
- 222
- 223
- 224
- 225
- 226
- 227
- 228
- 229
- 230
- 231
- 232
- 233
- 234
- 235
- 236
- 237
- 238
- 239
- 240
- 241
- 242
- 243
- 244
- 245
- 246
- 247
- 248
- 249
- 250
- 251
- 252
- 253
- 254
- 255
- 256
- 257
- 258
- 259
- 260
- 261
- 262
- 263
- 264
- 265
- 266
- 267
- 268
- 269
- 270
- 271
- 272
- 273
- 274
- 275
- 276
- 277
- 278
- 279
- 280
- 281
- 282
- 283
- 284
- 285
- 286
- 287
- 288
- 289
- 290
- 291
- 292
- 293
- 294
- 295
- 296
- 297
- 298
- 299
- 300
- 301
- 302
- 303
- 304
- 305
- 306
- 307
- 308
- 309
- 310
- 311
- 312
- 313
- 314
- 315
- 316
- 317
- 318
- 319
- 320
- 321
- 322
- 323
- 324
- 325
- 326
- 327
- 328
- 329
- 330
- 331
- 332
- 333
- 334
- 335
- 336
- 337
- 338
- 339
- 340
- 341
- 342
- 343
- 344
- 345
- 346
- 347
- 348
- 349
- 350
- 351
- 352
- 353
- 354
- 355
- 356
- 357
- 358
- 359
- 360
- 361
- 362
- 363
- 364
- 365
- 366
- 367
- 368
- 369
- 370
- 371
- 372
- 373
- 374
- 375
- 376
- 377
- 378
- 379
- 380
- 381
- 382
- 383
- 384
- 385
- 386
- 387
- 388
- 389
- 390
- 391
- 392
- 393
- 394
- 395
- 396
- 397
- 398
- 399
- 400
- 401
- 402
- 403
- 404
- 405
- 406
- 407
- 408
- 409
- 410
- 411
- 412
- 413
- 414
- 415
- 416
- 417
- 418
- 419
- 420
- 421
- 422
- 423
- 424
- 425
- 426
- 427
- 428
- 429
- 430
- 431
- 432
- 433
- 434
- 435
- 436
- 437
- 438
- 439
- 440
- 441
- 442
- 443
- 444
- 445
- 446
- 447
- 448
- 449
- 450
- 451
- 452
- 453
- 454
- 455
- 456
- 457
- 458
- 459
- 460
- 461
- 462
- 463
- 464
- 465
- 466
- 467
- 468
- 469
- 470
- 471
- 472
- 473
- 474
- 475
- 476
- 477
- 478
- 479
- 480
- 481
- 482
- 483
- 484
- 485
- 486
- 487
- 488
- 489
- 490
- 491
- 492
- 493
- 494
- 495
- 496
- 497
- 498
- 499
- 500
- 501
- 502
- 503
- 504
- 505
- 506
- 507
- 508
- 509
- 510
- 511
- 512
- 513
- 514
- 515
- 516
- 517
- 518
- 519
- 520
- 521
- 522
- 523
- 524
- 525
- 526
- 527
- 528
- 529
- 530
- 531
- 532
- 533
- 534
- 535
- 536
- 537
- 538
- 539
- 540
- 541
- 542
- 543
- 544
- 545
- 546
- 547
- 548
- 549
- 550
- 551
- 552
- 553
- 554
- 555
- 556
- 557
- 558
- 559
- 560
- 561
- 562
- 563
- 564
- 565
- 566
- 567
- 568
- 569
- 570
- 571
- 572
- 573
- 574
- 575
- 576
- 577
- 578
- 579
- 580
- 581
- 582
- 583
- 584
- 585
- 586
- 587
- 588
- 589
- 590
- 591
- 592
- 593
- 594
- 595
- 596
- 597
- 598
- 599
- 600
- 601
- 602
- 603
- 604
- 605
- 606
- 607
- 608
- 609
- 610
- 611
- 612
- 613
- 614
- 615
- 616
- 617
- 618
- 619
- 620
- 621
- 622
- 623
- 624
- 625
- 626
- 627
- 628
- 629
- 630
- 631
- 632
- 633
- 634
- 635
- 636
- 637
- 638
- 639
- 640
- 641
- 642
- 643
- 644
- 645
- 646
- 647
- 648
- 649
- 650
- 651
- 652
- 653
- 654
- 655
- 656
- 657
- 658
- 659
- 660
- 661
- 662
- 663
- 664
- 665
- 666
- 667
- 668
- 669
- 670
- 671
- 672
- 673
- 674
- 675
- 676
- 677
- 678
- 679
- 680
- 681
- 682
- 683
- 684
- 685
- 686
- 687
- 688
- 689
- 690
- 691
- 692
- 693
- 694
- 695
- 696
- 697
- 698
- 699
- 700
- 701
- 702
- 703
- 704
- 705
- 706
- 707
- 708
- 709
- 710
- 711
- 712
- 713
- 714
- 715
- 716
- 717
- 718
- 719
- 720
- 721
- 722
- 723
- 724
- 725
- 726
- 727
- 728
- 729
- 730
- 731
- 732
- 733
- 734
- 735
- 736
- 737
- 738
- 739
- 740
- 741
- 742
- 743
- 744
- 745
- 746
- 747
- 748
- 749
- 750
- 751
- 752
- 753
- 754
- 755
- 756
- 757
- 758
- 759
- 760
- 761
- 762
- 763
- 764
- 765
- 766
- 767
- 768
- 769
- 770
- 771
- 772
- 773
- 774
- 775
- 776
- 777
- 778
- 779
- 780
- 781
- 782
- 783
- 784
- 785
- 786
- 787
- 788
- 789
- 790
- 791
- 792
- 793
- 794
- 795
- 796
- 797
- 798
- 799
- 800
- 801
- 802
- 803
- 804
- 805
- 806
- 807
- 808
- 809
- 810
- 811
- 812
- 813
- 814
- 815
- 816
- 817
- 818
- 819
- 820
- 821
- 822
- 823
- 824
- 825
- 826
- 827
- 828
- 829
- 830
- 831
- 832
- 833
- 834
- 835
- 836
- 837
- 838
- 839
- 840
- 841
- 842
- 843
- 844
- 845
- 846
- 847
- 848
- 849
- 850
- 851
- 852
- 853
- 854
- 855
- 856
- 857
- 858
- 859
- 860
- 861
- 862
- 863
- 864
- 865
- 866
- 867
- 868
- 869
- 870
- 871
- 872
- 873
- 874
- 875
- 876
- 877
- 878
- 879
- 880
- 881
- 882
- 883
- 884
- 885
- 886
- 887
- 888
- 889
- 890
- 891
- 892
- 893
- 894
- 895
- 896
- 897
- 898
- 899
- 900
- 901
- 902
- 903
- 904
- 905
- 906
- 907
- 908
- 909
- 910
- 911
- 912
- 913
- 914
- 915
- 916
- 917
- 918
- 919
- 920
- 921
- 922
- 923
- 924
- 925
- 926
- 927
- 928
- 929
- 930
- 931
- 932
- 933
- 934
- 935
- 936
- 937
- 938
- 939
- 940
- 941
- 942
- 943
- 944
- 945
- 946
- 947
- 948
- 949
- 950
- 951
- 952
- 953
- 954
- 955
- 956
- 957
- 958
- 959
- 960
- 961
- 962
- 963
- 964
- 965
- 966
- 967
- 968
- 969
- 970
- 971
- 972
- 973
- 974
- 975
- 976
- 977
- 978
- 979
- 980
- 981
- 982
- 983
- 984
- 985
- 986
- 987
- 988
- 989
- 990
- 991
- 992
- 993
- 994
- 995
- 996
- 997
- 998
- 999
- 1000
- 1001
- 1002
- 1003
- 1004
- 1005
- 1006
- 1007
- 1008
- 1009
- 1010
- 1011
- 1012
- 1013
- 1014
- 1015
- 1016
- 1017
- 1018
- 1019
- 1020
- 1021
- 1022
- 1023
- 1024
- 1025
- 1026
- 1027
- 1028
- 1029
- 1030
- 1031
- 1032
- 1033
- 1034
- 1035
- 1036
- 1037
- 1038
- 1039
- 1040
- 1041
- 1042
- 1043
- 1044
- 1045
- 1046
- 1047
- 1048
- 1049
- 1050
- 1051
- 1052
- 1053
- 1054
- 1055
- 1056
- 1057
- 1058
- 1059
- 1060
- 1061
- 1062
- 1063
- 1064
- 1065
- 1066
- 1067
- 1068
- 1069
- 1070
- 1071
- 1072
- 1073
- 1074
- 1075
- 1076
- 1077
- 1078
- 1079
- 1080
- 1081
- 1082
- 1083
- 1084
- 1085
- 1086
- 1087
- 1088
- 1089
- 1090
- 1091
- 1092
- 1093
- 1094
- 1095
- 1096
- 1097
- 1098
- 1099
- 1100
- 1101
- 1102
- 1103
- 1104
- 1105
- 1106
- 1107
- 1108
- 1109
- 1110
- 1111
- 1112
- 1113
- 1114
- 1115
- 1116
- 1117
- 1118
- 1119
- 1120
- 1121
- 1122
- 1123
- 1124
- 1125
- 1126
- 1127
- 1128
- 1129
- 1130
- 1131
- 1132
- 1133
- 1134
- 1135
- 1136
- 1137
- 1138
- 1139
- 1140
- 1141
- 1142
- 1143
- 1144
- 1145
- 1146
- 1147
- 1148
- 1149
- 1150
- 1151
- 1152
- 1153
- 1154
- 1155
- 1156
- 1157
- 1158
- 1159
- 1160
- 1161
- 1162
- 1163
- 1164
- 1165
- 1166
- 1167
- 1168
- 1169
- 1170
- 1171
- 1172
- 1173
- 1174
- 1175
- 1176
- 1177
- 1178
- 1179
- 1180
- 1181
- 1182
- 1183
- 1184
- 1185
- 1186
- 1187
- 1188
- 1189
- 1190
- 1191
- 1192
- 1193
- 1194
- 1195
- 1196
- 1197
- 1198
- 1199
- 1200
- 1201
- 1202
- 1203
- 1204
- 1205
- 1206
- 1207
- 1208
- 1209
- 1210
- 1211
- 1212
- 1213
- 1214
- 1215
- 1216
- 1217
- 1218
- 1219
- 1220
- 1221
- 1222
- 1223
- 1224
- 1225
- 1226
- 1227
- 1228
- 1229
- 1230
- 1231
- 1232
- 1233
- 1234
- 1235
- 1236
- 1237
- 1238
- 1239
- 1240
- 1241
- 1242
- 1243
- 1244
- 1245
- 1246
- 1247
- 1248
- 1249
- 1250
- 1251
- 1252
- 1253
- 1254
- 1255
- 1256
- 1257
- 1258
- 1259
- 1260
- 1261
- 1262
- 1263
- 1264
- 1265
- 1266
- 1267
- 1268
- 1269
- 1270
- 1271
- 1272
- 1273
- 1274
- 1275
- 1276
- 1277
- 1278
- 1279
- 1280
- 1281
- 1282
- 1283
- 1284
- 1285
- 1286
- 1287
- 1288
- 1289
- 1290
- 1291
- 1292
- 1293
- 1294
- 1295
- 1296
- 1297
- 1298
- 1299
- 1300
- 1301
- 1302
- 1303
- 1304
- 1305
- 1306
- 1307
- 1308
- 1309
- 1310
- 1311
- 1312
- 1313
- 1314
- 1315
- 1316
- 1317
- 1318
- 1319
- 1320
- 1321
- 1322
- 1323
- 1324
- 1325
- 1326
- 1327
- 1328
- 1329
- 1330
- 1331
- 1332
- 1333
- 1334
- 1335
- 1336
- 1337
- 1338
- 1339
- 1340
- 1341
- 1342
- 1343
- 1344
- 1345
- 1346
- 1347
- 1348
- 1349
- 1350
- 1351
- 1352
- 1353
- 1354
- 1355
- 1356
- 1357
- 1358
- 1359
- 1360
- 1361
- 1362
- 1363
- 1364
- 1365
- 1366
- 1367
- 1368
- 1369
- 1370
- 1371
- 1372
- 1373
- 1374
- 1375
- 1376
- 1377
- 1378
- 1379
- 1380
- 1381
- 1382
- 1383
- 1384
- 1385
- 1386
- 1387
- 1388
- 1389
- 1390
- 1391
- 1392
- 1393
- 1394
- 1395
- 1396
- 1397
- 1398
- 1399
- 1400
- 1401
- 1402
- 1403
- 1404
- 1405
- 1406
- 1407
- 1408
- 1409
- 1410
- 1411
- 1412
- 1413
- 1414
- 1415
- 1416
- 1417
- 1418
- 1419
- 1420
- 1421
- 1422
- 1423
- 1424
- 1425
- 1426
- 1427
- 1428
- 1429
- 1430
- 1431
- 1432
- 1433
- 1434
- 1435
- 1436
- 1437
- 1438
- 1439
- 1440
- 1441
- 1442
- 1443
- 1444
- 1445
- 1446
- 1447
- 1448
- 1449
- 1450
- 1451
- 1452
- 1453
- 1454
- 1455
- 1456
- 1457
- 1458
- 1459
- 1460
- 1461
- 1462
- 1463
- 1464
- 1465
- 1466
- 1467
- 1468
- 1469
- 1470
- 1471
- 1472
- 1473
- 1474
- 1475
- 1476
- 1477
- 1478
- 1479
- 1480
- 1481
- 1482
- 1483
- 1484
- 1485
- 1486
- 1487
- 1488
- 1489
- 1490
- 1491
- 1492
- 1493
- 1494
- 1495
- 1496
- 1497
- 1498
- 1499
- 1500
- 1501
- 1502
- 1503
- 1504
- 1505
- 1506
- 1507
- 1508
- 1509
- 1510
- 1511
- 1512
- 1513
- 1514
- 1515
- 1516
- 1517
- 1518
- 1519
- 1520
- 1521
- 1522
- 1523
- 1524
- 1525
- 1526
- 1527
- 1528
- 1529
- 1530
- 1531
- 1532
- 1533
- 1534
- 1535
- 1536
- 1537
- 1538
- 1539
- 1540
- 1541
- 1542
- 1543
- 1544
- 1545
- 1546
- 1547
- 1548
- 1549
- 1550
- 1551
- 1552
- 1553
- 1554
- 1555
- 1556
- 1557
- 1558
- 1559
- 1560
- 1561
- 1562
- 1563
- 1564
- 1565
- 1566
- 1567
- 1568
- 1569
- 1570
- 1571
- 1572
- 1573
- 1574
- 1575
- 1576
- 1577
- 1578
- 1579
- 1580
- 1581
- 1582
- 1583
- 1584
- 1585
- 1586
- 1587
- 1588
- 1589
- 1590
- 1591
- 1592
- 1593
- 1594
- 1595
- 1596
- 1597
- 1598
- 1599
- 1600
- 1601
- 1602
- 1603
- 1604
- 1605
- 1606
- 1607
- 1608
- 1609
- 1610
- 1611
- 1612
- 1613
- 1614
- 1615
- 1616
- 1617
- 1618
- 1619
- 1620
- 1621
- 1622
- 1623
- 1624
- 1625
- 1626
- 1627
- 1628
- 1629
- 1630
- 1631
- 1632
- 1633
- 1634
- 1635
- 1636
- 1637
- 1638
- 1639
- 1640
- 1641
- 1642
- 1643
- 1644
- 1645
- 1646
- 1647
- 1648
- 1649
- 1650
- 1651
- 1652
- 1653
- 1654
- 1655
- 1656
- 1657
- 1658
- 1659
- 1660
- 1661
- 1662
- 1663
- 1664
- 1665
- 1666
- 1667
- 1668
- 1669
- 1670
- 1671
- 1672
- 1673
- 1674
- 1675
- 1676
- 1677
- 1678
- 1679
- 1680
- 1681
- 1682
- 1683
- 1684
- 1685
- 1686
- 1687
- 1688
- 1689
- 1690
- 1691
- 1692
- 1693
- 1694
- 1695
- 1696
- 1697
- 1698
- 1699
- 1700
- 1701
- 1702
- 1703
- 1704
- 1705
- 1706
- 1707
- 1708
- 1709
- 1710
- 1711
- 1712
- 1713
- 1714
- 1715
- 1716
- 1717
- 1718
- 1719
- 1720
- 1721
- 1722
- 1723
- 1724
- 1725
- 1726
- 1727
- 1728
- 1729
- 1730
- 1731
- 1732
- 1733
- 1734
- 1735
- 1736
- 1737
- 1738
- 1739
- 1740
- 1741
- 1742
- 1743
- 1744
- 1745
- 1746
- 1747
- 1748
- 1749
- 1750
- 1751
- 1752
- 1753
- 1754
- 1755
- 1756
- 1757
- 1758
- 1759
- 1760
- 1761
- 1762
- 1763
- 1764
- 1765
- 1766
- 1767
- 1768
- 1769
- 1770
- 1771
- 1772
- 1773
- 1774
- 1775
- 1776
- 1777
- 1778
- 1779
- 1780
- 1781
- 1782
- 1783
- 1784
- 1785
- 1786
- 1787
- 1788
- 1789
- 1790
- 1791
- 1792
- 1793
- 1794
- 1795
- 1796
- 1797
- 1798
- 1799
- 1800
- 1801
- 1802
- 1803
- 1804
- 1805
- 1806
- 1807
- 1808
- 1809
- 1810
- 1811
- 1812
- 1813
- 1814
- 1815
- 1816
- 1817
- 1818
- 1819
- 1820
- 1821
- 1822
- 1823
- 1824
- 1825
- 1826
- 1827
- 1828
- 1829
- 1830
- 1831
- 1832
- 1833
- 1834
- 1835
- 1836
- 1837
- 1838
- 1839
- 1840
- 1841
- 1842
- 1843
- 1844
- 1845
- 1846
- 1847
- 1848
- 1849
- 1850
- 1851
- 1852
- 1853
- 1854
- 1855
- 1856
- 1857
- 1858
- 1859
- 1860
- 1861
- 1862
- 1863
- 1864
- 1865
- 1866
- 1867
- 1868
- 1869
- 1870
- 1871
- 1872
- 1873
- 1874
- 1875
- 1876
- 1877
- 1878
- 1879
- 1880
- 1881
- 1882
- 1883
- 1884
- 1885
- 1886
- 1887
- 1888
- 1889
- 1890
- 1891
- 1892
- 1893
- 1894
- 1895
- 1896
- 1897
- 1898
- 1899
- 1900
- 1901
- 1902
- 1903
- 1904
- 1905
- 1906
- 1907
- 1908
- 1909
- 1910
- 1911
- 1912
- 1913
- 1914
- 1915
- 1916
- 1917
- 1918
- 1919
- 1920
- 1921
- 1922
- 1923
- 1924
- 1925
- 1926
- 1927
- 1928
- 1929
- 1930
- 1931
- 1932
- 1933