Ignore:
Timestamp:
Jan 27, 2015, 5:20:19 PM (9 years ago)
Author:
cfuguet
Message:

tsar_boot: using global variable for the block device block cache

  • Some GCC versions have a problem to align as indicated with the attribute(aligned()) macro the functions' local variables. Therefore, using a global variable instead of a static local variable for the block cache because this last must be aligned to a cache line.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/softs/tsar_boot/src/reset_utils.c

    r830 r930  
    1212#include <io.h>
    1313
     14/*
     15 * Cache block data buffer and cached block index
     16 */
     17struct aligned_blk blk_buf;
     18int blk_buf_idx;
     19
    1420/**
    1521 * \param file_offset: Disk relative offset of file
     
    2430int pread(size_t file_offset, void *buf, size_t nbyte, size_t offset) {
    2531    if (nbyte == 0) return 0;
    26 
    27     /*
    28      * Cache block data buffer and cached block index
    29      */
    30     static struct aligned_blk blk_buf;
    31     static int blk_buf_idx = -1;
    3232
    3333    char *dst;
Note: See TracChangeset for help on using the changeset viewer.