diff options
Diffstat (limited to 'src/include/pxe_types.h')
-rw-r--r-- | src/include/pxe_types.h | 57 |
1 files changed, 30 insertions, 27 deletions
diff --git a/src/include/pxe_types.h b/src/include/pxe_types.h index 4d8917a5..ce33f4d9 100644 --- a/src/include/pxe_types.h +++ b/src/include/pxe_types.h @@ -1,10 +1,6 @@ #ifndef PXE_TYPES_H #define PXE_TYPES_H -/** @addtogroup pxe Preboot eXecution Environment (PXE) API - * @{ - */ - /** @file * * PXE data types @@ -15,8 +11,14 @@ #include "pxe_addr.h" /* Architecture-specific PXE definitions */ #include "errno.h" /* PXE status codes */ +/** @addtogroup pxe Preboot eXecution Environment (PXE) API + * @{ + */ + /** @defgroup pxe_types PXE data types * + * Basic PXE data types such as #UINT16, #ADDR32, #SEGSEL etc. + * * These definitions are based on Table 1-1 ("Data Type Definitions") * in the Intel PXE specification version 2.1. They have been * generalised to non-x86 architectures where possible. @@ -25,47 +27,49 @@ */ /** An 8-bit unsigned integer */ -typedef uint8_t UINT8; +typedef uint8_t UINT8_t; /** A 16-bit unsigned integer */ -typedef uint16_t UINT16; +typedef uint16_t UINT16_t; /** A 32-bit unsigned integer */ -typedef uint32_t UINT32; +typedef uint32_t UINT32_t; /** A PXE exit code. * - * Permitted values are PXENV_EXIT_SUCCESS and PXENV_EXIT_FAILURE. + * Permitted values are #PXENV_EXIT_SUCCESS and #PXENV_EXIT_FAILURE. * */ -typedef uint16_t PXENV_EXIT; +typedef uint16_t PXENV_EXIT_t; +#define PXENV_EXIT_SUCCESS 0x0000 /**< No error occurred */ +#define PXENV_EXIT_FAILURE 0x0001 /**< An error occurred */ /** A PXE status code. * * Status codes are defined in errno.h. * */ -typedef uint16_t PXENV_STATUS; +typedef uint16_t PXENV_STATUS_t; /** An IP address. * * This is an IPv4 address in host byte order. * */ -typedef uint32_t IP4; +typedef uint32_t IP4_t; /** A UDP port. * - * Note that this is in network (big-endian) byte order. + * @note This data type is in network (big-endian) byte order. * */ -typedef uint16_t UDP_PORT; +typedef uint16_t UDP_PORT_t; /** Maximum length of a MAC address */ #define MAC_ADDR_LEN 16 /** A MAC address */ -typedef uint8_t MAC_ADDR[MAC_ADDR_LEN]; +typedef uint8_t MAC_ADDR_t[MAC_ADDR_LEN]; /** A physical address. * @@ -73,7 +77,7 @@ typedef uint8_t MAC_ADDR[MAC_ADDR_LEN]; * limited to the low 4GB. * */ -typedef physaddr_t ADDR32; +typedef physaddr_t ADDR32_t; #ifndef HAVE_ARCH_SEGSEL /** A segment selector. @@ -83,30 +87,29 @@ typedef physaddr_t ADDR32; * segment register. * */ -typedef uint16_t SEGSEL; +typedef uint16_t SEGSEL_t; #endif #ifndef HAVE_ARCH_OFF16 /** An offset within a segment identified by #SEGSEL */ -typedef uint16_t OFF16; +typedef uint16_t OFF16_t; #endif /** A segment:offset address */ typedef struct s_SEGOFF16 { - OFF16 offset; /**< Offset within the segment */ - SEGSEL segment; /**< Segment selector */ -} SEGOFF16 __attribute__ (( packed )); + OFF16_t offset; /**< Offset within the segment */ + SEGSEL_t segment; /**< Segment selector */ +} PACKED SEGOFF16_t; /** A segment descriptor */ typedef struct s_SEGDESC { - SEGSEL segment_address; /**< Segment selector */ - ADDR32 physical_address; /**< Base address of the segment */ - OFF16 seg_size; /**< Size of the segment */ -} SEGDESC __attribute__ (( packed )); - -/** @} */ /* defgroup */ + SEGSEL_t segment_address; /**< Segment selector */ + ADDR32_t physical_address; /**< Segment base address */ + OFF16_t seg_size; /**< Size of the segment */ +} PACKED __SEGDESC_t; +/** @} */ /* pxe_types */ -/** @} */ /* addtogroup */ +/** @} */ /* pxe */ #endif /* PXE_TYPES_H */ |