Browse Source

Define PXE types in terms of other PXE types where possible

tags/v0.9.3
Michael Brown 20 years ago
parent
commit
22b7f0ec74
1 changed files with 22 additions and 11 deletions
  1. 22
    11
      src/include/pxe_types.h

+ 22
- 11
src/include/pxe_types.h View File

17
 
17
 
18
 /** @defgroup pxe_types PXE data types
18
 /** @defgroup pxe_types PXE data types
19
  *
19
  *
20
- * Basic PXE data types such as #UINT16, #ADDR32, #SEGSEL etc.
20
+ * Basic PXE data types such as #UINT16_t, #ADDR32_t, #SEGSEL_t etc.
21
  *
21
  *
22
  * These definitions are based on Table 1-1 ("Data Type Definitions")
22
  * These definitions are based on Table 1-1 ("Data Type Definitions")
23
  * in the Intel PXE specification version 2.1.  They have been
23
  * in the Intel PXE specification version 2.1.  They have been
40
  * Permitted values are #PXENV_EXIT_SUCCESS and #PXENV_EXIT_FAILURE.
40
  * Permitted values are #PXENV_EXIT_SUCCESS and #PXENV_EXIT_FAILURE.
41
  *
41
  *
42
  */
42
  */
43
-typedef uint16_t PXENV_EXIT_t;
43
+typedef UINT16_t PXENV_EXIT_t;
44
 #define PXENV_EXIT_SUCCESS	0x0000	/**< No error occurred */
44
 #define PXENV_EXIT_SUCCESS	0x0000	/**< No error occurred */
45
 #define PXENV_EXIT_FAILURE	0x0001	/**< An error occurred */
45
 #define PXENV_EXIT_FAILURE	0x0001	/**< An error occurred */
46
 
46
 
49
  * Status codes are defined in errno.h.
49
  * Status codes are defined in errno.h.
50
  *
50
  *
51
  */
51
  */
52
-typedef uint16_t PXENV_STATUS_t;
52
+typedef UINT16_t PXENV_STATUS_t;
53
 
53
 
54
 /** An IP address.
54
 /** An IP address.
55
  *
55
  *
56
  * This is an IPv4 address in host byte order.
56
  * This is an IPv4 address in host byte order.
57
  *
57
  *
58
  */
58
  */
59
-typedef uint32_t IP4_t;
59
+typedef UINT32_t IP4_t;
60
 
60
 
61
 /** A UDP port.
61
 /** A UDP port.
62
  *
62
  *
63
  * @note This data type is in network (big-endian) byte order.
63
  * @note This data type is in network (big-endian) byte order.
64
  *
64
  *
65
  */
65
  */
66
-typedef uint16_t UDP_PORT_t;
66
+typedef UINT16_t UDP_PORT_t;
67
 
67
 
68
 /** Maximum length of a MAC address */
68
 /** Maximum length of a MAC address */
69
 #define MAC_ADDR_LEN 16
69
 #define MAC_ADDR_LEN 16
70
 
70
 
71
 /** A MAC address */
71
 /** A MAC address */
72
-typedef uint8_t MAC_ADDR_t[MAC_ADDR_LEN];
72
+typedef UINT8_t MAC_ADDR_t[MAC_ADDR_LEN];
73
 
73
 
74
+#ifndef HAVE_ARCH_ADDR32
74
 /** A physical address.
75
 /** A physical address.
75
  *
76
  *
76
  * For x86, this is a 32-bit physical address, and is therefore
77
  * For x86, this is a 32-bit physical address, and is therefore
77
  * limited to the low 4GB.
78
  * limited to the low 4GB.
78
  *
79
  *
79
  */
80
  */
80
-typedef physaddr_t ADDR32_t;
81
+typedef UINT32_t ADDR32_t;
82
+#endif
81
 
83
 
82
 #ifndef HAVE_ARCH_SEGSEL
84
 #ifndef HAVE_ARCH_SEGSEL
83
 /** A segment selector.
85
 /** A segment selector.
87
  * segment register.
89
  * segment register.
88
  *
90
  *
89
  */
91
  */
90
-typedef uint16_t SEGSEL_t;
92
+typedef UINT16_t SEGSEL_t;
91
 #endif
93
 #endif
92
 
94
 
93
 #ifndef HAVE_ARCH_OFF16
95
 #ifndef HAVE_ARCH_OFF16
94
-/** An offset within a segment identified by #SEGSEL */
95
-typedef uint16_t OFF16_t;
96
+/** An offset within a segment identified by #SEGSEL
97
+ *
98
+ * For x86, this is a 16-bit offset.
99
+ *
100
+ */
101
+typedef UINT16_t OFF16_t;
96
 #endif
102
 #endif
97
 
103
 
98
-/** A segment:offset address */
104
+/** A segment:offset address
105
+ *
106
+ * For x86, this is a 16-bit real-mode or protected-mode
107
+ * segment:offset address.
108
+ *
109
+ */
99
 typedef struct s_SEGOFF16 {
110
 typedef struct s_SEGOFF16 {
100
 	OFF16_t		offset;		/**< Offset within the segment */
111
 	OFF16_t		offset;		/**< Offset within the segment */
101
 	SEGSEL_t	segment;	/**< Segment selector */
112
 	SEGSEL_t	segment;	/**< Segment selector */

Loading…
Cancel
Save