From 148a058b4cecbcd5a8e832131aae9f5f7d6bb35f Mon Sep 17 00:00:00 2001 From: John Hodge Date: Tue, 1 Oct 2013 14:32:44 +0800 Subject: [PATCH] Modules/UDI - Removed dependence on acess.h from UDI headers --- KernelLand/Modules/Interfaces/UDI/include/udi.h | 15 +++++++++++++-- .../Modules/Interfaces/UDI/include/udi/arch/x86.h | 13 +++---------- .../Modules/Interfaces/UDI/include/udi/buf.h | 2 +- .../Modules/Interfaces/UDI/include/udi/init.h | 4 ++-- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/KernelLand/Modules/Interfaces/UDI/include/udi.h b/KernelLand/Modules/Interfaces/UDI/include/udi.h index 28f3497e..7eabc855 100644 --- a/KernelLand/Modules/Interfaces/UDI/include/udi.h +++ b/KernelLand/Modules/Interfaces/UDI/include/udi.h @@ -4,10 +4,21 @@ #ifndef _UDI_H_ #define _UDI_H_ -// Use the core acess file to use the specific size types (plus va_arg) -#include +#include +#include +typedef int8_t udi_sbit8_t; /* signed 8-bit: -2^7..2^7-1 */ +typedef int16_t udi_sbit16_t; /* signed 16-bit: -2^15..2^15-1 */ +typedef int32_t udi_sbit32_t; /* signed 32-bit: -2^31..2^31-1 */ +typedef uint8_t udi_ubit8_t; /* unsigned 8-bit: 0..28-1 */ +typedef uint16_t udi_ubit16_t; /* unsigned 16-bit: 0..216-1 */ +typedef uint32_t udi_ubit32_t; /* unsigned 32-bit: 0..232-1 */ + +#if UDI_ABI_is_ia32 #include "udi/arch/x86.h" +#else +#error "Unknown UDI ABI" +#endif /** * \name Values and Flags for udi_status_t diff --git a/KernelLand/Modules/Interfaces/UDI/include/udi/arch/x86.h b/KernelLand/Modules/Interfaces/UDI/include/udi/arch/x86.h index e81b29ca..3018e8ab 100644 --- a/KernelLand/Modules/Interfaces/UDI/include/udi/arch/x86.h +++ b/KernelLand/Modules/Interfaces/UDI/include/udi/arch/x86.h @@ -2,18 +2,11 @@ #ifndef _UDI_ARCH_x86_H_ #define _UDI_ARCH_x86_H_ -typedef Sint8 udi_sbit8_t; /* signed 8-bit: -2^7..2^7-1 */ -typedef Sint16 udi_sbit16_t; /* signed 16-bit: -2^15..2^15-1 */ -typedef Sint32 udi_sbit32_t; /* signed 32-bit: -2^31..2^31-1 */ -typedef Uint8 udi_ubit8_t; /* unsigned 8-bit: 0..28-1 */ -typedef Uint16 udi_ubit16_t; /* unsigned 16-bit: 0..216-1 */ -typedef Uint32 udi_ubit32_t; /* unsigned 32-bit: 0..232-1 */ - typedef udi_ubit8_t udi_boolean_t; /* 0=False; 1..28-1=True */ #define FALSE 0 #define TRUE 1 -typedef size_t udi_size_t; /* buffer size */ +typedef uint32_t udi_size_t; /* buffer size */ typedef udi_ubit8_t udi_index_t; /* zero-based index type */ typedef void *_udi_handle_t; @@ -32,10 +25,10 @@ typedef _udi_handle_t udi_buf_path_t; typedef _udi_handle_t udi_origin_t; #define UDI_NULL_ORIGIN _NULL_HANDLE -typedef Sint64 udi_timestamp_t; +typedef int64_t udi_timestamp_t; #define UDI_HANDLE_IS_NULL(handle, handle_type) (handle == NULL) -#define UDI_HANDLE_ID(handle, handle_type) ((Uint32)handle) +#define UDI_HANDLE_ID(handle, handle_type) ((uint32_t)handle) /** * \name va_arg wrapper diff --git a/KernelLand/Modules/Interfaces/UDI/include/udi/buf.h b/KernelLand/Modules/Interfaces/UDI/include/udi/buf.h index fa2428b7..e82651f3 100644 --- a/KernelLand/Modules/Interfaces/UDI/include/udi/buf.h +++ b/KernelLand/Modules/Interfaces/UDI/include/udi/buf.h @@ -17,7 +17,7 @@ typedef void udi_buf_write_call_t(udi_cb_t *gcb, udi_buf_t *new_dst_buf); struct udi_buf_s { udi_size_t buf_size; - Uint8 Data[]; //!< ENVIRONMENT ONLY + udi_ubit8_t Data[]; //!< ENVIRONMENT ONLY }; /** diff --git a/KernelLand/Modules/Interfaces/UDI/include/udi/init.h b/KernelLand/Modules/Interfaces/UDI/include/udi/init.h index 177e989d..a4d9142b 100644 --- a/KernelLand/Modules/Interfaces/UDI/include/udi/init.h +++ b/KernelLand/Modules/Interfaces/UDI/include/udi/init.h @@ -259,7 +259,7 @@ struct udi_limits_s * \see ::udi_timer_start_repeating, ::udi_timer_start */ udi_ubit32_t min_timer_res; -} PACKED; +} __attribute__((packed)); /** * \brief Primary Region Context data @@ -279,7 +279,7 @@ struct udi_chan_context_s * \brief Pointer to the driver instance's initial region data */ void *rdata; -} PACKED; +} __attribute__((packed)); /** * \brief Child Channel context -- 2.20.1