]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/ibl.git/blob - src/iblloc.h
c6x-IBL: Additions to the gel File
[keystone-rtos/ibl.git] / src / iblloc.h
1 /****************************************************************************
2  * FILE PURPOSE: Local inter-module definitions for the IBL
3  ****************************************************************************
4  * FILE NAME: iblloc.h
5  *
6  * DESCRIPTION: Defines global structures used throughout the IBL
7  *
8  * @file iblloc.h
9  *
10  * @brief
11  *    Provides global inter-module definitions
12  *
13  *****************************************************************************/
14 #ifndef IBLLOC_H
15 #define IBLLOC_H
17 #include "types.h"
19 typedef struct BOOT_MODULE_FXN_TABLE
20 {
21     /**
22      * @brief   The API is called by the kernel to open the specific
23      * boot module. This is used by boot module to initialize themselves
24      * and the peripheral drivers.
25      */
26     Int32 (*open)(void* ptr_driver, void (*asyncComplete)(void *));
28     /**
29      * @brief   The API is called by the kernel to close the boot module
30      * Boot Modules use this API and to close themselves and the peripheral 
31      * drivers.
32      */
33     Int32 (*close)(void);
35     /**
36      * @brief   The API is called by the kernel to read a specific number
37      * of bytes from the boot module and to populate the data buffer.
38      */
39     Int32 (*read)(Uint8* ptr_buf, Uint32 num_bytes);
41     /**
42      * @brief   The API is called by the kernel to write a specific number
43      * of bytes to the boot module from the data buffer. This is *optional*
44      */
45     Int32 (*write)(Uint8* ptr_buf, Uint32 num_bytes);
47     /**
48      * @brief   This API is called by the kernal to peek at some bytes
49      * without removing them from the buffer
50      */
51     Int32 (*peek)(Uint8 *ptr_buf, Uint32 num_bytes);
52     
53     /**
54      * @brief   This API is called by the kernel to move the read/write
55      *          pointers in the buffer. The values of parameter from
56      *          match those of fseek - 0 = from start of file,
57      *          1 = from current position, 2 = from end of file.
58      *          Returns 0 if the seek is successful, -1 if it failed.
59      */
60     Int32 (*seek)(Int32 loc, Int32 from);
61     
62    /**
63     * @brief    This API is called by the kernel to determine how much data
64     *           is currently available for immediate read. Returns -1 if
65     *           the stream has been closed.
66     */
67    Int32 (*query)(void);
68     
69     
70 }BOOT_MODULE_FXN_TABLE;
73 /* Prototypes */
74 Uint32 iblBoot (BOOT_MODULE_FXN_TABLE *bootFxn, int32 dataFormat, void *formatParams);
77 /* squash printfs */
78 void mprintf(char *x, ...);
80 #endif /* _IBLLOC_H */