Ignore:
Timestamp:
Jun 10, 2014, 12:33:23 PM (10 years ago)
Author:
alain
Message:

All drivers have been modified to use only the information
contained in the hard_config.h file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_drivers/rdk_driver.c

    r313 r320  
    1515// As the number of concurrent accesses is not bounded, these functions
    1616// don't use the _ioc_lock variable.
     17//
     18// The SEG_RDK_BASE virtual address must be defined in the hard_config.h
     19// file when the USE_RAMDISK flag is set.
    1720///////////////////////////////////////////////////////////////////////////////////
    1821
    1922#include <giet_config.h>
     23#include <hard_config.h>
    2024#include <rdk_driver.h>
    2125#include <utils.h>
    2226#include <tty_driver.h>
    2327#include <ctx_handler.h>
     28
     29#if !defined(SEG_RDK_BASE)
     30# error: You must define SEG_RDK_BASE in the hard_config.h file
     31#endif
    2432
    2533///////////////////////////////////////////////////////////////////////////////
     
    5462#endif
    5563
    56     char* src = (char*)&seg_ram_disk_base + (512*lba);
     64#if USE_RAM_DISK
     65    char* src = (char*)SEG_RDK_BASE + (512*lba);
    5766    char* dst = (char*)buffer;
    5867    _memcpy( dst, src, count*512 );
    59 
    6068    return 0;
     69#else
     70    _printf("[GIET ERROR] _rdk_read() should not be used if USE_RAM_DISK not set\n");
     71    return 1;
     72#endif
    6173}
    6274
     
    8395#endif
    8496
    85     char* dst = (char*)&seg_ram_disk_base + (512*lba);
     97#if USE_RAM_DISK
     98    char* dst = (char*)SEG_RDK_BASE + (512*lba);
    8699    char* src = (char*)buffer;
    87100    _memcpy( dst, src, count*512 );
    88 
    89101    return 0;
     102#else
     103    _printf("[GIET ERROR] _rdk_write() should not be used if USE_RAM_DISK not set\n");
     104    return 1;
     105#endif
    90106}
    91107
Note: See TracChangeset for help on using the changeset viewer.