From 22b7f0ec743c1bd8b856183c36ae60b8784ae8f8 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Sun, 22 May 2005 02:57:14 +0000 Subject: [PATCH] Define PXE types in terms of other PXE types where possible --- src/include/pxe_types.h | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/src/include/pxe_types.h b/src/include/pxe_types.h index ce33f4d9..74815f67 100644 --- a/src/include/pxe_types.h +++ b/src/include/pxe_types.h @@ -17,7 +17,7 @@ /** @defgroup pxe_types PXE data types * - * Basic PXE data types such as #UINT16, #ADDR32, #SEGSEL etc. + * Basic PXE data types such as #UINT16_t, #ADDR32_t, #SEGSEL_t etc. * * These definitions are based on Table 1-1 ("Data Type Definitions") * in the Intel PXE specification version 2.1. They have been @@ -40,7 +40,7 @@ typedef uint32_t UINT32_t; * Permitted values are #PXENV_EXIT_SUCCESS and #PXENV_EXIT_FAILURE. * */ -typedef uint16_t PXENV_EXIT_t; +typedef UINT16_t PXENV_EXIT_t; #define PXENV_EXIT_SUCCESS 0x0000 /**< No error occurred */ #define PXENV_EXIT_FAILURE 0x0001 /**< An error occurred */ @@ -49,35 +49,37 @@ typedef uint16_t PXENV_EXIT_t; * Status codes are defined in errno.h. * */ -typedef uint16_t PXENV_STATUS_t; +typedef UINT16_t PXENV_STATUS_t; /** An IP address. * * This is an IPv4 address in host byte order. * */ -typedef uint32_t IP4_t; +typedef UINT32_t IP4_t; /** A UDP port. * * @note This data type is in network (big-endian) byte order. * */ -typedef uint16_t UDP_PORT_t; +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_t[MAC_ADDR_LEN]; +typedef UINT8_t MAC_ADDR_t[MAC_ADDR_LEN]; +#ifndef HAVE_ARCH_ADDR32 /** A physical address. * * For x86, this is a 32-bit physical address, and is therefore * limited to the low 4GB. * */ -typedef physaddr_t ADDR32_t; +typedef UINT32_t ADDR32_t; +#endif #ifndef HAVE_ARCH_SEGSEL /** A segment selector. @@ -87,15 +89,24 @@ typedef physaddr_t ADDR32_t; * segment register. * */ -typedef uint16_t SEGSEL_t; +typedef UINT16_t SEGSEL_t; #endif #ifndef HAVE_ARCH_OFF16 -/** An offset within a segment identified by #SEGSEL */ -typedef uint16_t OFF16_t; +/** An offset within a segment identified by #SEGSEL + * + * For x86, this is a 16-bit offset. + * + */ +typedef UINT16_t OFF16_t; #endif -/** A segment:offset address */ +/** A segment:offset address + * + * For x86, this is a 16-bit real-mode or protected-mode + * segment:offset address. + * + */ typedef struct s_SEGOFF16 { OFF16_t offset; /**< Offset within the segment */ SEGSEL_t segment; /**< Segment selector */