summaryrefslogtreecommitdiff
path: root/com32/include/syslinux/config.h
blob: 6983f8aaa265483d9e2be3bbc91ff0e351975326 (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
/* ----------------------------------------------------------------------- *
 *
 *   Copyright 2007-2008 H. Peter Anvin - All Rights Reserved
 *
 *   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>

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;
};

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

union syslinux_derivative_info {
  struct {
    uint8_t filesystem;
    uint8_t ah;
  } c;				/* common */
  struct {
    uint16_t ax;
    uint16_t cx;
    uint16_t dx;
    uint16_t _pad;
    const void *esbx;
    const void *fssi;
    const void *gsdi;
  } r;				/* raw */
  struct {
    uint8_t filesystem;
    uint8_t ah;
    uint8_t sector_shift;
    uint8_t ch;
    uint8_t drive_number;
    uint8_t dh;
    uint16_t _pad;
    const void *ptab_ptr;
    const uint32_t *esdi_ptr;
  } disk;			/* syslinux/extlinux */
  struct {
    uint8_t filesystem;
    uint8_t ah;
    uint16_t cx;
    uint16_t apiver;
    uint16_t _pad;
    const void *pxenvptr;
    const void *stack;
  } pxe;			/* pxelinux */
  struct {
    uint8_t filesystem;
    uint8_t ah;
    uint8_t sector_shift;
    uint8_t cd_mode;
    uint8_t drive_number;
    uint8_t dh;
    uint16_t _pad;
    const void *spec_packet;
    const uint32_t *esdi_ptr;
  } iso;			/* isolinux */
};

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 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 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 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 */