diff options
Diffstat (limited to 'contrib/syslinux-4.02/com32/include/syslinux')
23 files changed, 1791 insertions, 0 deletions
diff --git a/contrib/syslinux-4.02/com32/include/syslinux/adv.h b/contrib/syslinux-4.02/com32/include/syslinux/adv.h new file mode 100644 index 0000000..15d36bc --- /dev/null +++ b/contrib/syslinux-4.02/com32/include/syslinux/adv.h @@ -0,0 +1,57 @@ +/* ----------------------------------------------------------------------- * + * + * 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/adv.h + */ + +#ifndef _SYSLINUX_ADV_H +#define _SYSLINUX_ADV_H + +#include <klibc/extern.h> +#include <stddef.h> +#include <syslinux/advconst.h> + +__extern void *__syslinux_adv_ptr; +__extern size_t __syslinux_adv_size; + +static inline void *syslinux_adv_ptr(void) +{ + return __syslinux_adv_ptr; +} + +static inline size_t syslinux_adv_size(void) +{ + return __syslinux_adv_size; +} + +__extern int syslinux_adv_write(void); + +__extern int syslinux_setadv(int, size_t, const void *); +__extern const void *syslinux_getadv(int, size_t *); + +#endif /* _SYSLINUX_ADV_H */ diff --git a/contrib/syslinux-4.02/com32/include/syslinux/advconst.h b/contrib/syslinux-4.02/com32/include/syslinux/advconst.h new file mode 100644 index 0000000..b7c775f --- /dev/null +++ b/contrib/syslinux-4.02/com32/include/syslinux/advconst.h @@ -0,0 +1,45 @@ +/* ----------------------------------------------------------------------- * + * + * Copyright 2007-2008 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/advconst.h + * + * ADV defined constants + * + * Defined in a separate file so it can be used by non-COM32 code. + * Some of these constants are also defined in adv.inc, they better match... + */ + +#ifndef _SYSLINUX_ADVCONST_H +#define _SYSLINUX_ADVCONST_H + +#define ADV_END 0 +#define ADV_BOOTONCE 1 +#define ADV_MENUSAVE 2 + +#endif /* _SYSLINUX_ADVCONST_H */ diff --git a/contrib/syslinux-4.02/com32/include/syslinux/align.h b/contrib/syslinux-4.02/com32/include/syslinux/align.h new file mode 100644 index 0000000..81df97f --- /dev/null +++ b/contrib/syslinux-4.02/com32/include/syslinux/align.h @@ -0,0 +1,48 @@ +/* ----------------------------------------------------------------------- * + * + * 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. + * + * ----------------------------------------------------------------------- */ + +#ifndef _SYSLINUX_ALIGN_H +#define _SYSLINUX_ALIGN_H + +#include <stdint.h> + +static inline uintptr_t __align_down(uintptr_t __p, uintptr_t __a) +{ + return __p & ~(__a - 1); +} + +static inline uintptr_t __align_up(uintptr_t __p, uintptr_t __a) +{ + return (__p + __a - 1) & ~(__a - 1); +} + +#define ALIGN_UP(p,a) ((__typeof__(p))__align_up((uintptr_t)(p), (a))) +#define ALIGN_DOWN(p,a) ((__typeof__(p))__align_down((uintptr_t)(p), (a))) +#define ALIGN_UP_FOR(p,t) ALIGN_UP(p,sizeof(t)) +#define ALIGN_DOWN_FOR(p,t) ALIGN_DOWN(p,sizeof(t)) + +#endif /* _SYSLINUX_ALIGN_H */ diff --git a/contrib/syslinux-4.02/com32/include/syslinux/boot.h b/contrib/syslinux-4.02/com32/include/syslinux/boot.h new file mode 100644 index 0000000..21bea01 --- /dev/null +++ b/contrib/syslinux-4.02/com32/include/syslinux/boot.h @@ -0,0 +1,63 @@ +/* ----------------------------------------------------------------------- * + * + * 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/boot.h + * + * SYSLINUX boot API invocation + */ + +#ifndef _SYSLINUX_BOOT_H +#define _SYSLINUX_BOOT_H + +#include <stdint.h> +#include <klibc/compiler.h> + +int syslinux_run_command(const char *); +__noreturn syslinux_run_default(void); + +void syslinux_local_boot(uint16_t flags); + +void syslinux_final_cleanup(uint16_t flags); + +void syslinux_chain_bootstrap(uint16_t flags, const void *bootstrap, + uint32_t bootstrap_len, uint32_t edx, + uint32_t esi, uint16_t ds); + +#define IMAGE_TYPE_KERNEL 0 +#define IMAGE_TYPE_LINUX 1 +#define IMAGE_TYPE_BOOT 2 +#define IMAGE_TYPE_BSS 3 +#define IMAGE_TYPE_PXE 4 +#define IMAGE_TYPE_FDIMAGE 5 +#define IMAGE_TYPE_COMBOOT 6 +#define IMAGE_TYPE_COM32 7 +#define IMAGE_TYPE_CONFIG 8 +void syslinux_run_kernel_image(const char *filename, const char *cmdline, + uint32_t ipappend_flags, uint32_t type); + +#endif /* _SYSLINUX_BOOT_H */ diff --git a/contrib/syslinux-4.02/com32/include/syslinux/bootpm.h b/contrib/syslinux-4.02/com32/include/syslinux/bootpm.h new file mode 100644 index 0000000..a9ca2ed --- /dev/null +++ b/contrib/syslinux-4.02/com32/include/syslinux/bootpm.h @@ -0,0 +1,57 @@ +/* ----------------------------------------------------------------------- * + * + * 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/bootpm.h + * + * Data structures for shuffle and boot to protected mode + */ + +#ifndef _SYSLINUX_BOOTPM_H +#define _SYSLINUX_BOOTPM_H + +#include <stdint.h> +#include <syslinux/movebits.h> + +struct syslinux_pm_regs { + uint32_t eax; /* Offset 0 */ + uint32_t ecx; /* Offset 4 */ + uint32_t edx; /* Offset 8 */ + uint32_t ebx; /* Offset 12 */ + uint32_t esp; /* Offset 16 */ + uint32_t ebp; /* Offset 20 */ + uint32_t esi; /* Offset 24 */ + uint32_t edi; /* Offset 28 */ + + uint32_t eip; /* Offset 32 */ +}; + +int syslinux_shuffle_boot_pm(struct syslinux_movelist *fraglist, + struct syslinux_memmap *memmap, + uint16_t bootflags, struct syslinux_pm_regs *regs); + +#endif /* _SYSLINUX_BOOTPM_H */ diff --git a/contrib/syslinux-4.02/com32/include/syslinux/bootrm.h b/contrib/syslinux-4.02/com32/include/syslinux/bootrm.h new file mode 100644 index 0000000..a5d746f --- /dev/null +++ b/contrib/syslinux-4.02/com32/include/syslinux/bootrm.h @@ -0,0 +1,73 @@ +/* ----------------------------------------------------------------------- * + * + * Copyright 2007-2008 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/bootrm.h + * + * Data structures for shuffle and boot to protected mode + */ + +#ifndef _SYSLINUX_BOOTRM_H +#define _SYSLINUX_BOOTRM_H + +#include <stdint.h> +#include <stdbool.h> +#include <com32.h> +#include <syslinux/movebits.h> + +/* This register set is used by the shuffle and boot interface. It is + a completely different structure from what the __intcall() and + __farcall() interfaces use! */ +struct syslinux_rm_regs { + uint16_t es; /* Offset 0 */ + uint16_t _unused_cs; /* Offset 2 */ + uint16_t ss; /* Offset 4 */ + uint16_t ds; /* Offset 6 */ + uint16_t fs; /* Offset 8 */ + uint16_t gs; /* Offset 10 */ + + reg32_t eax; /* Offset 12 */ + reg32_t ecx; /* Offset 16 */ + reg32_t edx; /* Offset 20 */ + reg32_t ebx; /* Offset 24 */ + reg32_t esp; /* Offset 28 */ + reg32_t ebp; /* Offset 32 */ + reg32_t esi; /* Offset 36 */ + reg32_t edi; /* Offset 40 */ + + uint16_t ip; /* Offset 44 */ + uint16_t cs; /* Offset 46 */ + + bool sti; /* Offset 48 */ +}; + +int syslinux_shuffle_boot_rm(struct syslinux_movelist *fraglist, + struct syslinux_memmap *memmap, + uint16_t bootflags, struct syslinux_rm_regs *regs); + +#endif /* _SYSLINUX_BOOTRM_H */ diff --git a/contrib/syslinux-4.02/com32/include/syslinux/config.h b/contrib/syslinux-4.02/com32/include/syslinux/config.h new file mode 100644 index 0000000..79a4750 --- /dev/null +++ b/contrib/syslinux-4.02/com32/include/syslinux/config.h @@ -0,0 +1,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 */ diff --git a/contrib/syslinux-4.02/com32/include/syslinux/features.h b/contrib/syslinux-4.02/com32/include/syslinux/features.h new file mode 100644 index 0000000..4bebda4 --- /dev/null +++ b/contrib/syslinux-4.02/com32/include/syslinux/features.h @@ -0,0 +1,50 @@ +/* ----------------------------------------------------------------------- * + * + * 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. + * + * ----------------------------------------------------------------------- */ + +#ifndef _SYSLINUX_FEATURES_H +#define _SYSLINUX_FEATURES_H + +#define SYSLINUX_FEATURE_LOCAL_BOOT (0*8+0) +#define SYSLINUX_FEATURE_NOOP_IDLE (0*8+1) + +extern struct __syslinux_feature_flags { + unsigned int len; + const unsigned char *ptr; +} __syslinux_feature_flags; + +static inline int syslinux_has_feature(unsigned int __flag) +{ + unsigned int __byte = __flag >> 3; + unsigned int __bit = __flag & 7; + + if (__byte <= __syslinux_feature_flags.len) + return (__syslinux_feature_flags.ptr[__byte] >> __bit) & 1; + else + return 0; +} + +#endif /* _SYSLINUX_FEATURE_H */ diff --git a/contrib/syslinux-4.02/com32/include/syslinux/idle.h b/contrib/syslinux-4.02/com32/include/syslinux/idle.h new file mode 100644 index 0000000..6a45236 --- /dev/null +++ b/contrib/syslinux-4.02/com32/include/syslinux/idle.h @@ -0,0 +1,38 @@ +/* ----------------------------------------------------------------------- * + * + * Copyright 2005-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/idle.h + */ + +#ifndef _SYSLINUX_IDLE_H +#define _SYSLINUX_IDLE_H + +void syslinux_idle(void); +void syslinux_reset_idle(void); + +#endif diff --git a/contrib/syslinux-4.02/com32/include/syslinux/io.h b/contrib/syslinux-4.02/com32/include/syslinux/io.h new file mode 100644 index 0000000..329377d --- /dev/null +++ b/contrib/syslinux-4.02/com32/include/syslinux/io.h @@ -0,0 +1,39 @@ +/* ----------------------------------------------------------------------- * + * + * 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/io.h + * + * SYSLINUX low-level I/O functions + */ + +#ifndef _SYSLINUX_IO_H +#define _SYSLINUX_IO_H + +int syslinux_read_disk(void *buf, uint32_t sector, uint16_t count); + +#endif /* _SYSLINUX_IO_H */ diff --git a/contrib/syslinux-4.02/com32/include/syslinux/keyboard.h b/contrib/syslinux-4.02/com32/include/syslinux/keyboard.h new file mode 100644 index 0000000..71925e3 --- /dev/null +++ b/contrib/syslinux-4.02/com32/include/syslinux/keyboard.h @@ -0,0 +1,51 @@ +/* ----------------------------------------------------------------------- * + * + * 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/keyboard.h + * + * Query syslinux keyboard map. + */ + +#ifndef _SYSLINUX_KEYBOARD_H +#define _SYSLINUX_KEYBOARD_H + +#include <stdint.h> + +struct syslinux_keyboard_map { + uint16_t version; + uint16_t length; + void *map; +}; + +extern struct syslinux_keyboard_map __syslinux_keyboard_map; +static inline const struct syslinux_keyboard_map *syslinux_keyboard_map(void) +{ + return &__syslinux_keyboard_map; +} + +#endif /* _SYSLINUX_KEYBOARD_H */ diff --git a/contrib/syslinux-4.02/com32/include/syslinux/linux.h b/contrib/syslinux-4.02/com32/include/syslinux/linux.h new file mode 100644 index 0000000..754d1b6 --- /dev/null +++ b/contrib/syslinux-4.02/com32/include/syslinux/linux.h @@ -0,0 +1,73 @@ +/* ----------------------------------------------------------------------- * + * + * 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/linux.h + * + * Definitions used to boot a Linux kernel + */ + +#ifndef _SYSLINUX_LINUX_H +#define _SYSLINUX_LINUX_H + +#include <stddef.h> +#include <stdint.h> + +/* A chunk of an initramfs. These are kept as a doubly-linked + circular list with headnode; the headnode is distinguished by + having len == 0. The data pointer can be NULL if data_len is zero; + if data_len < len then the balance of the region is zeroed. */ + +struct initramfs { + struct initramfs *prev, *next; + size_t len; + size_t align; + const void *data; + size_t data_len; +}; +#define INITRAMFS_MAX_ALIGN 4096 + +int syslinux_boot_linux(void *kernel_buf, size_t kernel_size, + struct initramfs *initramfs, char *cmdline); + +/* Initramfs manipulation functions */ + +struct initramfs *initramfs_init(void); +int initramfs_add_data(struct initramfs *ihead, const void *data, + size_t data_len, size_t len, size_t align); +int initramfs_mknod(struct initramfs *ihead, const char *filename, + int do_mkdir, + uint16_t mode, size_t len, uint32_t major, uint32_t minor); +int initramfs_add_file(struct initramfs *ihead, const void *data, + size_t data_len, size_t len, + const char *filename, int do_mkdir, uint32_t mode); +int initramfs_load_file(struct initramfs *ihead, const char *src_filename, + const char *dst_filename, int do_mkdir, uint32_t mode); +int initramfs_add_trailer(struct initramfs *ihead); +int initramfs_load_archive(struct initramfs *ihead, const char *filename); + +#endif /* _SYSLINUX_LINUX_H */ diff --git a/contrib/syslinux-4.02/com32/include/syslinux/loadfile.h b/contrib/syslinux-4.02/com32/include/syslinux/loadfile.h new file mode 100644 index 0000000..1a04c51 --- /dev/null +++ b/contrib/syslinux-4.02/com32/include/syslinux/loadfile.h @@ -0,0 +1,15 @@ +#ifndef LIBUTIL_LOADFILE_H +#define LIBUTIL_LOADFILE_H + +#include <stddef.h> +#include <stdio.h> + +/* loadfile() returns the true size of the file, but will guarantee valid, + zero-padded memory out to this boundary. */ +#define LOADFILE_ZERO_PAD 64 + +int loadfile(const char *, void **, size_t *); +int zloadfile(const char *, void **, size_t *); +int floadfile(FILE *, void **, size_t *, const void *, size_t); + +#endif diff --git a/contrib/syslinux-4.02/com32/include/syslinux/memscan.h b/contrib/syslinux-4.02/com32/include/syslinux/memscan.h new file mode 100644 index 0000000..db79543 --- /dev/null +++ b/contrib/syslinux-4.02/com32/include/syslinux/memscan.h @@ -0,0 +1,38 @@ +/* ----------------------------------------------------------------------- * + * + * 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. + * + * ----------------------------------------------------------------------- */ + +#ifndef _SYSLINUX_MEMSCAN_H +#define _SYSLINUX_MEMSCAN_H + +#include <stdbool.h> +#include <syslinux/movebits.h> /* addr_t */ + +typedef int (*scan_memory_callback_t) (void *, addr_t, addr_t, bool); +int syslinux_scan_memory(scan_memory_callback_t callback, void *data); + +#endif /* _SYSLINUX_MEMSCAN_H */ diff --git a/contrib/syslinux-4.02/com32/include/syslinux/movebits.h b/contrib/syslinux-4.02/com32/include/syslinux/movebits.h new file mode 100644 index 0000000..54ee7ff --- /dev/null +++ b/contrib/syslinux-4.02/com32/include/syslinux/movebits.h @@ -0,0 +1,89 @@ +#ifndef _SYSLINUX_MOVEBITS_H +#define _SYSLINUX_MOVEBITS_H + +#include <inttypes.h> +#include <stdio.h> + +typedef uint32_t addr_t; + +/* + * A syslinux_movelist is a linked list of move operations. The ordering + * is important, so no sorting requirement can be imposed. + */ +struct syslinux_movelist { + addr_t dst; + addr_t src; + addr_t len; + struct syslinux_movelist *next; +}; + +/* + * A syslinux_memmap is a sorted, linked list of memory regions, + * guaranteed to satisfy the constraint that no adjacent zones have + * the same type. Undefined memory ranges are represented with entries; + * they have type SMT_UNDEFINED. + * + * Note that there is no length field. The length of a region is obtained + * by looking at the start of the next entry in the chain. + */ +enum syslinux_memmap_types { + SMT_ERROR = -2, /* Internal error token */ + SMT_END = -1, /* End of list */ + SMT_UNDEFINED = 0, /* Unknown range */ + SMT_FREE = 1, /* Available memory */ + SMT_RESERVED, /* Unusable memory */ + SMT_ALLOC, /* Memory allocated by user */ + SMT_ZERO, /* Memory that should be zeroed */ +}; + +struct syslinux_memmap { + addr_t start; + enum syslinux_memmap_types type; + struct syslinux_memmap *next; +}; + +/* + * moves is computed from "fraglist" and "memmap". Areas that are + * to be zeroed should be marked as such in the memmap, not in the + * fraglist. + */ + +int syslinux_compute_movelist(struct syslinux_movelist **movelist, + struct syslinux_movelist *fraglist, + struct syslinux_memmap *memmap); + +struct syslinux_memmap *syslinux_memory_map(void); +void syslinux_free_movelist(struct syslinux_movelist *); +int syslinux_add_movelist(struct syslinux_movelist **, + addr_t dst, addr_t src, addr_t len); +int syslinux_allocate_from_list(struct syslinux_movelist **freelist, + addr_t dst, addr_t len); +int syslinux_do_shuffle(struct syslinux_movelist *fraglist, + struct syslinux_memmap *memmap, + addr_t entry_point, addr_t entry_type, + uint16_t bootflags); +struct syslinux_memmap *syslinux_target_memmap(struct syslinux_movelist + *fraglist, + struct syslinux_memmap *memmap); + +/* Operatons on struct syslinux_memmap */ +struct syslinux_memmap *syslinux_init_memmap(void); +int syslinux_add_memmap(struct syslinux_memmap **list, + addr_t start, addr_t len, + enum syslinux_memmap_types type); +enum syslinux_memmap_types syslinux_memmap_type(struct syslinux_memmap *list, + addr_t start, addr_t len); +int syslinux_memmap_largest(struct syslinux_memmap *list, + enum syslinux_memmap_types type, + addr_t * start, addr_t * len); +void syslinux_free_memmap(struct syslinux_memmap *list); +struct syslinux_memmap *syslinux_dup_memmap(struct syslinux_memmap *list); +int syslinux_memmap_find(struct syslinux_memmap *list, + enum syslinux_memmap_types type, + addr_t * start, addr_t * len, addr_t align); + +/* Debugging functions */ +void syslinux_dump_movelist(FILE * file, struct syslinux_movelist *ml); +void syslinux_dump_memmap(FILE * file, struct syslinux_memmap *memmap); + +#endif /* _SYSLINUX_MOVEBITS_H */ diff --git a/contrib/syslinux-4.02/com32/include/syslinux/pmapi.h b/contrib/syslinux-4.02/com32/include/syslinux/pmapi.h new file mode 100644 index 0000000..fa39018 --- /dev/null +++ b/contrib/syslinux-4.02/com32/include/syslinux/pmapi.h @@ -0,0 +1,79 @@ +/* ----------------------------------------------------------------------- * + * + * Copyright 2002-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. + * + * ----------------------------------------------------------------------- */ + +/* + * pmapi.h + * + * Definitions for the Syslinux 4 protected-mode ABI + */ + +#ifndef _SYSLINUX_PMAPI_H +#define _SYSLINUX_PMAPI_H + +#include <stddef.h> +#include <inttypes.h> + +/* + * Note: add new members to this structure only at the end. + * The position of elements in this structure is an ABI. + */ +struct _DIR_; +struct dirent; + +struct com32_filedata { + size_t size; /* File size */ + int blocklg2; /* log2(block size) */ + uint16_t handle; /* File handle */ +}; + +struct com32_pmapi { + size_t __pmapi_size; + + void *(*lmalloc)(size_t); + void (*lfree)(void *); + + int (*open_file)(const char *, struct com32_filedata *); + size_t (*read_file)(uint16_t *, void *, size_t); + void (*close_file)(uint16_t); + + struct _DIR_ *(*opendir)(const char *); + struct dirent *(*readdir)(struct _DIR_ *); + int (*closedir)(struct _DIR_ *); + + void (*idle)(void); + void (*reset_idle)(void); + + int (*chdir)(const char *); + char *(*getcwd)(char *, size_t); + + /* Should be "const volatile", but gcc miscompiles that sometimes */ + volatile uint32_t *jiffies; + volatile uint32_t *ms_timer; +}; + +#endif /* _SYSLINUX_PMAPI_H */ diff --git a/contrib/syslinux-4.02/com32/include/syslinux/pxe.h b/contrib/syslinux-4.02/com32/include/syslinux/pxe.h new file mode 100644 index 0000000..4e8a336 --- /dev/null +++ b/contrib/syslinux-4.02/com32/include/syslinux/pxe.h @@ -0,0 +1,44 @@ +/* ----------------------------------------------------------------------- * + * + * 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/pxe.h + * + * PXE definitions and function prototypes for SYSLINUX + */ + +#ifndef _SYSLINUX_PXE_H +#define _SYSLINUX_PXE_H + +#include <syslinux/pxe_api.h> + +/* SYSLINUX-defined PXE utility functions */ +int pxe_get_cached_info(int level, void **buf, size_t *len); +int pxe_get_nic_type(t_PXENV_UNDI_GET_NIC_TYPE * gnt); +uint32_t pxe_dns(const char *hostname); + +#endif /* _SYSLINUX_PXE_H */ diff --git a/contrib/syslinux-4.02/com32/include/syslinux/pxe_api.h b/contrib/syslinux-4.02/com32/include/syslinux/pxe_api.h new file mode 100644 index 0000000..27166b0 --- /dev/null +++ b/contrib/syslinux-4.02/com32/include/syslinux/pxe_api.h @@ -0,0 +1,571 @@ +/* ----------------------------------------------------------------------- * + * + * 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/pxe_api.h + * + * PXE type and constant definitions for SYSLINUX + */ + +#ifndef _SYSLINUX_PXE_API_H +#define _SYSLINUX_PXE_API_H + +#include <stdint.h> +#include <netinet/in.h> +#include <klibc/compiler.h> +#include <com32.h> + +/* PXE spec structures and definitions. These mostly follow the PXE + spec, except when the PXE spec is unnecessarily stupid. Of course, + that is most of the time. */ + +/* Basic types; use Unix-like _t convention instead of SCREAMING; also + re-use types we already have, like in_addr_t. */ + +typedef uint16_t pxenv_status_t; + +#define MAC_ADDR_LEN 16 +typedef uint8_t mac_addr_t[MAC_ADDR_LEN]; + +/* "Protected mode segment descriptor" according to PXE... */ +typedef struct { + uint16_t sel; + uint32_t base; + uint16_t size; +} __packed pxe_segdesc_t; + +typedef far_ptr_t segoff16_t; + +typedef struct { + uint8_t opcode; +#define BOOTP_REQ 1 +#define BOOTP_REP 2 + uint8_t Hardware; + uint8_t Hardlen; + uint8_t Gatehops; + uint32_t ident; + uint16_t seconds; + uint16_t Flags; +#define BOOTP_BCAST 0x8000 + in_addr_t cip; /* Client IP address */ + in_addr_t yip; /* You IP address */ + in_addr_t sip; /* next server IP address */ + in_addr_t gip; /*relay agent IP address */ + mac_addr_t CAddr; + uint8_t Sname[64]; + uint8_t bootfile[128]; + union { +#define BOOTP_DHCPVEND 1024 + uint8_t d[BOOTP_DHCPVEND]; + struct { + uint8_t magic[4]; +#define VM_RFC1048 0x63825363L + uint32_t flags; + uint8_t pad[56]; + } v; + } vendor; +} __packed pxe_bootp_t; + +/* Function calling structures and constants */ + +typedef struct s_PXENV_GET_CACHED_INFO { + pxenv_status_t Status; + uint16_t PacketType; +#define PXENV_PACKET_TYPE_DHCP_DISCOVER 1 +#define PXENV_PACKET_TYPE_DHCP_ACK 2 +#define PXENV_PACKET_TYPE_CACHED_REPLY 3 + uint16_t BufferSize; + segoff16_t Buffer; + uint16_t BufferLimit; +} __packed t_PXENV_GET_CACHED_INFO; + +typedef struct s_PXENV_START_UNDI { + pxenv_status_t Status; + uint16_t AX; + uint16_t BX; + uint16_t DX; + uint16_t DI; + uint16_t ES; +} __packed t_PXENV_START_UNDI; + +typedef struct s_PXENV_STOP_UNDI { + pxenv_status_t Status; +} __packed t_PXENV_STOP_UNDI; + +typedef struct s_PXENV_START_BASE { + pxenv_status_t Status; +} __packed t_PXENV_START_BASE; + +typedef struct s_PXENV_STOP_BASE { + pxenv_status_t Status; +} __packed t_PXENV_STOP_BASE; + +typedef struct s_PXENV_TFTP_OPEN { + pxenv_status_t Status; + in_addr_t ServerIPAddress; + in_addr_t GatewayIPAddress; + uint8_t FileName[128]; + in_port_t TFTPPort; + uint16_t PacketSize; +} __packed t_PXENV_TFTP_OPEN; + +typedef struct s_PXENV_TFTP_CLOSE { + pxenv_status_t Status; +} __packed t_PXENV_TFTP_CLOSE; + +typedef struct s_PXENV_TFTP_READ { + pxenv_status_t Status; + uint16_t PacketNumber; + uint16_t BufferSize; + segoff16_t Buffer; +} __packed t_PXENV_TFTP_READ; + +typedef struct s_PXENV_TFTP_READ_FILE { + pxenv_status_t Status; + uint8_t FileName[128]; + uint32_t BufferSize; + void *Buffer; + in_addr_t ServerIPAddress; + in_addr_t GatewayIPAddress; + in_addr_t McastIPAddress; + in_port_t TFTPClntPort; + in_port_t TFTPSrvPort; + uint16_t TFTPOpenTimeOut; + uint16_t TFTPReopenDelay; +} __packed t_PXENV_TFTP_READ_FILE; + +typedef struct s_PXENV_TFTP_GET_FSIZE { + pxenv_status_t Status; + in_addr_t ServerIPAddress; + in_addr_t GatewayIPAddress; + uint8_t FileName[128]; + uint32_t FileSize; +} __packed t_PXENV_TFTP_GET_FSIZE; + +typedef struct s_PXENV_UDP_OPEN { + pxenv_status_t status; + in_addr_t src_ip; +} __packed t_PXENV_UDP_OPEN; + +typedef struct s_PXENV_UDP_CLOSE { + pxenv_status_t status; +} __packed t_PXENV_UDP_CLOSE; + +typedef struct s_PXENV_UDP_WRITE { + pxenv_status_t status; + in_addr_t ip; + in_addr_t gw; + in_port_t src_port; + in_port_t dst_port; + uint16_t buffer_size; + segoff16_t buffer; +} __packed t_PXENV_UDP_WRITE; + +typedef struct s_PXENV_UDP_READ { + pxenv_status_t status; + in_addr_t src_ip; + in_addr_t dest_ip; + in_port_t s_port; + in_port_t d_port; + uint16_t buffer_size; + segoff16_t buffer; +} __packed t_PXENV_UDP_READ; + +typedef struct s_PXENV_UNDI_STARTUP { + pxenv_status_t Status; +} __packed t_PXENV_UNDI_STARTUP; + +typedef struct s_PXENV_UNDI_CLEANUP { + pxenv_status_t Status; +} __packed t_PXENV_UNDI_CLEANUP; + +typedef struct s_PXENV_UNDI_INITIALIZE { + pxenv_status_t Status; + void *ProtocolIni; + uint8_t reserved[8]; +} __packed t_PXENV_UNDI_INITIALIZE; + +#define MAXNUM_MCADDR 8 +typedef struct s_PXENV_UNDI_MCAST_ADDRESS { + uint16_t MCastAddrCount; + mac_addr_t McastAddr[MAXNUM_MCADDR]; +} __packed t_PXENV_UNDI_MCAST_ADDRESS; + +typedef struct s_PXENV_UNDI_RESET { + pxenv_status_t Status; + t_PXENV_UNDI_MCAST_ADDRESS R_Mcast_Buf; +} __packed t_PXENV_UNDI_RESET; + +typedef struct s_PXENV_UNDI_SHUTDOWN { + pxenv_status_t Status; +} __packed t_PXENV_UNDI_SHUTDOWN; + +typedef struct s_PXENV_UNDI_OPEN { + pxenv_status_t Status; + uint16_t OpenFlag; + uint16_t PktFilter; +#define FLTR_DIRECTED 0x0001 +#define FLTR_BRDCST 0x0002 +#define FLTR_PRMSCS 0x0004 +#define FLTR_SRC_RTG 0x0008 + t_PXENV_UNDI_MCAST_ADDRESS R_Mcast_Buf; +} __packed t_PXENV_UNDI_OPEN; + +typedef struct s_PXENV_UNDI_CLOSE { + pxenv_status_t Status; +} __packed t_PXENV_UNDI_CLOSE; + +typedef struct s_PXENV_UNDI_TRANSMIT { + pxenv_status_t Status; + uint8_t Protocol; +#define P_UNKNOWN 0 +#define P_IP 1 +#define P_ARP 2 +#define P_RARP 3 + uint8_t XmitFlag; +#define XMT_DESTADDR 0x0000 +#define XMT_BROADCAST 0x0001 + segoff16_t DestAddr; + segoff16_t TBD; + uint32_t Reserved[2]; +} __packed t_PXENV_UNDI_TRANSMIT; +#define MAX_DATA_BLKS 8 +typedef struct s_PXENV_UNDI_TBD { + uint16_t ImmedLength; + segoff16_t Xmit; + uint16_t DataBlkCount; + struct DataBlk { + uint8_t TDPtrType; + uint8_t TDRsvdByte; + uint16_t TDDataLen; + segoff16_t TDDataPtr; + } DataBlock[MAX_DATA_BLKS]; +} __packed t_PXENV_UNDI_TBD; + +typedef struct s_PXENV_UNDI_SET_MCAST_ADDRESS { + pxenv_status_t Status; + t_PXENV_UNDI_MCAST_ADDRESS R_Mcast_Buf; +} __packed t_PXENV_UNDI_SET_MCAST_ADDR; + +typedef struct s_PXENV_UNDI_SET_STATION_ADDRESS { + pxenv_status_t Status; + mac_addr_t StationAddress; +} __packed t_PXENV_UNDI_SET_STATION_ADDR; + +typedef struct s_PXENV_UNDI_SET_PACKET_FILTER { + pxenv_status_t Status; + uint8_t filter; +} __packed t_PXENV_UNDI_SET_PACKET_FILTER; + +typedef struct s_PXENV_UNDI_GET_INFORMATION { + pxenv_status_t Status; + uint16_t BaseIo; + uint16_t IntNumber; + uint16_t MaxTranUnit; + uint16_t HwType; +#define ETHER_TYPE 1 +#define EXP_ETHER_TYPE 2 +#define IEEE_TYPE 6 +#define ARCNET_TYPE 7 + uint16_t HwAddrLen; + mac_addr_t CurrentNodeAddress; + mac_addr_t PermNodeAddress; + uint16_t ROMAddress; + uint16_t RxBufCt; + uint16_t TxBufCt; +} __packed t_PXENV_UNDI_GET_INFORMATION; + +typedef struct s_PXENV_UNDI_GET_STATISTICS { + pxenv_status_t Status; + uint32_t XmtGoodFrames; + uint32_t RcvGoodFrames; + uint32_t RcvCRCErrors; + uint32_t RcvResourceErrors; +} __packed t_PXENV_UNDI_GET_STATISTICS; + +typedef struct s_PXENV_UNDI_CLEAR_STATISTICS { + pxenv_status_t Status; +} __packed t_PXENV_UNDI_CLEAR_STATISTICS; + +typedef struct s_PXENV_UNDI_INITIATE_DIAGS { + pxenv_status_t Status; +} __packed t_PXENV_UNDI_INITIATE_DIAGS; + +typedef struct s_PXENV_UNDI_FORCE_INTERRUPT { + pxenv_status_t Status; +} __packed t_PXENV_UNDI_FORCE_INTERRUPT; + +typedef struct s_PXENV_UNDI_GET_MCAST_ADDRESS { + pxenv_status_t Status; + in_addr_t InetAddr; + mac_addr_t MediaAddr; +} __packed t_PXENV_UNDI_GET_MCAST_ADDR; + +typedef struct s_PXENV_UNDI_GET_NIC_TYPE { + pxenv_status_t Status; + uint8_t NicType; +#define PCI_NIC 2 +#define PnP_NIC 3 +#define CardBus_NIC 4 + union { + struct { + uint16_t Vendor_ID; + uint16_t Dev_ID; + uint8_t Base_Class; + uint8_t Sub_Class; + uint8_t Prog_Intf; + uint8_t Rev; + uint16_t BusDevFunc; + uint16_t SubVendor_ID; + uint16_t SubDevice_ID; + } pci, cardbus; + struct { + uint32_t EISA_Dev_ID; + uint8_t Base_Class; + uint8_t Sub_Class; + uint8_t Prog_Intf; + uint16_t CardSelNum; + } __packed pnp; + } __packed info; +} __packed t_PXENV_UNDI_GET_NIC_TYPE; + +typedef struct s_PXENV_UNDI_GET_IFACE_INFO { + pxenv_status_t Status; + uint8_t IfaceType[16]; + uint32_t LinkSpeed; + uint32_t ServiceFlags; + uint32_t Reserved[4]; +} __packed t_PXENV_UNDI_GET_NDIS_INFO; + +typedef struct s_PXENV_UNDI_GET_STATE { +#define PXE_UNDI_GET_STATE_STARTED 1 +#define PXE_UNDI_GET_STATE_INITIALIZED 2 +#define PXE_UNDI_GET_STATE_OPENED 3 + pxenv_status_t Status; + uint8_t UNDIstate; +} __packed t_PXENV_UNDI_GET_STATE; + +typedef struct s_PXENV_UNDI_ISR { + pxenv_status_t Status; + uint16_t FuncFlag; + uint16_t BufferLength; + uint16_t FrameLength; + uint16_t FrameHeaderLength; + segoff16_t Frame; + uint8_t ProtType; + uint8_t PktType; +} __packed t_PXENV_UNDI_ISR; + +typedef struct s_PXENV_FILE_API_CHECK { + pxenv_status_t Status; + uint16_t Size; + uint32_t Magic; + uint32_t Provider; + uint32_t APIMask; + uint32_t Flags; +} __packed t_PXENV_FILE_API_CHECK; + +typedef struct s_PXENV_FILE_READ { + pxenv_status_t Status; + uint16_t FileHandle; + uint16_t BufferSize; + segoff16_t Buffer; +} __packed t_PXENV_FILE_READ; + +typedef struct s_PXENV_FILE_OPEN { + pxenv_status_t Status; + uint16_t FileHandle; + segoff16_t FileName; + uint32_t Reserved; +} __packed t_PXENV_FILE_OPEN; + +typedef struct s_PXENV_FILE_CLOSE { + pxenv_status_t Status; + uint16_t FileHandle; +} __packed t_PXENV_FILE_CLOSE; + +typedef struct s_PXENV_GET_FILE_SIZE { + pxenv_status_t Status; + uint16_t FileHandle; + uint32_t FileSize; +} __packed t_PXENV_GET_FILE_SIZE; + +typedef struct s_PXENV_UNLOAD_STACK { + pxenv_status_t Status; + uint8_t reserved[10]; +} __packed t_PXENV_UNLOAD_STACK; + +#define PXENV_UNDI_ISR_IN_START 1 +#define PXENV_UNDI_ISR_IN_PROCESS 2 +#define PXENV_UNDI_ISR_IN_GET_NEXT 3 +/* One of these will be returned for + PXENV_UNDI_ISR_IN_START */ +#define PXENV_UNDI_ISR_OUT_OURS 0 +#define PXENV_UNDI_USR_OUT_NOT_OURS 1 +/* One of these will be returned for + PXENV_UNDI_ISR_IN_PROCESS and + PXENV_UNDI_ISR_IN_GET_NEXT */ +#define PXENV_UNDI_ISR_OUT_DONE 0 +#define PXENV_UNDI_ISR_OUT_TRANSMIT 2 +#define PXENV_UNDI_ISR_OUT_RECEIVE 3 +#define PXENV_UNDI_ISR_OUT_BUSY 4 + +/* Function numbers and error codes */ + +#define PXENV_TFTP_OPEN 0x0020 +#define PXENV_TFTP_CLOSE 0x0021 +#define PXENV_TFTP_READ 0x0022 +#define PXENV_TFTP_READ_FILE 0x0023 +#define PXENV_TFTP_READ_FILE_PMODE 0x0024 +#define PXENV_TFTP_GET_FSIZE 0x0025 + +#define PXENV_UDP_OPEN 0x0030 +#define PXENV_UDP_CLOSE 0x0031 +#define PXENV_UDP_READ 0x0032 +#define PXENV_UDP_WRITE 0x0033 + +#define PXENV_START_UNDI 0x0000 +#define PXENV_UNDI_STARTUP 0x0001 +#define PXENV_UNDI_CLEANUP 0x0002 +#define PXENV_UNDI_INITIALIZE 0x0003 +#define PXENV_UNDI_RESET_NIC 0x0004 +#define PXENV_UNDI_SHUTDOWN 0x0005 +#define PXENV_UNDI_OPEN 0x0006 +#define PXENV_UNDI_CLOSE 0x0007 +#define PXENV_UNDI_TRANSMIT 0x0008 +#define PXENV_UNDI_SET_MCAST_ADDR 0x0009 +#define PXENV_UNDI_SET_STATION_ADDR 0x000A +#define PXENV_UNDI_SET_PACKET_FILTER 0x000B +#define PXENV_UNDI_GET_INFORMATION 0x000C +#define PXENV_UNDI_GET_STATISTICS 0x000D +#define PXENV_UNDI_CLEAR_STATISTICS 0x000E +#define PXENV_UNDI_INITIATE_DIAGS 0x000F +#define PXENV_UNDI_FORCE_INTERRUPT 0x0010 +#define PXENV_UNDI_GET_MCAST_ADDR 0x0011 +#define PXENV_UNDI_GET_NIC_TYPE 0x0012 +#define PXENV_UNDI_GET_IFACE_INFO 0x0013 +#define PXENV_UNDI_ISR 0x0014 +#define PXENV_STOP_UNDI 0x0015 /* Overlap...? */ +#define PXENV_UNDI_GET_STATE 0x0015 /* Overlap...? */ + +#define PXENV_UNLOAD_STACK 0x0070 +#define PXENV_GET_CACHED_INFO 0x0071 +#define PXENV_RESTART_DHCP 0x0072 +#define PXENV_RESTART_TFTP 0x0073 +#define PXENV_MODE_SWITCH 0x0074 +#define PXENV_START_BASE 0x0075 +#define PXENV_STOP_BASE 0x0076 + +/* gPXE extensions... */ +#define PXENV_FILE_OPEN 0x00e0 +#define PXENV_FILE_CLOSE 0x00e1 +#define PXENV_FILE_SELECT 0x00e2 +#define PXENV_FILE_READ 0x00e3 +#define PXENV_GET_FILE_SIZE 0x00e4 +#define PXENV_FILE_EXEC 0x00e5 +#define PXENV_FILE_API_CHECK 0x00e6 + +/* Exit codes */ +#define PXENV_EXIT_SUCCESS 0x0000 +#define PXENV_EXIT_FAILURE 0x0001 + +/* Status codes */ +#define PXENV_STATUS_SUCCESS 0x00 +#define PXENV_STATUS_FAILURE 0x01 +#define PXENV_STATUS_BAD_FUNC 0x02 +#define PXENV_STATUS_UNSUPPORTED 0x03 +#define PXENV_STATUS_KEEP_UNDI 0x04 +#define PXENV_STATUS_KEEP_ALL 0x05 +#define PXENV_STATUS_OUT_OF_RESOURCES 0x06 +#define PXENV_STATUS_ARP_TIMEOUT 0x11 +#define PXENV_STATUS_UDP_CLOSED 0x18 +#define PXENV_STATUS_UDP_OPEN 0x19 +#define PXENV_STATUS_TFTP_CLOSED 0x1a +#define PXENV_STATUS_TFTP_OPEN 0x1b +#define PXENV_STATUS_MCOPY_PROBLEM 0x20 +#define PXENV_STATUS_BIS_INTEGRITY_FAILURE 0x21 +#define PXENV_STATUS_BIS_VALIDATE_FAILURE 0x22 +#define PXENV_STATUS_BIS_INIT_FAILURE 0x23 +#define PXENV_STATUS_BIS_SHUTDOWN_FAILURE 0x24 +#define PXENV_STATUS_BIS_GBOA_FAILURE 0x25 +#define PXENV_STATUS_BIS_FREE_FAILURE 0x26 +#define PXENV_STATUS_BIS_GSI_FAILURE 0x27 +#define PXENV_STATUS_BIS_BAD_CKSUM 0x28 +#define PXENV_STATUS_TFTP_CANNOT_ARP_ADDRESS 0x30 +#define PXENV_STATUS_TFTP_OPEN_TIMEOUT 0x32 + +#define PXENV_STATUS_TFTP_UNKNOWN_OPCODE 0x33 +#define PXENV_STATUS_TFTP_READ_TIMEOUT 0x35 +#define PXENV_STATUS_TFTP_ERROR_OPCODE 0x36 +#define PXENV_STATUS_TFTP_CANNOT_OPEN_CONNECTION 0x38 +#define PXENV_STATUS_TFTP_CANNOT_READ_FROM_CONNECTION 0x39 +#define PXENV_STATUS_TFTP_TOO_MANY_PACKAGES 0x3a +#define PXENV_STATUS_TFTP_FILE_NOT_FOUND 0x3b +#define PXENV_STATUS_TFTP_ACCESS_VIOLATION 0x3c +#define PXENV_STATUS_TFTP_NO_MCAST_ADDRESS 0x3d +#define PXENV_STATUS_TFTP_NO_FILESIZE 0x3e +#define PXENV_STATUS_TFTP_INVALID_PACKET_SIZE 0x3f +#define PXENV_STATUS_DHCP_TIMEOUT 0x51 +#define PXENV_STATUS_DHCP_NO_IP_ADDRESS 0x52 +#define PXENV_STATUS_DHCP_NO_BOOTFILE_NAME 0x53 +#define PXENV_STATUS_DHCP_BAD_IP_ADDRESS 0x54 +#define PXENV_STATUS_UNDI_INVALID_FUNCTION 0x60 +#define PXENV_STATUS_UNDI_MEDIATEST_FAILED 0x61 +#define PXENV_STATUS_UNDI_CANNOT_INIT_NIC_FOR_MCAST 0x62 +#define PXENV_STATUS_UNDI_CANNOT_INITIALIZE_NIC 0x63 +#define PXENV_STATUS_UNDI_CANNOT_INITIALIZE_PHY 0x64 +#define PXENV_STATUS_UNDI_CANNOT_READ_CONFIG_DATA 0x65 +#define PXENV_STATUS_UNDI_CANNOT_READ_INIT_DATA 0x66 +#define PXENV_STATUS_UNDI_BAD_MAC_ADDRESS 0x67 +#define PXENV_STATUS_UNDI_BAD_EEPROM_CHECKSUM 0x68 +#define PXENV_STATUS_UNDI_ERROR_SETTING_ISR 0x69 +#define PXENV_STATUS_UNDI_INVALID_STATE 0x6a +#define PXENV_STATUS_UNDI_TRANSMIT_ERROR 0x6b +#define PXENV_STATUS_UNDI_INVALID_PARAMETER 0x6c +#define PXENV_STATUS_BSTRAP_PROMPT_MENU 0x74 +#define PXENV_STATUS_BSTRAP_MCAST_ADDR 0x76 +#define PXENV_STATUS_BSTRAP_MISSING_LIST 0x77 +#define PXENV_STATUS_BSTRAP_NO_RESPONSE 0x78 +#define PXENV_STATUS_BSTRAP_FILE_TOO_BIG 0x79 +#define PXENV_STATUS_BINL_CANCELED_BY_KEYSTROKE 0xa0 +#define PXENV_STATUS_BINL_NO_PXE_SERVER 0xa1 +#define PXENV_STATUS_NOT_AVAILABLE_IN_PMODE 0xa2 +#define PXENV_STATUS_NOT_AVAILABLE_IN_RMODE 0xa3 +#define PXENV_STATUS_BUSD_DEVICE_NOT_SUPPORTED 0xb0 +#define PXENV_STATUS_LOADER_NO_FREE_BASE_MEMORY 0xc0 +#define PXENV_STATUS_LOADER_NO_BC_ROMID 0xc1 +#define PXENV_STATUS_LOADER_BAD_BC_ROMID 0xc2 +#define PXENV_STATUS_LOADER_BAD_BC_RUNTIME_IMAGE 0xc3 +#define PXENV_STATUS_LOADER_NO_UNDI_ROMID 0xc4 +#define PXENV_STATUS_LOADER_BAD_UNDI_ROMID 0xc5 +#define PXENV_STATUS_LOADER_BAD_UNDI_DRIVER_IMAGE 0xc6 +#define PXENV_STATUS_LOADER_NO_PXE_STRUCT 0xc8 +#define PXENV_STATUS_LOADER_NO_PXENV_STRUCT 0xc9 +#define PXENV_STATUS_LOADER_UNDI_START 0xca +#define PXENV_STATUS_LOADER_BC_START 0xcb + +#endif /* _SYSLINUX_PXE_API_H */ diff --git a/contrib/syslinux-4.02/com32/include/syslinux/reboot.h b/contrib/syslinux-4.02/com32/include/syslinux/reboot.h new file mode 100644 index 0000000..e589982 --- /dev/null +++ b/contrib/syslinux-4.02/com32/include/syslinux/reboot.h @@ -0,0 +1,41 @@ +/* ----------------------------------------------------------------------- * + * + * 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/reboot.h + * + * Reboot the system + */ + +#ifndef _SYSLINUX_REBOOT_H +#define _SYSLINUX_REBOOT_H + +#include <klibc/compiler.h> + +__noreturn syslinux_reboot(int warm); + +#endif /* _SYSLINUX_REBOOT_H */ diff --git a/contrib/syslinux-4.02/com32/include/syslinux/resolve.h b/contrib/syslinux-4.02/com32/include/syslinux/resolve.h new file mode 100644 index 0000000..0589c33 --- /dev/null +++ b/contrib/syslinux-4.02/com32/include/syslinux/resolve.h @@ -0,0 +1,41 @@ +/* ----------------------------------------------------------------------- * + * + * 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/resolve.h + * + * Interface to the syslinux DNS query API + */ + +#ifndef _SYSLINUX_RESOLVE_H +#define _SYSLINUX_RESOLVE_H + +#include <netinet/in.h> + +in_addr_t syslinux_resolve_hostname(const char *); + +#endif /* _SYSLINUX_RESOLVE_H */ diff --git a/contrib/syslinux-4.02/com32/include/syslinux/vesacon.h b/contrib/syslinux-4.02/com32/include/syslinux/vesacon.h new file mode 100644 index 0000000..b99e649 --- /dev/null +++ b/contrib/syslinux-4.02/com32/include/syslinux/vesacon.h @@ -0,0 +1,39 @@ +/* ----------------------------------------------------------------------- * + * + * 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. + * + * ----------------------------------------------------------------------- */ + +#ifndef _SYSLINUX_VESACON_H +#define _SYSLINUX_VESACON_H + +#include <stdbool.h> + +int vesacon_default_background(void); +void vesacon_set_resolution(int, int); +int vesacon_load_background(const char *); +int vesacon_set_background(unsigned int); +void vesacon_cursor_enable(bool); + +#endif /* _SYSLINUX_VESACON_H */ diff --git a/contrib/syslinux-4.02/com32/include/syslinux/video.h b/contrib/syslinux-4.02/com32/include/syslinux/video.h new file mode 100644 index 0000000..f22828a --- /dev/null +++ b/contrib/syslinux-4.02/com32/include/syslinux/video.h @@ -0,0 +1,43 @@ +/* ----------------------------------------------------------------------- * + * + * 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/video.h + * + * SYSLINUX video API functions. + */ + +#ifndef _SYSLINUX_VIDEO_H +#define _SYSLINUX_VIDEO_H + +#include <stdint.h> + +void syslinux_force_text_mode(void); +void syslinux_report_video_mode(uint16_t flags, uint16_t xsize, uint16_t ysize); +int syslinux_font_query(uint8_t **font); + +#endif /* _SYSLINUX_API_H */ diff --git a/contrib/syslinux-4.02/com32/include/syslinux/zio.h b/contrib/syslinux-4.02/com32/include/syslinux/zio.h new file mode 100644 index 0000000..23991e5 --- /dev/null +++ b/contrib/syslinux-4.02/com32/include/syslinux/zio.h @@ -0,0 +1,13 @@ +/* + * <syslinux/zio.h> + */ + +#ifndef _SYSLINUX_ZIO_H +#define _SYSLINUX_ZIO_H + +#include <stdio.h> + +int zopen(const char *, int, ...); +FILE *zfopen(const char *, const char *); + +#endif /* _SYSLINUX_ZIO_H */ |