Browse Source

Documented the basic PXE data types

tags/v0.9.3
Michael Brown 20 years ago
parent
commit
8355ce8a32
1 changed files with 112 additions and 0 deletions
  1. 112
    0
      src/include/pxe_types.h

+ 112
- 0
src/include/pxe_types.h View File

@@ -0,0 +1,112 @@
1
+#ifndef PXE_TYPES_H
2
+#define PXE_TYPES_H
3
+
4
+/** @addtogroup pxe Preboot eXecution Environment (PXE) API
5
+ * @{
6
+ */
7
+
8
+/** @file
9
+ *
10
+ * PXE data types
11
+ *
12
+ */
13
+
14
+#include "stdint.h"
15
+#include "pxe_addr.h" /* Architecture-specific PXE definitions */
16
+#include "errno.h" /* PXE status codes */
17
+
18
+/** @defgroup pxe_types PXE data types
19
+ *
20
+ * These definitions are based on Table 1-1 ("Data Type Definitions")
21
+ * in the Intel PXE specification version 2.1.  They have been
22
+ * generalised to non-x86 architectures where possible.
23
+ *
24
+ * @{
25
+ */
26
+
27
+/** An 8-bit unsigned integer */
28
+typedef uint8_t UINT8;
29
+
30
+/** A 16-bit unsigned integer */
31
+typedef uint16_t UINT16;
32
+
33
+/** A 32-bit unsigned integer */
34
+typedef uint32_t UINT32;
35
+
36
+/** A PXE exit code.
37
+ *
38
+ * Permitted values are PXENV_EXIT_SUCCESS and PXENV_EXIT_FAILURE.
39
+ *
40
+ */
41
+typedef uint16_t PXENV_EXIT;
42
+
43
+/** A PXE status code.
44
+ *
45
+ * Status codes are defined in errno.h.
46
+ *
47
+ */
48
+typedef uint16_t PXENV_STATUS;
49
+
50
+/** An IP address.
51
+ *
52
+ * This is an IPv4 address in host byte order.
53
+ *
54
+ */
55
+typedef uint32_t IP4;
56
+
57
+/** A UDP port.
58
+ *
59
+ * Note that this is in network (big-endian) byte order.
60
+ *
61
+ */
62
+typedef uint16_t UDP_PORT;
63
+
64
+/** Maximum length of a MAC address */
65
+#define MAC_ADDR_LEN 16
66
+
67
+/** A MAC address */
68
+typedef uint8_t MAC_ADDR[MAC_ADDR_LEN];
69
+
70
+/** A physical address.
71
+ *
72
+ * For x86, this is a 32-bit physical address, and is therefore
73
+ * limited to the low 4GB.
74
+ *
75
+ */
76
+typedef physaddr_t ADDR32;
77
+
78
+#ifndef HAVE_ARCH_SEGSEL
79
+/** A segment selector.
80
+ *
81
+ * For x86, this is a real mode segment (0x0000-0xffff), or a
82
+ * protected-mode segment selector, such as could be loaded into a
83
+ * segment register.
84
+ *
85
+ */
86
+typedef uint16_t SEGSEL;
87
+#endif
88
+
89
+#ifndef HAVE_ARCH_OFF16
90
+/** An offset within a segment identified by #SEGSEL */
91
+typedef uint16_t OFF16;
92
+#endif
93
+
94
+/** A segment:offset address */
95
+typedef struct s_SEGOFF16 {
96
+	OFF16	offset;			/**< Offset within the segment */
97
+	SEGSEL	segment;		/**< Segment selector */
98
+} SEGOFF16 __attribute__ (( packed ));
99
+
100
+/** A segment descriptor */
101
+typedef struct s_SEGDESC {
102
+	SEGSEL	segment_address;	/**< Segment selector */
103
+	ADDR32	physical_address;	/**< Base address of the segment */
104
+	OFF16	seg_size;		/**< Size of the segment */
105
+} SEGDESC __attribute__ (( packed ));
106
+
107
+/** @} */ /* defgroup */
108
+
109
+
110
+/** @} */ /* addtogroup */
111
+
112
+#endif /* PXE_TYPES_H */

Loading…
Cancel
Save