1 /* ----------------------------------------------------------------------- *
3 * Copyright 2007-2009 H. Peter Anvin - All Rights Reserved
4 * Copyright 2009 Intel Corporation; author: H. Peter Anvin
6 * Permission is hereby granted, free of charge, to any person
7 * obtaining a copy of this software and associated documentation
8 * files (the "Software"), to deal in the Software without
9 * restriction, including without limitation the rights to use,
10 * copy, modify, merge, publish, distribute, sublicense, and/or
11 * sell copies of the Software, and to permit persons to whom
12 * the Software is furnished to do so, subject to the following
15 * The above copyright notice and this permission notice shall
16 * be included in all copies or substantial portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
20 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 * OTHER DEALINGS IN THE SOFTWARE.
27 * ----------------------------------------------------------------------- */
32 * Query syslinux configuration information.
35 #ifndef _SYSLINUX_CONFIG_H
36 #define _SYSLINUX_CONFIG_H
41 enum syslinux_filesystem
{
42 SYSLINUX_FS_UNKNOWN
= 0x30,
43 SYSLINUX_FS_SYSLINUX
= 0x31,
44 SYSLINUX_FS_PXELINUX
= 0x32,
45 SYSLINUX_FS_ISOLINUX
= 0x33,
46 SYSLINUX_FS_EXTLINUX
= 0x34,
49 struct syslinux_version
{
50 uint16_t version
; /* (major << 8)+minor */
52 enum syslinux_filesystem filesystem
;
53 const char *version_string
;
54 const char *copyright_string
;
57 struct syslinux_ipinfo
{
65 extern __nocommon
struct syslinux_version __syslinux_version
;
66 static inline const struct syslinux_version
*syslinux_version(void)
68 return &__syslinux_version
;
71 union syslinux_derivative_info
{
104 uint16_t _gs
, _fs
, _es
, _ds
;
105 uint32_t _edi
, _esi
, _ebp
, _esp
, _ebx
;
106 uint8_t drive_number
, dh
;
108 uint8_t sector_shift
, ch
;
110 uint8_t filesystem
, ah
;
113 const void *ptab_ptr
;
114 const uint32_t *esdi_ptr
;
115 const uint64_t *partoffset
;
116 } disk
; /* syslinux/extlinux */
118 uint16_t _gs
, _fs
, _es
, _ds
;
119 uint32_t _edi
, _esi
, _ebp
, _esp
, _ebx
;
123 uint8_t filesystem
, ah
;
126 const void *pxenvptr
;
128 const struct syslinux_ipinfo
*ipinfo
;
129 } pxe
; /* pxelinux */
131 uint16_t _gs
, _fs
, _es
, _ds
;
132 uint32_t _edi
, _esi
, _ebp
, _esp
, _ebx
;
133 uint8_t drive_number
, dh
;
135 uint8_t sector_shift
, cd_mode
;
137 uint8_t filesystem
, ah
;
140 const void *spec_packet
;
141 const uint32_t *esdi_ptr
;
142 const uint64_t *partoffset
;
143 } iso
; /* isolinux */
146 extern __nocommon
union syslinux_derivative_info __syslinux_derivative_info
;
147 static inline const union syslinux_derivative_info
148 *syslinux_derivative_info(void)
150 return &__syslinux_derivative_info
;
153 struct syslinux_serial_console_info
{
159 extern void __syslinux_set_serial_console_info(void);
161 extern __nocommon
struct syslinux_serial_console_info
162 __syslinux_serial_console_info
;
163 static inline const struct syslinux_serial_console_info
164 *syslinux_serial_console_info(void)
166 return &__syslinux_serial_console_info
;
169 extern char ConfigName
[];
170 static inline const char *syslinux_config_file(void)
175 struct syslinux_ipappend_strings
{
177 const char *const *ptr
;
179 extern __nocommon
struct syslinux_ipappend_strings __syslinux_ipappend_strings
;
180 static inline const struct syslinux_ipappend_strings
181 *syslinux_ipappend_strings(void)
183 return &__syslinux_ipappend_strings
;
186 static inline enum syslinux_filesystem
syslinux_filesystem(void)
188 return syslinux_derivative_info()->c
.filesystem
;
191 extern void get_derivative_info(union syslinux_derivative_info
*di
);
193 #endif /* _SYSLINUX_CONFIG_H */