| 1 | = GIET-VM / RDK Driver = |
| 2 | |
| 3 | [[PageOutline]] |
| 4 | |
| 5 | The [source:soft/giet_vm/giet_drivers/rdk_driver.c rdk_driver.c] and [source:soft/giet_vm/giet_drivers/rdk_driver.h rdk_driver.h] files define the RDK driver. |
| 6 | |
| 7 | This driver supports a virtual disk implemented as a memory segment, in the physical address space. |
| 8 | |
| 9 | It is one of the physical disk driver that can be called by the generic IOC driver. |
| 10 | |
| 11 | The _rdk_read() and _rdk_write() blocking functions use a software memcpy, whatever the selected mode (BOOT / KERNEL / USER). |
| 12 | These blocking functions return only when the transfer is completed. |
| 13 | As the number of concurrent accesses is not bounded, these functions don't use the _ioc_lock variable. |
| 14 | |
| 15 | The SEG_RDK_BASE virtual address must be defined in the hard_config.h file when the USE_RAMDISK flag is set. |
| 16 | |
| 17 | #ifndef _GIET_RDK_DRIVERS_H_ |
| 18 | #define _GIET_RDK_DRIVERS_H_ |
| 19 | |
| 20 | === unsigned int '''_rdk_init()''' === |
| 21 | This function does nothing, but is required by the generic IOC API. |
| 22 | |
| 23 | === unsigned int '''_rdk_read'''( unsigned int lba, unsigned int buffer, unsigned int count ) === |
| 24 | This function transfer data from the RAMDISK to a memory buffer. |
| 25 | * mode : BOOT / KERNEL / USER (unused) |
| 26 | * lba : first block index on the block device |
| 27 | * buffer : virtual base address of the memory buffer |
| 28 | * count : number of blocks to be transfered. |
| 29 | Returns 0 if success, > 0 if error. |
| 30 | |
| 31 | === unsigned int '''_rdk_write'''( unsigned int lba, unsigned int buffer, unsigned int count ) === |
| 32 | This function transfer data from a memory buffer to the RAMDISK. |
| 33 | * mode : BOOT / KERNEL / USER (unused) |
| 34 | * lba : first block index on the block device |
| 35 | * buffer : virtual base address of the memory buffer |
| 36 | * count : number of blocks to be transfered. |
| 37 | Returns 0 if success, > 0 if error. |
| 38 | |
| 39 | === unsigned int '''_rdk_get_block_size'''() === |
| 40 | This function returns the block size. |
| 41 | |
| 42 | === unsigned int '''_rdk_get_status'''() === |
| 43 | This function returns always 0, but is required bi the generic IOC API. |
| 44 | |
| 45 | |