Ignore:
Timestamp:
2011-08-18T18:09:11Z (14 years ago)
Author:
Oleg Romanenko <romanenko.oleg@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7234617
Parents:
602c3d8c
Message:

exFAT: fixes to support big endian. Tested on mips32 EB

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/exfat/exfat_directory.c

    r602c3d8c rc56c4576  
    283283                if (rc != EOK)
    284284                        return rc;
    285                 memcpy((uint8_t *)&array[i], (uint8_t *)de, sizeof(exfat_dentry_t));
     285                array[i] = *de;
    286286                rc = exfat_directory_next(di);
    287287                if (rc!=EOK) {
     
    297297
    298298        /* Sync */
    299         array[0].file.attr = df->attr;
    300         array[1].stream.firstc = ds->firstc;
     299        array[0].file.attr = host2uint16_t_le(df->attr);
     300        array[1].stream.firstc = host2uint32_t_le(ds->firstc);
    301301        array[1].stream.flags = ds->flags;
    302         array[1].stream.valid_data_size = ds->valid_data_size;
    303         array[1].stream.data_size = ds->data_size;
     302        array[1].stream.valid_data_size = host2uint64_t_le(ds->valid_data_size);
     303        array[1].stream.data_size = host2uint64_t_le(ds->data_size);
    304304        array[0].file.checksum = host2uint16_t_le(exfat_directory_set_checksum((uint8_t *)array,
    305305            count*sizeof(exfat_dentry_t)));
     
    310310                if (rc != EOK)
    311311                        return rc;
    312                 memcpy((uint8_t *)de, (uint8_t *)&array[i], sizeof(exfat_dentry_t));
     312                *de = array[i];
    313313                di->b->dirty = true;
    314314                rc = exfat_directory_next(di);
     
    318318                }
    319319        }
     320        free(array);
    320321
    321322        return EOK;
     
    369370        uint16_t wname[EXFAT_FILENAME_LEN+1];
    370371        int rc, i;
    371         size_t uctable_chars;
     372        size_t uctable_chars, j;
    372373        aoff64_t pos;
    373374
     
    420421        if (rc != EOK)
    421422                return rc;
    422         memcpy(de, &df, sizeof(exfat_dentry_t));
     423        *de = df;
    423424        di->b->dirty = true;
    424425        rc = exfat_directory_next(di);
     
    430431        if (rc != EOK)
    431432                return rc;
    432         memcpy(de, &ds, sizeof(exfat_dentry_t));
     433        *de = ds;
    433434        di->b->dirty = true;
    434435
     
    451452                        return rc;
    452453                de->type = EXFAT_TYPE_NAME;
    453                 memcpy((uint8_t*)de->name.name, (uint8_t*)sname, sizeof(uint16_t)*chars);
     454                /* test */
     455                for (j=0; j<chars; j++){
     456                        de->name.name[j] = *sname;
     457                        sname++;
     458                }
     459
    454460                di->b->dirty = true;
    455461                sname += chars;
Note: See TracChangeset for help on using the changeset viewer.