Index: trunk/kernel/devices/dev_ioc.h
===================================================================
--- trunk/kernel/devices/dev_ioc.h	(revision 14)
+++ trunk/kernel/devices/dev_ioc.h	(revision 23)
@@ -38,10 +38,12 @@
  * magnetic hard disk or a SD card, that can store blocks of data in a linear array
  * of sectors indexed by a simple lba (logic block address).
- * It supports two command types:
- * - READ  : move a given number of contiguous blocks from device to a memory buffer.
- * - WRITE : move a given number of contiguous blocks from a memory buffer to device.
- *
- * An I/O operation requires dynamic ressource allocation, and is always blocking for
- * the client thread. The general scenario is detailed below.
+ * It supports three command types:
+ * - READ      : move blocks from device to memory, with a descheduling policy.
+ * - WRITE     : move blocks from memory to device, with a descheduling policy.
+ * - SYNC_READ : move blocks from device to memory, with a busy waiting policy.
+
+ * A READ or WRITE operation requires dynamic ressource allocation. The calling thread
+ * is descheduled, and the work is done by the server thread associated to IOC device.
+ * The general scenario is detailed below.
  * A) the client thread start the I/O operation, by calling the dev_ioc_read()
  *    or the dev_ioc_write() kernel functions that perform the following actions: 
@@ -50,5 +52,5 @@
  *    3) it access the PIC to link the WTI mailbox to the IOC IRQ.
  *    4) it builds the command descriptor.
- *    5) it registers in the IOCdevice waiting queue. 
+ *    5) it registers in the IOC device waiting queue. 
  *    6) itblock on the THREAD_BLOCKED_IO condition and deschedule.
  * B) The server thread attached to the IOC device descriptor handles the commands
@@ -61,4 +63,8 @@
  *    2) disable the WTI IRQ in the client cluster ICU and update interrupt vector.
  *    3) release the WTI mailbox to the client cluster WTI allocator.
+ *
+ * The SYNC_READ operation is used by the kernel in the initialisation phase. It does
+ * not uses the IOC device waiting queue and server thread, and does not use the IOC IRQ,
+ * but implement a busy-waiting policy for the calling thread.
  *****************************************************************************************/
 
@@ -93,8 +99,15 @@
  *****************************************************************************************/
 
+enum
+{
+    IOC_READ       = 0,
+    IOC_WRITE      = 1,
+    IOC_SYNC_READ  = 2,
+};
+
 typedef struct ioc_command_s
 {
-    xptr_t      dev_xp;      /*! extended pointer on device descriptor                    */
-    uint32_t    to_mem;     /*! requested operation (WRITE if zero / READ if non-zero)   */
+    xptr_t      dev_xp;     /*! extended pointer on device descriptor                    */
+    uint32_t    type;       /*! IOC_READ / IOC_WRITE / IOC_SYNC_READ                     */
     uint32_t    lba;        /*! first block index                                        */
     uint32_t    count;      /*! number of blocks                                         */
@@ -119,15 +132,15 @@
 /******************************************************************************************
  * This blocking function try to tranfer one or several contiguous blocks of data
- * from the block device to a memory buffer. The corresponding request is actually
+ * from the block device to a local memory buffer. The corresponding request is actually
  * registered in the device pending request queue, and the calling thread is descheduled,
  * waiting on transfer completion. It will be resumed by the IRQ signaling completion.
  * It must be called in the client cluster.
  ******************************************************************************************
- * @ buffer    : local pointer on target buffer in memory.
+ * @ buffer    : local pointer on target buffer in memory (must be block aligned).
  * @ lba       : first block index on device.
  * @ count     : number of blocks to transfer.
  * @ returns 0 if success / returns EINVAL if error.
  *****************************************************************************************/
-error_t dev_ioc_read( char         * buffer,
+error_t dev_ioc_read( uint8_t      * buffer,
                       uint32_t       lba,
                       uint32_t       count );
@@ -135,17 +148,34 @@
 /******************************************************************************************
  * This blocking function try to tranfer one or several contiguous blocks of data
- * from a memory buffer to the block device. The corresponding request is actually
+ * from a local memory buffer to the block device. The corresponding request is actually
  * registered in the device pending request queue, and the calling thread is descheduled,
  * waiting on transfer completion. It will be resumed by the IRQ signaling completion.
  * It must be called in the client cluster.
  ******************************************************************************************
- * @ buffer    : local pointer on source buffer in memory.
+ * @ buffer    : local pointer on source buffer in memory (must be block aligned).
  * @ lba       : first block index on device.
  * @ count     : number of blocks to transfer.
  * @ returns 0 if success / returns EINVAL if error.
  *****************************************************************************************/
-error_t dev_ioc_write( char         * buffer,
+error_t dev_ioc_write( uint8_t      * buffer,
                        uint32_t       lba,
                        uint32_t       count );
 
+/******************************************************************************************
+ * This blocking function try to tranfer one or several contiguous blocks of data
+ * from the block device to a memory buffer.
+ * It does  not uses the IOC device waiting queue and server thread, and does not use 
+ * the IOC IRQ, but call directly the relevant OIC driver, implementing a busy-waiting
+ * policy for the calling thread.
+ * It must be called in the client cluster.
+ ******************************************************************************************
+ * @ buffer    : local pointer on target buffer in memory (must be block aligned).
+ * @ lba       : first block index on device.
+ * @ count     : number of blocks to transfer.
+ * @ returns 0 if success / returns EINVAL if error.
+ *****************************************************************************************/
+error_t dev_ioc_sync_read( uint8_t      * buffer,
+                           uint32_t       lba,
+                           uint32_t       count );
+
 #endif	/* _DEV_IOC_H */
