diff options
Diffstat (limited to 'gpxe/src/arch/i386/include')
50 files changed, 326 insertions, 248 deletions
diff --git a/gpxe/src/arch/i386/include/basemem.h b/gpxe/src/arch/i386/include/basemem.h index cd5668e0..c477c7fe 100644 --- a/gpxe/src/arch/i386/include/basemem.h +++ b/gpxe/src/arch/i386/include/basemem.h @@ -7,6 +7,8 @@ * */ +FILE_LICENCE ( GPL2_OR_LATER ); + #include <stdint.h> #include <realmode.h> #include <bios.h> diff --git a/gpxe/src/arch/i386/include/basemem_packet.h b/gpxe/src/arch/i386/include/basemem_packet.h index e4d4f49c..3cb47767 100644 --- a/gpxe/src/arch/i386/include/basemem_packet.h +++ b/gpxe/src/arch/i386/include/basemem_packet.h @@ -1,6 +1,8 @@ #ifndef BASEMEM_PACKET_H #define BASEMEM_PACKET_H +FILE_LICENCE ( GPL2_OR_LATER ); + #include <realmode.h> /** Maximum length of base memory packet buffer */ diff --git a/gpxe/src/arch/i386/include/bios.h b/gpxe/src/arch/i386/include/bios.h index 979a092c..70bb73da 100644 --- a/gpxe/src/arch/i386/include/bios.h +++ b/gpxe/src/arch/i386/include/bios.h @@ -1,6 +1,8 @@ #ifndef BIOS_H #define BIOS_H +FILE_LICENCE ( GPL2_OR_LATER ); + #define BDA_SEG 0x0040 #define BDA_FBMS 0x0013 #define BDA_NUM_DRIVES 0x0075 diff --git a/gpxe/src/arch/i386/include/biosint.h b/gpxe/src/arch/i386/include/biosint.h index d365cf01..ab466af3 100644 --- a/gpxe/src/arch/i386/include/biosint.h +++ b/gpxe/src/arch/i386/include/biosint.h @@ -6,6 +6,8 @@ * */ +FILE_LICENCE ( GPL2_OR_LATER ); + #include <realmode.h> struct segoff; diff --git a/gpxe/src/arch/i386/include/bits/byteswap.h b/gpxe/src/arch/i386/include/bits/byteswap.h index 98418c29..ddbd40ed 100644 --- a/gpxe/src/arch/i386/include/bits/byteswap.h +++ b/gpxe/src/arch/i386/include/bits/byteswap.h @@ -1,6 +1,8 @@ #ifndef ETHERBOOT_BITS_BYTESWAP_H #define ETHERBOOT_BITS_BYTESWAP_H +FILE_LICENCE ( GPL2_OR_LATER ); + static inline __attribute__ ((always_inline, const)) uint16_t __bswap_variable_16(uint16_t x) { diff --git a/gpxe/src/arch/i386/include/bits/compiler.h b/gpxe/src/arch/i386/include/bits/compiler.h index 119a9a21..000db0c1 100644 --- a/gpxe/src/arch/i386/include/bits/compiler.h +++ b/gpxe/src/arch/i386/include/bits/compiler.h @@ -1,6 +1,8 @@ #ifndef _BITS_COMPILER_H #define _BITS_COMPILER_H +FILE_LICENCE ( GPL2_OR_LATER ); + #ifndef ASSEMBLY /** Declare a function with standard calling conventions */ diff --git a/gpxe/src/arch/i386/include/bits/endian.h b/gpxe/src/arch/i386/include/bits/endian.h index 413e702d..84188542 100644 --- a/gpxe/src/arch/i386/include/bits/endian.h +++ b/gpxe/src/arch/i386/include/bits/endian.h @@ -1,6 +1,8 @@ #ifndef ETHERBOOT_BITS_ENDIAN_H #define ETHERBOOT_BITS_ENDIAN_H +FILE_LICENCE ( GPL2_OR_LATER ); + #define __BYTE_ORDER __LITTLE_ENDIAN #endif /* ETHERBOOT_BITS_ENDIAN_H */ diff --git a/gpxe/src/arch/i386/include/bits/errfile.h b/gpxe/src/arch/i386/include/bits/errfile.h index 5ea8a318..32b8a085 100644 --- a/gpxe/src/arch/i386/include/bits/errfile.h +++ b/gpxe/src/arch/i386/include/bits/errfile.h @@ -1,6 +1,8 @@ #ifndef _BITS_ERRFILE_H #define _BITS_ERRFILE_H +FILE_LICENCE ( GPL2_OR_LATER ); + /** * @addtogroup errfile Error file identifiers * @{ @@ -12,6 +14,7 @@ #define ERRFILE_bios_smbios ( ERRFILE_ARCH | ERRFILE_CORE | 0x00030000 ) #define ERRFILE_biosint ( ERRFILE_ARCH | ERRFILE_CORE | 0x00040000 ) #define ERRFILE_int13 ( ERRFILE_ARCH | ERRFILE_CORE | 0x00050000 ) +#define ERRFILE_pxeparent ( ERRFILE_ARCH | ERRFILE_CORE | 0x00060000 ) #define ERRFILE_bootsector ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x00000000 ) #define ERRFILE_bzimage ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x00010000 ) diff --git a/gpxe/src/arch/i386/include/bits/io.h b/gpxe/src/arch/i386/include/bits/io.h index dd0ee444..eded9778 100644 --- a/gpxe/src/arch/i386/include/bits/io.h +++ b/gpxe/src/arch/i386/include/bits/io.h @@ -7,6 +7,8 @@ * */ +FILE_LICENCE ( GPL2_OR_LATER ); + #include <gpxe/x86_io.h> #endif /* _BITS_IO_H */ diff --git a/gpxe/src/arch/i386/include/bits/nap.h b/gpxe/src/arch/i386/include/bits/nap.h index f8ba7a7c..1354f6bb 100644 --- a/gpxe/src/arch/i386/include/bits/nap.h +++ b/gpxe/src/arch/i386/include/bits/nap.h @@ -7,6 +7,8 @@ * */ +FILE_LICENCE ( GPL2_OR_LATER ); + #include <gpxe/bios_nap.h> #include <gpxe/efi/efix86_nap.h> diff --git a/gpxe/src/arch/i386/include/bits/smbios.h b/gpxe/src/arch/i386/include/bits/smbios.h index 647ea19e..a68413aa 100644 --- a/gpxe/src/arch/i386/include/bits/smbios.h +++ b/gpxe/src/arch/i386/include/bits/smbios.h @@ -7,6 +7,8 @@ * */ +FILE_LICENCE ( GPL2_OR_LATER ); + #include <gpxe/bios_smbios.h> #endif /* _BITS_SMBIOS_H */ diff --git a/gpxe/src/arch/i386/include/bits/stdint.h b/gpxe/src/arch/i386/include/bits/stdint.h index 6ccf0971..8edf1319 100644 --- a/gpxe/src/arch/i386/include/bits/stdint.h +++ b/gpxe/src/arch/i386/include/bits/stdint.h @@ -1,8 +1,10 @@ #ifndef _BITS_STDINT_H #define _BITS_STDINT_H -typedef unsigned int size_t; -typedef signed int ssize_t; +FILE_LICENCE ( GPL2_OR_LATER ); + +typedef __SIZE_TYPE__ size_t; +typedef signed long ssize_t; typedef signed long off_t; typedef unsigned char uint8_t; diff --git a/gpxe/src/arch/i386/include/bits/timer.h b/gpxe/src/arch/i386/include/bits/timer.h index 99666d84..32e6bd47 100644 --- a/gpxe/src/arch/i386/include/bits/timer.h +++ b/gpxe/src/arch/i386/include/bits/timer.h @@ -7,6 +7,8 @@ * */ +FILE_LICENCE ( GPL2_OR_LATER ); + #include <gpxe/bios_timer.h> #include <gpxe/rdtsc_timer.h> diff --git a/gpxe/src/arch/i386/include/bits/uaccess.h b/gpxe/src/arch/i386/include/bits/uaccess.h index 0ecc5028..2bb52e02 100644 --- a/gpxe/src/arch/i386/include/bits/uaccess.h +++ b/gpxe/src/arch/i386/include/bits/uaccess.h @@ -7,6 +7,8 @@ * */ +FILE_LICENCE ( GPL2_OR_LATER ); + #include <librm.h> #endif /* _BITS_UACCESS_H */ diff --git a/gpxe/src/arch/i386/include/bits/umalloc.h b/gpxe/src/arch/i386/include/bits/umalloc.h index dcbd0a6b..17ba2cb2 100644 --- a/gpxe/src/arch/i386/include/bits/umalloc.h +++ b/gpxe/src/arch/i386/include/bits/umalloc.h @@ -7,6 +7,8 @@ * */ +FILE_LICENCE ( GPL2_OR_LATER ); + #include <gpxe/memtop_umalloc.h> #endif /* _BITS_UMALLOC_H */ diff --git a/gpxe/src/arch/i386/include/bootsector.h b/gpxe/src/arch/i386/include/bootsector.h index e9071052..8730fbfc 100644 --- a/gpxe/src/arch/i386/include/bootsector.h +++ b/gpxe/src/arch/i386/include/bootsector.h @@ -6,6 +6,8 @@ * x86 bootsector image format */ +FILE_LICENCE ( GPL2_OR_LATER ); + extern int call_bootsector ( unsigned int segment, unsigned int offset, unsigned int drive ); diff --git a/gpxe/src/arch/i386/include/bzimage.h b/gpxe/src/arch/i386/include/bzimage.h index aee058ae..42b31fe4 100644 --- a/gpxe/src/arch/i386/include/bzimage.h +++ b/gpxe/src/arch/i386/include/bzimage.h @@ -1,6 +1,8 @@ #ifndef _BZIMAGE_H #define _BZIMAGE_H +FILE_LICENCE ( GPL2_OR_LATER ); + #include <stdint.h> /** @@ -75,6 +77,9 @@ struct bzimage_header { /** Offset of bzImage header within kernel image */ #define BZI_HDR_OFFSET 0x1f1 +/** bzImage boot flag value */ +#define BZI_BOOT_FLAG 0xaa55 + /** bzImage magic signature value */ #define BZI_SIGNATURE 0x53726448 diff --git a/gpxe/src/arch/i386/include/callbacks_arch.h b/gpxe/src/arch/i386/include/callbacks_arch.h deleted file mode 100644 index f9cba488..00000000 --- a/gpxe/src/arch/i386/include/callbacks_arch.h +++ /dev/null @@ -1,243 +0,0 @@ -/* Callout/callback interface for Etherboot - * - * This file provides the mechanisms for making calls from Etherboot - * to external programs and vice-versa. - * - * Initial version by Michael Brown <mbrown@fensystems.co.uk>, January 2004. - * - * $Id$ - */ - -#ifndef CALLBACKS_ARCH_H -#define CALLBACKS_ARCH_H - -/* Skip the definitions that won't make sense to the assembler */ -#ifndef ASSEMBLY - -/* Struct to hold general-purpose register values. PUSHAL and POPAL - * can work directly with this structure; do not change the order of - * registers. - */ -typedef struct { - union { - uint16_t di; - uint32_t edi; - }; - union { - uint16_t si; - uint32_t esi; - }; - union { - uint16_t bp; - uint32_t ebp; - }; - union { - uint16_t sp; - uint32_t esp; - }; - union { - struct { - uint8_t bl; - uint8_t bh; - } PACKED; - uint16_t bx; - uint32_t ebx; - }; - union { - struct { - uint8_t dl; - uint8_t dh; - } PACKED; - uint16_t dx; - uint32_t edx; - }; - union { - struct { - uint8_t cl; - uint8_t ch; - } PACKED; - uint16_t cx; - uint32_t ecx; - }; - union { - struct { - uint8_t al; - uint8_t ah; - } PACKED; - uint16_t ax; - uint32_t eax; - }; -} regs_t; - -/* Struct to hold segment register values. Don't change the order; - * many bits of assembly code rely on it. - */ -typedef struct { - uint16_t cs; - uint16_t ss; - uint16_t ds; - uint16_t es; - uint16_t fs; - uint16_t gs; -} PACKED seg_regs_t; - -/* Struct for a GDT descriptor */ -typedef struct { - uint16_t limit; - uint32_t address; - uint16_t padding; -} PACKED gdt_descriptor_t; - -/* Struct for a GDT entry. Use GDT_SEGMENT() to fill it in. - */ -typedef struct { - uint16_t limit_0_15; - uint16_t base_0_15; - uint8_t base_16_23; - uint8_t accessed__type__sflag__dpl__present; - uint8_t limit_16_19__avl__size__granularity; - uint8_t base_24_31; -} PACKED gdt_segment_t; - -#define GDT_SEGMENT(base,limit,type,sflag,dpl,avl,size,granularity) \ - ( (gdt_segment_t) { \ - ( (limit) & 0xffff ), \ - ( (base) & 0xffff ), \ - ( ( (base) >> 16 ) & 0xff ), \ - ( ( 1 << 0 ) | ( (type) << 1 ) | \ - ( (sflag) << 4 ) | ( (dpl) << 5 ) | ( 1 << 7 ) ), \ - ( ( (limit) >> 16 ) | \ - ( (avl) << 4 ) | ( (size) << 5 ) | ( (granularity) << 7 ) ),\ - ( (base) >> 24 ) \ - } ) -#define GDT_SEGMENT_BASE(gdt_segment) \ - ( (gdt_segment)->base_0_15 | \ - (gdt_segment)->base_16_23 << 16 | \ - (gdt_segment)->base_24_31 << 24 ) -#define GDT_SEGMENT_LIMIT(gdt_segment) \ - ( (gdt_segment)->limit_0_15 | \ - ( ( (gdt_segment)->limit_16_19__avl__size__granularity \ - & 0xf ) << 16 ) ) -#define GDT_SEGMENT_GRANULARITY(gdt_segment) \ - ( ( (gdt_segment)->limit_16_19__avl__size__granularity \ - & 0x80 ) >> 7 ) -#define GDT_SEGMENT_TYPE(gdt_segment) \ - ( ( (gdt_segment)->accessed__type__sflag__dpl__present & 0x0e ) >> 1 ) -#define GDT_SEGMENT_SIZE(gdt_segment) \ - ( ( (gdt_segment)->limit_16_19__avl__size__granularity \ - & 0x60 ) >> 5 ) - -#define GDT_TYPE_DATA (0x0) -#define GDT_TYPE_STACK (0x2) -#define GDT_TYPE_WRITEABLE (0x1) -#define GDT_TYPE_CODE (0x6) -#define GDT_TYPE_EXEC_ONLY_CODE (0x4) -#define GDT_TYPE_CONFORMING (0x1) -#define GDT_SFLAG_SYSTEM (0) -#define GDT_SFLAG_NORMAL (1) -#define GDT_AVL_NORMAL (0) -#define GDT_SIZE_16BIT (0x0) -#define GDT_SIZE_32BIT (0x2) -#define GDT_SIZE_64BIT (0x1) -#define GDT_SIZE_UNKNOWN (0x3) -#define GDT_GRANULARITY_SMALL (0) -#define GDT_GRANULARITY_LARGE (1) -#define GDT_SEGMENT_NORMAL(base,limit,type,size,granularity) \ - GDT_SEGMENT ( base, limit, type, \ - GDT_SFLAG_NORMAL, 0, GDT_AVL_NORMAL, \ - size, granularity ) - -/* Protected mode code segment */ -#define GDT_SEGMENT_PMCS(base) GDT_SEGMENT_NORMAL ( \ - base, 0xfffff, GDT_TYPE_CODE | GDT_TYPE_CONFORMING, \ - GDT_SIZE_32BIT, GDT_GRANULARITY_LARGE ) -#define GDT_SEGMENT_PMCS_PHYS GDT_SEGMENT_PMCS(0) -/* Protected mode data segment */ -#define GDT_SEGMENT_PMDS(base) GDT_SEGMENT_NORMAL ( \ - base, 0xfffff, GDT_TYPE_DATA | GDT_TYPE_WRITEABLE, \ - GDT_SIZE_32BIT, GDT_GRANULARITY_LARGE ) -#define GDT_SEGMENT_PMDS_PHYS GDT_SEGMENT_PMDS(0) -/* Real mode code segment */ -/* Not sure if there's any reason to use GDT_TYPE_EXEC_ONLY_CODE - * instead of just GDT_TYPE_CODE, but that's what our old GDT did and - * it worked, so I'm not changing it. - */ -#define GDT_SEGMENT_RMCS(base) GDT_SEGMENT_NORMAL ( \ - base, 0xffff, GDT_TYPE_EXEC_ONLY_CODE | GDT_TYPE_CONFORMING, \ - GDT_SIZE_16BIT, GDT_GRANULARITY_SMALL ) -/* Real mode data segment */ -#define GDT_SEGMENT_RMDS(base) GDT_SEGMENT_NORMAL ( \ - base, 0xffff, GDT_TYPE_DATA | GDT_TYPE_WRITEABLE, \ - GDT_SIZE_16BIT, GDT_GRANULARITY_SMALL ) -/* Long mode code segment */ -#define GDT_SEGMENT_LMCS(base) GDT_SEGMENT_NORMAL ( \ - base, 0xfffff, GDT_TYPE_CODE | GDT_TYPE_CONFORMING, \ - GDT_SIZE_64BIT, GDT_GRANULARITY_LARGE ) -#define GDT_SEGMENT_LMCS_PHYS GDT_SEGMENT_LMCS(0) -/* Long mode data segment */ -/* AFIACT, GDT_SIZE_64BIT applies only to code segments */ -#define GDT_SEGMENT_LMDS(base) GDT_SEGMENT_NORMAL ( \ - base, 0xfffff, GDT_TYPE_DATA | GDT_TYPE_WRITEABLE, \ - GDT_SIZE_32BIT, GDT_GRANULARITY_LARGE ) -#define GDT_SEGMENT_LMDS_PHYS GDT_SEGMENT_LMDS(0) - -/* Template for creating GDT structures (including segment register - * lists), suitable for passing as parameters to external_call(). - */ -#define GDT_STRUCT_t(num_segments) \ - struct { \ - gdt_descriptor_t descriptor; \ - gdt_segment_t segments[num_segments]; \ - } PACKED -/* And utility function for filling it in */ -#define GDT_ADJUST(structure) { \ - (structure)->descriptor.address = \ - virt_to_phys(&((structure)->descriptor.limit)); \ - (structure)->descriptor.limit = \ - sizeof((structure)->segments) + 8 - 1; \ - (structure)->descriptor.padding = 0; \ -} - -/* Data passed in to in_call() by assembly wrapper. - */ -typedef struct { - regs_t regs; - seg_regs_t seg_regs; - gdt_descriptor_t gdt_desc; - uint32_t flags; - struct { - uint32_t offset; - uint32_t segment; - } ret_addr; -} PACKED i386_pm_in_call_data_t; - -typedef struct { - seg_regs_t seg_regs; - union { - uint16_t pad; - uint16_t prefix_sp; - }; - uint16_t flags; - struct { - uint16_t offset; - uint16_t segment; - } ret_addr; - uint32_t orig_opcode; -} PACKED i386_rm_in_call_data_t; - -typedef struct { - i386_pm_in_call_data_t *pm; - i386_rm_in_call_data_t *rm; -} i386_in_call_data_t; -#define in_call_data_t i386_in_call_data_t - -/* Function prototypes - */ -extern int install_rm_callback_interface ( void *address, size_t available ); - -#endif /* ASSEMBLY */ - -#define RM_IN_CALL (0) -#define RM_IN_CALL_FAR (2) - -#endif /* CALLBACKS_ARCH_H */ diff --git a/gpxe/src/arch/i386/include/comboot.h b/gpxe/src/arch/i386/include/comboot.h index 56661a80..1232f0a7 100644 --- a/gpxe/src/arch/i386/include/comboot.h +++ b/gpxe/src/arch/i386/include/comboot.h @@ -7,6 +7,8 @@ * SYSLINUX COMBOOT */ +FILE_LICENCE ( GPL2_OR_LATER ); + #include <stdint.h> #include <setjmp.h> #include <gpxe/in.h> diff --git a/gpxe/src/arch/i386/include/fakee820.h b/gpxe/src/arch/i386/include/fakee820.h index f1fe8aff..9d00fb67 100644 --- a/gpxe/src/arch/i386/include/fakee820.h +++ b/gpxe/src/arch/i386/include/fakee820.h @@ -1,6 +1,8 @@ #ifndef _FAKEE820_H #define _FAKEE820_H +FILE_LICENCE ( GPL2_OR_LATER ); + extern void fake_e820 ( void ); extern void unfake_e820 ( void ); diff --git a/gpxe/src/arch/i386/include/gpxe/abft.h b/gpxe/src/arch/i386/include/gpxe/abft.h index 1c651ef1..9065e61a 100644 --- a/gpxe/src/arch/i386/include/gpxe/abft.h +++ b/gpxe/src/arch/i386/include/gpxe/abft.h @@ -7,6 +7,8 @@ * */ +FILE_LICENCE ( GPL2_OR_LATER ); + #include <stdint.h> #include <gpxe/acpi.h> #include <gpxe/if_ether.h> diff --git a/gpxe/src/arch/i386/include/gpxe/bios_nap.h b/gpxe/src/arch/i386/include/gpxe/bios_nap.h index f1c721e9..c32429b9 100644 --- a/gpxe/src/arch/i386/include/gpxe/bios_nap.h +++ b/gpxe/src/arch/i386/include/gpxe/bios_nap.h @@ -7,6 +7,8 @@ * */ +FILE_LICENCE ( GPL2_OR_LATER ); + #ifdef NAP_PCBIOS #define NAP_PREFIX_pcbios #else diff --git a/gpxe/src/arch/i386/include/gpxe/bios_smbios.h b/gpxe/src/arch/i386/include/gpxe/bios_smbios.h index 0a6f277a..83726b11 100644 --- a/gpxe/src/arch/i386/include/gpxe/bios_smbios.h +++ b/gpxe/src/arch/i386/include/gpxe/bios_smbios.h @@ -7,6 +7,8 @@ * */ +FILE_LICENCE ( GPL2_OR_LATER ); + #ifdef SMBIOS_PCBIOS #define SMBIOS_PREFIX_pcbios #else diff --git a/gpxe/src/arch/i386/include/gpxe/bios_timer.h b/gpxe/src/arch/i386/include/gpxe/bios_timer.h index 7e3caa3c..ed9df522 100644 --- a/gpxe/src/arch/i386/include/gpxe/bios_timer.h +++ b/gpxe/src/arch/i386/include/gpxe/bios_timer.h @@ -7,6 +7,8 @@ * */ +FILE_LICENCE ( GPL2_OR_LATER ); + #ifdef TIMER_PCBIOS #define TIMER_PREFIX_pcbios #else diff --git a/gpxe/src/arch/i386/include/gpxe/ibft.h b/gpxe/src/arch/i386/include/gpxe/ibft.h index 5eef547b..c41e2e40 100644 --- a/gpxe/src/arch/i386/include/gpxe/ibft.h +++ b/gpxe/src/arch/i386/include/gpxe/ibft.h @@ -28,6 +28,8 @@ * */ +FILE_LICENCE ( BSD2 ); + /** @file * * iSCSI boot firmware table diff --git a/gpxe/src/arch/i386/include/gpxe/memtop_umalloc.h b/gpxe/src/arch/i386/include/gpxe/memtop_umalloc.h index a3cd2c01..eaf7025b 100644 --- a/gpxe/src/arch/i386/include/gpxe/memtop_umalloc.h +++ b/gpxe/src/arch/i386/include/gpxe/memtop_umalloc.h @@ -7,6 +7,8 @@ * */ +FILE_LICENCE ( GPL2_OR_LATER ); + #ifdef UMALLOC_MEMTOP #define UMALLOC_PREFIX_memtop #else diff --git a/gpxe/src/arch/i386/include/gpxe/rdtsc_timer.h b/gpxe/src/arch/i386/include/gpxe/rdtsc_timer.h index 0e03d707..67ba22f0 100644 --- a/gpxe/src/arch/i386/include/gpxe/rdtsc_timer.h +++ b/gpxe/src/arch/i386/include/gpxe/rdtsc_timer.h @@ -7,6 +7,8 @@ * */ +FILE_LICENCE ( GPL2_OR_LATER ); + #ifdef TIMER_RDTSC #define TIMER_PREFIX_rdtsc #else diff --git a/gpxe/src/arch/i386/include/gpxe/sbft.h b/gpxe/src/arch/i386/include/gpxe/sbft.h new file mode 100644 index 00000000..30038436 --- /dev/null +++ b/gpxe/src/arch/i386/include/gpxe/sbft.h @@ -0,0 +1,125 @@ +#ifndef _GPXE_SBFT_H +#define _GPXE_SBFT_H + +/* + * Copyright (C) 2009 Fen Systems Ltd <mbrown@fensystems.co.uk>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +FILE_LICENCE ( BSD2 ); + +/** @file + * + * SRP boot firmware table + * + * The working draft specification for the SRP boot firmware table can + * be found at + * + * http://etherboot.org/wiki/srp/sbft + * + */ + +#include <stdint.h> +#include <gpxe/acpi.h> +#include <gpxe/scsi.h> +#include <gpxe/srp.h> +#include <gpxe/ib_srp.h> + +/** SRP Boot Firmware Table signature */ +#define SBFT_SIG "sBFT" + +/** An offset from the start of the sBFT */ +typedef uint16_t sbft_off_t; + +/** + * SRP Boot Firmware Table + */ +struct sbft_table { + /** ACPI header */ + struct acpi_description_header acpi; + /** Offset to SCSI subtable */ + sbft_off_t scsi_offset; + /** Offset to SRP subtable */ + sbft_off_t srp_offset; + /** Offset to IB subtable, if present */ + sbft_off_t ib_offset; + /** Reserved */ + uint8_t reserved[6]; +} __attribute__ (( packed )); + +/** + * sBFT SCSI subtable + */ +struct sbft_scsi_subtable { + /** LUN */ + struct scsi_lun lun; +} __attribute__ (( packed )); + +/** + * sBFT SRP subtable + */ +struct sbft_srp_subtable { + /** Initiator and target ports */ + struct srp_port_ids port_ids; +} __attribute__ (( packed )); + +/** + * sBFT IB subtable + */ +struct sbft_ib_subtable { + /** Source GID */ + struct ib_gid sgid; + /** Destination GID */ + struct ib_gid dgid; + /** Service ID */ + struct ib_gid_half service_id; + /** Partition key */ + uint16_t pkey; + /** Reserved */ + uint8_t reserved[6]; +} __attribute__ (( packed )); + +/** + * An sBFT created by gPXE + */ +struct gpxe_sbft { + /** The table header */ + struct sbft_table table; + /** The SCSI subtable */ + struct sbft_scsi_subtable scsi; + /** The SRP subtable */ + struct sbft_srp_subtable srp; + /** The IB subtable */ + struct sbft_ib_subtable ib; +} __attribute__ (( packed, aligned ( 16 ) )); + +struct srp_device; + +extern int sbft_fill_data ( struct srp_device *srp ); + +#endif /* _GPXE_SBFT_H */ diff --git a/gpxe/src/arch/i386/include/gpxe/timer2.h b/gpxe/src/arch/i386/include/gpxe/timer2.h index 59705fa2..8f119515 100644 --- a/gpxe/src/arch/i386/include/gpxe/timer2.h +++ b/gpxe/src/arch/i386/include/gpxe/timer2.h @@ -7,6 +7,8 @@ * */ +FILE_LICENCE ( GPL2_OR_LATER ); + extern void timer2_udelay ( unsigned long usecs ); #endif /* _GPXE_TIMER2_H */ diff --git a/gpxe/src/arch/i386/include/gpxe/x86_io.h b/gpxe/src/arch/i386/include/gpxe/x86_io.h index b1ae3bac..beb5b22a 100644 --- a/gpxe/src/arch/i386/include/gpxe/x86_io.h +++ b/gpxe/src/arch/i386/include/gpxe/x86_io.h @@ -15,6 +15,8 @@ * into a machine with such an old CPU anyway. */ +FILE_LICENCE ( GPL2_OR_LATER ); + #ifdef IOAPI_X86 #define IOAPI_PREFIX_x86 #else diff --git a/gpxe/src/arch/i386/include/int13.h b/gpxe/src/arch/i386/include/int13.h index bf6d0318..e1884d94 100644 --- a/gpxe/src/arch/i386/include/int13.h +++ b/gpxe/src/arch/i386/include/int13.h @@ -7,6 +7,8 @@ * */ +FILE_LICENCE ( GPL2_OR_LATER ); + #include <stdint.h> #include <gpxe/list.h> #include <realmode.h> diff --git a/gpxe/src/arch/i386/include/librm.h b/gpxe/src/arch/i386/include/librm.h index 9eb2767a..f193f5e3 100755..100644 --- a/gpxe/src/arch/i386/include/librm.h +++ b/gpxe/src/arch/i386/include/librm.h @@ -1,6 +1,8 @@ #ifndef LIBRM_H #define LIBRM_H +FILE_LICENCE ( GPL2_OR_LATER ); + /* Segment selectors as used in our protected-mode GDTs. * * Don't change these unless you really know what you're doing. diff --git a/gpxe/src/arch/i386/include/limits.h b/gpxe/src/arch/i386/include/limits.h index f13db267..031b6c57 100644 --- a/gpxe/src/arch/i386/include/limits.h +++ b/gpxe/src/arch/i386/include/limits.h @@ -1,6 +1,8 @@ #ifndef LIMITS_H #define LIMITS_H 1 +FILE_LICENCE ( GPL2_OR_LATER ); + /* Number of bits in a `char' */ #define CHAR_BIT 8 diff --git a/gpxe/src/arch/i386/include/memsizes.h b/gpxe/src/arch/i386/include/memsizes.h index 6222fd66..7b217494 100644 --- a/gpxe/src/arch/i386/include/memsizes.h +++ b/gpxe/src/arch/i386/include/memsizes.h @@ -1,6 +1,8 @@ #ifndef _MEMSIZES_H #define _MEMSIZES_H +FILE_LICENCE ( GPL2_OR_LATER ); + #include <basemem.h> /** diff --git a/gpxe/src/arch/i386/include/multiboot.h b/gpxe/src/arch/i386/include/multiboot.h index 4ca7089b..44614c73 100644 --- a/gpxe/src/arch/i386/include/multiboot.h +++ b/gpxe/src/arch/i386/include/multiboot.h @@ -8,6 +8,8 @@ * */ +FILE_LICENCE ( GPL2_OR_LATER ); + #include <stdint.h> /** The magic number for the Multiboot header */ diff --git a/gpxe/src/arch/i386/include/pic8259.h b/gpxe/src/arch/i386/include/pic8259.h index 0c501a9c..f8e20c4c 100644 --- a/gpxe/src/arch/i386/include/pic8259.h +++ b/gpxe/src/arch/i386/include/pic8259.h @@ -4,6 +4,8 @@ * Initially written by Michael Brown (mcb30). */ +FILE_LICENCE ( GPL2_OR_LATER ); + #ifndef PIC8259_H #define PIC8259_H diff --git a/gpxe/src/arch/i386/include/pnpbios.h b/gpxe/src/arch/i386/include/pnpbios.h index ab31c699..4c20e73e 100644 --- a/gpxe/src/arch/i386/include/pnpbios.h +++ b/gpxe/src/arch/i386/include/pnpbios.h @@ -7,6 +7,8 @@ * */ +FILE_LICENCE ( GPL2_OR_LATER ); + /* BIOS segment address */ #define BIOS_SEG 0xf000 diff --git a/gpxe/src/arch/i386/include/pxe.h b/gpxe/src/arch/i386/include/pxe.h index 6d332ac7..041ee7ba 100644 --- a/gpxe/src/arch/i386/include/pxe.h +++ b/gpxe/src/arch/i386/include/pxe.h @@ -1,6 +1,8 @@ #ifndef PXE_H #define PXE_H +FILE_LICENCE ( GPL2_OR_LATER ); + #include "pxe_types.h" #include "pxe_api.h" #include <gpxe/device.h> @@ -65,6 +67,7 @@ union u_PXENV_ANY { struct s_PXENV_GET_FILE_SIZE get_file_size; struct s_PXENV_FILE_EXEC file_exec; struct s_PXENV_FILE_API_CHECK file_api_check; + struct s_PXENV_FILE_EXIT_HOOK file_exit_hook; }; typedef union u_PXENV_ANY PXENV_ANY_t; diff --git a/gpxe/src/arch/i386/include/pxe_api.h b/gpxe/src/arch/i386/include/pxe_api.h index b3d4bca8..92f046f7 100644 --- a/gpxe/src/arch/i386/include/pxe_api.h +++ b/gpxe/src/arch/i386/include/pxe_api.h @@ -15,6 +15,31 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * As an alternative, at your option, you may use this file under the + * following terms, known as the "MIT license": + * + * Copyright (c) 2005-2009 Michael Brown <mbrown@fensystems.co.uk> + * + * 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. */ /** @file @@ -23,6 +48,8 @@ * */ +FILE_LICENCE ( GPL2_OR_LATER ); + #include "pxe_types.h" /** @addtogroup pxe Preboot eXecution Environment (PXE) API @@ -1415,6 +1442,25 @@ extern PXENV_EXIT_t pxenv_undi_get_nic_type ( /** PXE API function code for pxenv_undi_get_iface_info() */ #define PXENV_UNDI_GET_IFACE_INFO 0x0013 +/** Broadcast supported */ +#define SUPPORTED_BROADCAST 0x0001 +/** Multicast supported */ +#define SUPPORTED_MULTICAST 0x0002 +/** Functional/group addressing supported */ +#define SUPPORTED_GROUP 0x0004 +/** Promiscuous mode supported */ +#define SUPPORTED_PROMISCUOUS 0x0008 +/** Software settable station address */ +#define SUPPORTED_SET_STATION_ADDRESS 0x0010 +/** InitiateDiagnostics supported */ +#define SUPPORTED_DIAGNOSTICS 0x0040 +/** Reset MAC supported */ +#define SUPPORTED_RESET 0x0400 +/** Open / Close Adapter supported */ +#define SUPPORTED_OPEN_CLOSE 0x0800 +/** Interrupt Request supported */ +#define SUPPORTED_IRQ 0x1000 + /** Parameter block for pxenv_undi_get_iface_info() */ struct s_PXENV_UNDI_GET_IFACE_INFO { PXENV_STATUS_t Status; /**< PXE status code */ @@ -1732,6 +1778,28 @@ extern PXENV_EXIT_t pxenv_file_api_check ( struct s_PXENV_FILE_API_CHECK *file_a /** @} */ /* pxenv_file_api_check */ +/** @defgroup pxenv_file_exit_hook PXENV_FILE_EXIT_HOOK + * + * FILE EXIT HOOK + * + * @{ + */ + +/** PXE API function code for pxenv_file_exit_hook() */ +#define PXENV_FILE_EXIT_HOOK 0x00e7 + +/** Parameter block for pxenv_file_exit_hook() */ +struct s_PXENV_FILE_EXIT_HOOK { + PXENV_STATUS_t Status; /**< PXE status code */ + SEGOFF16_t Hook; /**< SEG16:OFF16 to jump to */ +} PACKED; + +typedef struct s_PXENV_FILE_EXIT_HOOK PXENV_FILE_EXIT_HOOK_t; + +extern PXENV_EXIT_t pxenv_file_exit_hook ( struct s_PXENV_FILE_EXIT_HOOK *file_exit_hook ); + +/** @} */ /* pxenv_file_exit_hook */ + /** @} */ /* pxe_file_api */ /** @defgroup pxe_loader_api PXE Loader API diff --git a/gpxe/src/arch/i386/include/pxe_call.h b/gpxe/src/arch/i386/include/pxe_call.h index 2f3ea15a..4d245616 100644 --- a/gpxe/src/arch/i386/include/pxe_call.h +++ b/gpxe/src/arch/i386/include/pxe_call.h @@ -6,9 +6,13 @@ * PXE API entry point */ +FILE_LICENCE ( GPL2_OR_LATER ); + #include <pxe_api.h> #include <realmode.h> +struct net_device; + /** PXE load address segment */ #define PXE_LOAD_SEGMENT 0 @@ -26,10 +30,28 @@ extern struct s_PXE __text16 ( ppxe ); extern struct s_PXENV __text16 ( pxenv ); #define pxenv __use_text16 ( pxenv ) -extern void pxe_hook_int1a ( void ); -extern int pxe_unhook_int1a ( void ); -extern void pxe_init_structures ( void ); +extern void pxe_activate ( struct net_device *netdev ); +extern int pxe_deactivate ( void ); extern int pxe_start_nbp ( void ); extern __asmcall void pxe_api_call ( struct i386_all_regs *ix86 ); +extern int _pxe_api_call_weak ( struct i386_all_regs *ix86 ) + __attribute__ (( weak )); + +/** + * Dispatch PXE API call weakly + * + * @v ix86 Registers for PXE call + * @ret present Zero if the PXE stack is present, nonzero if not + * + * A successful return only indicates that the PXE stack was available + * for dispatching the call; it says nothing about the success of + * whatever the call asked for. + */ +static inline int pxe_api_call_weak ( struct i386_all_regs *ix86 ) +{ + if ( _pxe_api_call_weak != NULL ) + return _pxe_api_call_weak ( ix86 ); + return -1; +} #endif /* _PXE_CALL_H */ diff --git a/gpxe/src/arch/i386/include/pxe_types.h b/gpxe/src/arch/i386/include/pxe_types.h index dd9092ef..a6516d25 100644 --- a/gpxe/src/arch/i386/include/pxe_types.h +++ b/gpxe/src/arch/i386/include/pxe_types.h @@ -7,6 +7,8 @@ * */ +FILE_LICENCE ( GPL2_OR_LATER ); + #include <stdint.h> #include <errno.h> /* PXE status codes */ diff --git a/gpxe/src/arch/i386/include/pxeparent.h b/gpxe/src/arch/i386/include/pxeparent.h new file mode 100644 index 00000000..b31e24a7 --- /dev/null +++ b/gpxe/src/arch/i386/include/pxeparent.h @@ -0,0 +1,11 @@ +#ifndef PXEPARENT_H +#define PXEPARENT_H + +FILE_LICENCE ( GPL2_OR_LATER ); + +#include <pxe_types.h> + +extern int pxeparent_call ( SEGOFF16_t entry, unsigned int function, + void *params, size_t params_len ); + +#endif diff --git a/gpxe/src/arch/i386/include/realmode.h b/gpxe/src/arch/i386/include/realmode.h index 26e6dd77..a0a830b9 100644 --- a/gpxe/src/arch/i386/include/realmode.h +++ b/gpxe/src/arch/i386/include/realmode.h @@ -10,6 +10,8 @@ * */ +FILE_LICENCE ( GPL2_OR_LATER ); + /* * Declaration of variables in .data16 * diff --git a/gpxe/src/arch/i386/include/registers.h b/gpxe/src/arch/i386/include/registers.h index e68fa85a..2839e2bd 100644 --- a/gpxe/src/arch/i386/include/registers.h +++ b/gpxe/src/arch/i386/include/registers.h @@ -10,6 +10,8 @@ * */ +FILE_LICENCE ( GPL2_OR_LATER ); + #include <stdint.h> /** diff --git a/gpxe/src/arch/i386/include/setjmp.h b/gpxe/src/arch/i386/include/setjmp.h index c18d03e1..5d3c11b6 100644 --- a/gpxe/src/arch/i386/include/setjmp.h +++ b/gpxe/src/arch/i386/include/setjmp.h @@ -1,6 +1,8 @@ #ifndef ETHERBOOT_SETJMP_H #define ETHERBOOT_SETJMP_H +FILE_LICENCE ( GPL2_OR_LATER ); + #include <stdint.h> #include <realmode.h> diff --git a/gpxe/src/arch/i386/include/undi.h b/gpxe/src/arch/i386/include/undi.h index c6253d0a..de6925b6 100644 --- a/gpxe/src/arch/i386/include/undi.h +++ b/gpxe/src/arch/i386/include/undi.h @@ -7,6 +7,8 @@ * */ +FILE_LICENCE ( GPL2_OR_LATER ); + #ifndef ASSEMBLY #include <gpxe/device.h> diff --git a/gpxe/src/arch/i386/include/undiload.h b/gpxe/src/arch/i386/include/undiload.h index bfc11874..426830e8 100644 --- a/gpxe/src/arch/i386/include/undiload.h +++ b/gpxe/src/arch/i386/include/undiload.h @@ -7,6 +7,8 @@ * */ +FILE_LICENCE ( GPL2_OR_LATER ); + struct undi_device; struct undi_rom; diff --git a/gpxe/src/arch/i386/include/undinet.h b/gpxe/src/arch/i386/include/undinet.h index 1a4a385e..c3c17c11 100644 --- a/gpxe/src/arch/i386/include/undinet.h +++ b/gpxe/src/arch/i386/include/undinet.h @@ -7,6 +7,8 @@ * */ +FILE_LICENCE ( GPL2_OR_LATER ); + struct undi_device; extern int undinet_probe ( struct undi_device *undi ); diff --git a/gpxe/src/arch/i386/include/undipreload.h b/gpxe/src/arch/i386/include/undipreload.h index d9bc8cb9..de9b8fb5 100644 --- a/gpxe/src/arch/i386/include/undipreload.h +++ b/gpxe/src/arch/i386/include/undipreload.h @@ -7,6 +7,8 @@ * */ +FILE_LICENCE ( GPL2_OR_LATER ); + #include <realmode.h> #include <undi.h> diff --git a/gpxe/src/arch/i386/include/undirom.h b/gpxe/src/arch/i386/include/undirom.h index a2636007..86d7077b 100644 --- a/gpxe/src/arch/i386/include/undirom.h +++ b/gpxe/src/arch/i386/include/undirom.h @@ -7,6 +7,8 @@ * */ +FILE_LICENCE ( GPL2_OR_LATER ); + #include <pxe_types.h> /** An UNDI PCI device ID */ |