Ignore:
Timestamp:
May 25, 2014, 5:35:37 PM (11 years ago)
Author:
cfuguet
Message:

tsar_boot:

  • Important optimization in the reset_elf_loader function.
  • Implementation of pread function which uses bytes addressing to read disk.
  • pread function alternates between direct tranfer from disk to memory and from disk to a memory cache block based on alignment of byte address, i.e., when file offset is aligned to disk block (512 bytes), pread uses DMA capacity of disk to transfer directly to memory, otherwise it passes before by a memory cache block and then performs a memcpy to transfer data to final destination.
  • the cache block used by pread function, allows to treat succeeding reads on the same block without accessing the disk.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/softs/tsar_boot/include/reset_utils.h

    r655 r701  
    1010#include <elf-types.h>
    1111#include <reset_tty.h>
    12 #include <defs_platform.h>
     12#include <reset_ioc.h>
     13#include <defs.h>
    1314#include <mcc.h>
    1415#include <io.h>
    1516
     17/********************************************************************
     18 * Integer types definition
     19 ********************************************************************/
     20typedef unsigned int size_t;
     21typedef unsigned int addr_t;
     22
     23/********************************************************************
     24 * Other types definition
     25 ********************************************************************/
     26
     27/*
     28 * cache line aligned disk block (sector) buffer
     29 */
     30struct aligned_blk
     31{
     32    char b[BLOCK_SIZE];
     33} __attribute__((aligned(CACHE_LINE_SIZE)));
     34
     35/********************************************************************
     36 * Utility functions definition
     37 ********************************************************************/
     38
    1639extern unsigned int proctime();
    1740
    18 extern void* memcpy(void *_dst, const void *_src, unsigned int size);
     41extern int pread(size_t file_offset, void *buf, size_t nbyte, size_t offset);
    1942
    20 extern void* memset(void *_dst, const int value, unsigned int size);
     43extern void* memcpy(void *_dst, const void *_src, size_t n);
     44extern void* memset(void *_dst, int c, size_t len);
    2145
     46extern void check_elf_header(Elf32_Ehdr *ehdr);
    2247extern void reset_print_elf_phdr(Elf32_Phdr * elf_phdr_ptr);
    2348
    2449#if USE_IOB
    25 void reset_mcc_invalidate ( const void * buffer,
    26                             unsigned int size);
     50void reset_mcc_invalidate (const void * buf, size_t size);
    2751#endif /* USE_IOB */
    2852
    2953#if (CACHE_COHERENCE == 0) || USE_IOB
    30 void reset_buf_invalidate ( const void * buffer,
    31                             unsigned int line_size,
    32                             unsigned int size);
     54void reset_buf_invalidate (const void * buf, size_t line_size, size_t size);
    3355#endif /* (CACHE_COHERENCE == 0) || USE_IOB */
    3456#endif /* BOOT_UTILS_H */
Note: See TracChangeset for help on using the changeset viewer.