wiki:rdk_driver

Version 5 (modified by alain, 9 years ago) (diff)

--

GIET-VM / RDK Driver

The rdk_driver.c and rdk_driver.h files define the RDK driver.

This driver supports a RAMDISK, that is a virtual disk implemented as a memory segment, in the physical address space. The ramdisk vseg must be defined in the mapping.

This driver is called by the generic FAT handler, when the USE_IOC_RDK flag is set in the hard_config.h file.

The _rdk_access() function uses a software memcpy whatever the requested mode (synchronous or descheduling), and returns only when the transfer is completed.

As the number of concurrent accesses is not bounded, these functions don't use any lock.

The SEG_RDK_BASE virtual address must be defined in the hard_config.h file when the USE_IOC_RDK flag is set.

Access function

unsigned int _rdk_access( unsigned int use_irq , unsigned int to_mem , unsigned int lba , unsigned int buffer , unsigned int count )

This function transfer data between the RAMDISK and a memory buffer.

  • use_irq : unused, access is always synchronous
  • to_mem : Boolean to memory when non zero
  • lba : first block index on the block device
  • buffer : virtual base address of the memory buffer
  • count : number of blocks to be transfered.

Returns 0 if success, > 0 if error.