Ignore:
Timestamp:
Nov 3, 2014, 10:53:00 AM (10 years ago)
Author:
alain
Message:

Introducing dynamic allocation of peripheral channel(TTY, NIC, TIM, CMA)
Removint the ICU driver : ICU component not supported anymore.
Removing the FBF driver.

File:
1 edited

Legend:

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

    r405 r437  
    66// Copyright (c) UPMC-LIP6
    77///////////////////////////////////////////////////////////////////////////////////
    8 // The rdk_driver.c and rdk_driver.h files are part ot the GIET-VM kernel.
    9 //
    10 // This driver supports a virtual disk implemented as a memory segment,
    11 // in the address space.
    12 //
    13 // The _rdk_read() and _rdk_write() blocking functions use a software memcpy,
    14 // whatever the selected mode. They return only when the transfer is completed.
    15 // As the number of concurrent accesses is not bounded, these functions
    16 // 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.
    20 ///////////////////////////////////////////////////////////////////////////////////
    218
    229#include <giet_config.h>
     
    2411#include <rdk_driver.h>
    2512#include <utils.h>
    26 #include <tty_driver.h>
    27 #include <ctx_handler.h>
    2813
    2914#if !defined(SEG_RDK_BASE)
     
    3116#endif
    3217
    33 ///////////////////////////////////////////////////////////////////////////////
    34 //       _rdk_init()
    35 // This function does nothing, and return 0 for success.
    36 ///////////////////////////////////////////////////////////////////////////////
     18//////////////////////////////////////////////
    3719unsigned int _rdk_init( unsigned int channel )
    3820{
     
    4022}
    4123
    42 ///////////////////////////////////////////////////////////////////////////////
    43 //     _rdk_read()
    44 // Transfer data from the RAMDISK to a memory buffer.
    45 // - mode     : BOOT / KERNEL / USER
    46 // - lba      : first block index on the block device
    47 // - buffer   : virtual base address of the memory buffer
    48 // - count    : number of blocks to be transfered.
    49 // Returns 0 if success, > 0 if error.
    50 ///////////////////////////////////////////////////////////////////////////////
     24//////////////////////////////////////////
    5125unsigned int _rdk_read( unsigned int lba,
    5226                        unsigned int buffer,
    5327                        unsigned int count)
    5428{
     29#if USE_IOC_RDK
    5530
    5631#if GIET_DEBUG_IOC_DRIVER
    57 _printf("\n[IOC DEBUG] Enter _rdk_read() at cycle %d"
    58         "\n - vaddr   = %x"
    59         "\n - sectors = %d"
    60         "\n - lba     = %x",
    61         _get_proctime(), buffer, count, lba );
     32_puts("\n[IOC DEBUG] Enter _rdk_read() at cycle ");
     33_putd( _get_proctime() );
     34_puts("\n - vaddr   = ");
     35_putx( buffer );
     36-puts("\n - sectors = ");
     37_putd( count );
     38-puts("\n - lba     = ");
     39_putx( lba );
     40_puts("\n");
    6241#endif
    6342
    64 #if USE_IOC_RDK
    6543    char* src = (char*)SEG_RDK_BASE + (512*lba);
    6644    char* dst = (char*)buffer;
    6745    memcpy( dst, src, count*512 );
    6846    return 0;
     47
    6948#else
    70     _printf("[GIET ERROR] _rdk_read() should not be used if USE_IOC_RDK not set\n");
     49
     50    _puts("[GIET ERROR] _rdk_read() should not be used if USE_IOC_RDK not set\n");
    7151    return 1;
     52
    7253#endif
    7354}
    7455
    75 ///////////////////////////////////////////////////////////////////////////////
    76 //     _rdk_write()
    77 // Transfer data from a memory buffer to the block device.
    78 // - mode     : BOOT / KERNEL / USER
    79 // - lba      : first block index on the block device
    80 // - buffer   : virtual base address of the memory buffer
    81 // - count    : number of blocks to be transfered.
    82 // Returns 0 if success, > 0 if error.
    83 ///////////////////////////////////////////////////////////////////////////////
     56//////////////////////////////////////////
    8457unsigned int _rdk_write( unsigned int lba,
    8558                         unsigned int buffer,
    8659                         unsigned int count )
    8760{
     61#if USE_IOC_RDK
    8862
    8963#if GIET_DEBUG_IOC_DRIVER
    90 _printf("\n[IOC DEBUG] Enter _rdk_write() at cycle %d"
    91         "\n - vaddr   = %x"
    92         "\n - sectors = %d"
    93         "\n - lba     = %x",
    94         _get_proctime(), buffer, count, lba );
     64_puts("\n[IOC DEBUG] Enter _rdk_write() at cycle ");
     65_putd( _get_proctime() );
     66_puts("\n - vaddr   = ");
     67_putx( buffer );
     68-puts("\n - sectors = ");
     69_putd( count );
     70-puts("\n - lba     = ");
     71_putx( lba );
     72_puts("\n");
    9573#endif
    9674
    97 #if USE_IOC_RDK
    9875    char* dst = (char*)SEG_RDK_BASE + (512*lba);
    9976    char* src = (char*)buffer;
    10077    memcpy( dst, src, count*512 );
    10178    return 0;
     79
    10280#else
    103     _printf("[GIET ERROR] _rdk_write() should not be used if USE_IOC_RDK not set\n");
     81
     82    _puts("[GIET ERROR] _rdk_write() should not be used if USE_IOC_RDK not set\n");
    10483    return 1;
     84
    10585#endif
    10686}
    10787
    108 ///////////////////////////////////////////////////////////////////////////////
    109 //     _rdk_get_block_size()
    110 // This function returns the block_size.
    111 ///////////////////////////////////////////////////////////////////////////////
     88//////////////////////////////////
    11289unsigned int _rdk_get_block_size()
    11390{
    11491    return 512;
     92}
     93
     94//////////////////////////////
     95unsigned int _rdk_get_status()
     96{
     97    return 0;
    11598}
    11699
Note: See TracChangeset for help on using the changeset viewer.