summaryrefslogtreecommitdiff
path: root/com32/include/syslinux/config.h
blob: 79a4750e7390f45c1291e7aba14812b9369c775a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
/* ----------------------------------------------------------------------- *
 *
 *   Copyright 2007-2009 H. Peter Anvin - All Rights Reserved
 *   Copyright 2009 Intel Corporation; author: H. Peter Anvin
 *
 *   Permission is hereby granted, free of charge, to any person
 *   obtaining a copy of this software and associated documentation
 *   files (the "Software"), to deal in the Software without
 *   restriction, including without limitation the rights to use,
 *   copy, modify, merge, publish, distribute, sublicense, and/or
 *   sell copies of the Software, and to permit persons to whom
 *   the Software is furnished to do so, subject to the following
 *   conditions:
 *
 *   The above copyright notice and this permission notice shall
 *   be included in all copies or substantial portions of the Software.
 *
 *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 *   OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 *   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 *   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 *   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 *   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 *   OTHER DEALINGS IN THE SOFTWARE.
 *
 * ----------------------------------------------------------------------- */

/*
 * syslinux/config.h
 *
 * Query syslinux configuration information.
 */

#ifndef _SYSLINUX_CONFIG_H
#define _SYSLINUX_CONFIG_H

#include <stdint.h>
#include <com32.h>

enum syslinux_filesystem {
    SYSLINUX_FS_UNKNOWN = 0x30,
    SYSLINUX_FS_SYSLINUX = 0x31,
    SYSLINUX_FS_PXELINUX = 0x32,
    SYSLINUX_FS_ISOLINUX = 0x33,
    SYSLINUX_FS_EXTLINUX = 0x34,
};

struct syslinux_version {
    uint16_t version;		/* (major << 8)+minor */
    uint16_t max_api;
    enum syslinux_filesystem filesystem;
    const char *version_string;
    const char *copyright_string;
};

struct syslinux_ipinfo {
    uint32_t ipver;
    uint32_t myip;
    uint32_t serverip;
    uint32_t gateway;
    uint32_t netmask;
};

extern __nocommon struct syslinux_version __syslinux_version;
static inline const struct syslinux_version *syslinux_version(void)
{
    return &__syslinux_version;
}

union syslinux_derivative_info {
    struct {
	com32sys_t r;
	const void *esbx;
	const void *fssi;
	const void *gsdi;
    } rr;			/* real raw */
    struct {
	uint16_t _pad1[4];
	uint32_t _pad2[7];
	uint8_t filesystem;
	uint8_t ah;
	uint16_t axh;
    } c;			/* common */
    struct {
	uint16_t gs;
	uint16_t fs;
	uint16_t es;
	uint16_t ds;
	uint16_t di, dih;
	uint16_t si, sih;
	uint16_t bp, bph;
	uint16_t sp, sph;
	uint16_t bx, bxh;
	uint16_t dx, dxh;
	uint16_t cx, cxh;
	uint16_t ax, axh;
	uint32_t eflags;
	const void *esbx;
	const void *fssi;
	const void *gsdi;
    } r;			/* raw */
    struct {
	uint16_t _gs, _fs, _es, _ds;
	uint32_t _edi, _esi, _ebp, _esp, _ebx;
	uint8_t drive_number, dh;
	uint16_t _dxh;
	uint8_t sector_shift, ch;
	uint16_t _cxh;
	uint8_t filesystem, ah;
	uint16_t _axh;
	uint32_t _eflags;
	const void *ptab_ptr;
	const uint32_t *esdi_ptr;
	const uint64_t *partoffset;
    } disk;			/* syslinux/extlinux */
    struct {
	uint16_t _gs, _fs, _es, _ds;
	uint32_t _edi, _esi, _ebp, _esp, _ebx;
	uint16_t apiver;
	uint16_t _dxh;
	uint32_t myip;
	uint8_t filesystem, ah;
	uint16_t _axh;
	uint32_t _eflags;
	const void *pxenvptr;
	const void *stack;
	const struct syslinux_ipinfo *ipinfo;
    } pxe;			/* pxelinux */
    struct {
	uint16_t _gs, _fs, _es, _ds;
	uint32_t _edi, _esi, _ebp, _esp, _ebx;
	uint8_t drive_number, dh;
	uint16_t _dxh;
	uint8_t sector_shift, cd_mode;
	uint16_t _cxh;
	uint8_t filesystem, ah;
	uint16_t _axh;
	uint32_t _eflags;
	const void *spec_packet;
	const uint32_t *esdi_ptr;
	const uint64_t *partoffset;
    } iso;			/* isolinux */
};

extern __nocommon union syslinux_derivative_info __syslinux_derivative_info;
static inline const union syslinux_derivative_info
    *syslinux_derivative_info(void)
{
    return &__syslinux_derivative_info;
}

struct syslinux_serial_console_info {
    uint16_t iobase;
    uint16_t divisor;
    uint16_t flowctl;
};

extern __nocommon struct syslinux_serial_console_info
    __syslinux_serial_console_info;
static inline const struct syslinux_serial_console_info
    *syslinux_serial_console_info(void)
{
    return &__syslinux_serial_console_info;
}

extern __nocommon const char *__syslinux_config_file;
static inline const char *syslinux_config_file(void)
{
    return __syslinux_config_file;
}

struct syslinux_ipappend_strings {
    int count;
    const char *const *ptr;
};
extern __nocommon struct syslinux_ipappend_strings __syslinux_ipappend_strings;
static inline const struct syslinux_ipappend_strings
    *syslinux_ipappend_strings(void)
{
    return &__syslinux_ipappend_strings;
}

#endif /* _SYSLINUX_CONFIG_H */