summaryrefslogtreecommitdiff
path: root/include/drivers/io_driver.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/drivers/io_driver.h')
-rw-r--r--include/drivers/io_driver.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/include/drivers/io_driver.h b/include/drivers/io_driver.h
index cc01d3b..f34c71d 100644
--- a/include/drivers/io_driver.h
+++ b/include/drivers/io_driver.h
@@ -39,7 +39,7 @@
/* Generic IO entity structure,representing an accessible IO construct on the
* device, such as a file */
typedef struct io_entity {
- io_dev_handle dev_handle;
+ struct io_dev_info *dev_handle;
uintptr_t info;
} io_entity_t;
@@ -47,7 +47,7 @@ typedef struct io_entity {
/* Device info structure, providing device-specific functions and a means of
* adding driver-specific state */
typedef struct io_dev_info {
- struct io_dev_funcs *funcs;
+ const struct io_dev_funcs *funcs;
uintptr_t info;
} io_dev_info_t;
@@ -55,23 +55,23 @@ typedef struct io_dev_info {
/* Structure used to create a connection to a type of device */
typedef struct io_dev_connector {
/* dev_open opens a connection to a particular device driver */
- int (*dev_open)(void *spec, io_dev_info_t **dev_info);
+ int (*dev_open)(const uintptr_t dev_spec, io_dev_info_t **dev_info);
} io_dev_connector_t;
/* Structure to hold device driver function pointers */
typedef struct io_dev_funcs {
io_type_t (*type)(void);
- int (*open)(io_dev_info_t *dev_info, const void *spec,
+ int (*open)(io_dev_info_t *dev_info, const uintptr_t spec,
io_entity_t *entity);
int (*seek)(io_entity_t *entity, int mode, ssize_t offset);
int (*size)(io_entity_t *entity, size_t *length);
- int (*read)(io_entity_t *entity, void *buffer, size_t length,
+ int (*read)(io_entity_t *entity, uintptr_t buffer, size_t length,
size_t *length_read);
- int (*write)(io_entity_t *entity, const void *buffer,
+ int (*write)(io_entity_t *entity, const uintptr_t buffer,
size_t length, size_t *length_written);
int (*close)(io_entity_t *entity);
- int (*dev_init)(io_dev_info_t *dev_info, const void *init_params);
+ int (*dev_init)(io_dev_info_t *dev_info, const uintptr_t init_params);
int (*dev_close)(io_dev_info_t *dev_info);
} io_dev_funcs_t;
@@ -79,7 +79,7 @@ typedef struct io_dev_funcs {
/* IO platform data - used to track devices registered for a specific
* platform */
typedef struct io_plat_data {
- io_dev_info_t *devices[MAX_IO_DEVICES];
+ const io_dev_info_t *devices[MAX_IO_DEVICES];
unsigned int dev_count;
} io_plat_data_t;
@@ -90,6 +90,6 @@ typedef struct io_plat_data {
void io_init(io_plat_data_t *data);
/* Register a device driver */
-int io_register_device(io_dev_info_t *dev_info);
+int io_register_device(const io_dev_info_t *dev_info);
#endif /* __IO_DRIVER_H__ */