26 | | * In BOOT mode, these functions use the buffer virtual address as a physical address if the MMU is not activated. They make a V2P translation if the MMU is activated. This mode is used to load the map.bin file (before memory activation), or to load the various .elf files (after MMU activation). |
27 | | * In KERNEL mode, these functions make a V2P translation to compute the buffer physical address. There is no checking of user access right to the memory buffer. This mode must be used for an ''open'' system call. |
28 | | * In USER mode, these functions make a V2P translation to compute the buffer physical address. The user access right to the memory buffer are checked. This mode must be used for a ''read'' or ''write'' system call. |
| 26 | * In '''BOOT''' mode, these functions use the buffer virtual address as a physical address if the MMU is not activated. They make a V2P translation if the MMU is activated. This mode is used to load the map.bin file (before memory activation), or to load the various .elf files (after MMU activation). |
| 27 | * In '''KERNEL''' mode, these functions make a V2P translation to compute the buffer physical address. There is no checking of user access right to the memory buffer. This mode must be used for an ''open'' system call. |
| 28 | * In '''USER''' mode, these functions make a V2P translation to compute the buffer physical address. The user access right to the memory buffer are checked. This mode must be used for a ''read'' or ''write'' system call. |
| 41 | |
| 42 | |
| 43 | === unsigned int '''_ioc_init'''( unsigned int channel ) === |
| 44 | This function cheks block size, and desactivates interrupts. |
| 45 | Return 0 for success, non zero if error. |
| 46 | |
| 47 | === unsigned int '''_ioc_write'''( unsigned int channel, unsigned int mode, unsigned int lba, const void* buffer, unsigned int count ) === |
| 48 | Transfer data from a memory buffer to the disk. |
| 49 | * channel : channel index (for multi-channels peripherals) |
| 50 | * mode : BOOT / KERNEL / USER |
| 51 | * lba : first block index on the block device |
| 52 | * buffer : base address of the memory buffer (must be word aligned) |
| 53 | * count : number of blocks to be transfered. |
| 54 | Returns 0 if success, > 0 if error. |
| 55 | |
| 56 | === unsigned int '''_ioc_read'''( unsigned int channel, unsigned int mode, unsigned int lba, void* buffer, unsigned int count ) === |
| 57 | Transfer data from the disk to a memory buffer. |
| 58 | * channel : channel index (for multi-channels peripherals) |
| 59 | * mode : BOOT / KERNEL / USER |
| 60 | * lba : first block index on the block device |
| 61 | * buffer : base address of the memory buffer (must be word aligned) |
| 62 | * count : number of blocks to be transfered. |
| 63 | Returns 0 if success, > 0 if error. |
| 64 | |
| 65 | === unsigned int '''_ioc_get_status'''( unsigned int channel ) === |
| 66 | This function returns in the status variable, the transfert status, and acknowledge the IRQ if required. |
| 67 | Returns 0 if success, > 0 if error |
| 68 | |
| 69 | === unsigned int '''_ioc_get_block_size'''() === |
| 70 | This function returns the block_size for the block device. |
| 71 | |