From e164eecc55dd96efc98d2c723e96aaaecdcfda13 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Sun, 4 Oct 2015 15:39:08 -0400 Subject: off_t => hal_addr_t. --- hal.h | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'hal.h') diff --git a/hal.h b/hal.h index 4a5e239..374fdb5 100644 --- a/hal.h +++ b/hal.h @@ -459,6 +459,17 @@ typedef enum { HAL_ERROR_LIST N_HAL_ERRORS } hal_error_t; #include #include +/* + * Typedef to isolate code from our current choice of representation + * for a Cryptech bus address. + */ + +typedef off_t hal_addr_t; + +/* + * Error translation. + */ + extern const char *hal_error_string(const hal_error_t err); /* @@ -466,14 +477,14 @@ extern const char *hal_error_string(const hal_error_t err); */ extern void hal_io_set_debug(int onoff); -extern hal_error_t hal_io_write(off_t offset, const uint8_t *buf, size_t len); -extern hal_error_t hal_io_read(off_t offset, uint8_t *buf, size_t len); -extern hal_error_t hal_io_expected(off_t offset, const uint8_t *expected, size_t len); -extern hal_error_t hal_io_init(off_t offset); -extern hal_error_t hal_io_next(off_t offset); -extern hal_error_t hal_io_wait(off_t offset, uint8_t status, int *count); -extern hal_error_t hal_io_wait_ready(off_t offset); -extern hal_error_t hal_io_wait_valid(off_t offset); +extern hal_error_t hal_io_write(hal_addr_t offset, const uint8_t *buf, size_t len); +extern hal_error_t hal_io_read(hal_addr_t offset, uint8_t *buf, size_t len); +extern hal_error_t hal_io_expected(hal_addr_t offset, const uint8_t *expected, size_t len); +extern hal_error_t hal_io_init(hal_addr_t offset); +extern hal_error_t hal_io_next(hal_addr_t offset); +extern hal_error_t hal_io_wait(hal_addr_t offset, uint8_t status, int *count); +extern hal_error_t hal_io_wait_ready(hal_addr_t offset); +extern hal_error_t hal_io_wait_valid(hal_addr_t offset); /* * Higher level public API. -- cgit v1.2.3