diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 16:29:52 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 16:29:52 +0000 |
commit | ca67b09c015d4af3ae3cce12aa72e60941dbb8b5 (patch) | |
tree | b7316d7b06c373e08dabb79a2c866c568e08f49e /debian/grub-extras/disabled/gpxe/include_wrap | |
parent | Adding upstream version 2.06. (diff) | |
download | grub2-ca67b09c015d4af3ae3cce12aa72e60941dbb8b5.tar.xz grub2-ca67b09c015d4af3ae3cce12aa72e60941dbb8b5.zip |
Adding debian version 2.06-13+deb12u1.debian/2.06-13+deb12u1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/grub-extras/disabled/gpxe/include_wrap')
27 files changed, 1381 insertions, 0 deletions
diff --git a/debian/grub-extras/disabled/gpxe/include_wrap/assert.h b/debian/grub-extras/disabled/gpxe/include_wrap/assert.h new file mode 100644 index 0000000..b1a5272 --- /dev/null +++ b/debian/grub-extras/disabled/gpxe/include_wrap/assert.h @@ -0,0 +1 @@ +#include <gpxe/wrap.h> diff --git a/debian/grub-extras/disabled/gpxe/include_wrap/bits/errfile.h b/debian/grub-extras/disabled/gpxe/include_wrap/bits/errfile.h new file mode 100644 index 0000000..b1a5272 --- /dev/null +++ b/debian/grub-extras/disabled/gpxe/include_wrap/bits/errfile.h @@ -0,0 +1 @@ +#include <gpxe/wrap.h> diff --git a/debian/grub-extras/disabled/gpxe/include_wrap/bits/uaccess.h b/debian/grub-extras/disabled/gpxe/include_wrap/bits/uaccess.h new file mode 100644 index 0000000..b1a5272 --- /dev/null +++ b/debian/grub-extras/disabled/gpxe/include_wrap/bits/uaccess.h @@ -0,0 +1 @@ +#include <gpxe/wrap.h> diff --git a/debian/grub-extras/disabled/gpxe/include_wrap/byteswap.h b/debian/grub-extras/disabled/gpxe/include_wrap/byteswap.h new file mode 100644 index 0000000..b1a5272 --- /dev/null +++ b/debian/grub-extras/disabled/gpxe/include_wrap/byteswap.h @@ -0,0 +1 @@ +#include <gpxe/wrap.h> diff --git a/debian/grub-extras/disabled/gpxe/include_wrap/config/ioapi.h b/debian/grub-extras/disabled/gpxe/include_wrap/config/ioapi.h new file mode 100644 index 0000000..b1a5272 --- /dev/null +++ b/debian/grub-extras/disabled/gpxe/include_wrap/config/ioapi.h @@ -0,0 +1 @@ +#include <gpxe/wrap.h> diff --git a/debian/grub-extras/disabled/gpxe/include_wrap/console.h b/debian/grub-extras/disabled/gpxe/include_wrap/console.h new file mode 100644 index 0000000..b1a5272 --- /dev/null +++ b/debian/grub-extras/disabled/gpxe/include_wrap/console.h @@ -0,0 +1 @@ +#include <gpxe/wrap.h> diff --git a/debian/grub-extras/disabled/gpxe/include_wrap/ctype.h b/debian/grub-extras/disabled/gpxe/include_wrap/ctype.h new file mode 100644 index 0000000..b1a5272 --- /dev/null +++ b/debian/grub-extras/disabled/gpxe/include_wrap/ctype.h @@ -0,0 +1 @@ +#include <gpxe/wrap.h> diff --git a/debian/grub-extras/disabled/gpxe/include_wrap/errno.h b/debian/grub-extras/disabled/gpxe/include_wrap/errno.h new file mode 100644 index 0000000..c764fc5 --- /dev/null +++ b/debian/grub-extras/disabled/gpxe/include_wrap/errno.h @@ -0,0 +1,508 @@ +#ifndef ERRNO_H +#define ERRNO_H + +FILE_LICENCE ( GPL2_OR_LATER ); + +/** @file + * + * Error codes + * + * Return status codes as used within gPXE are designed to allow for + * maximum visibility into the source of an error even in an end-user + * build with no debugging. They are constructed as follows: + * + * Bits 7-0 : PXE error code + * + * This is the closest equivalent PXE error code + * (e.g. PXENV_STATUS_OUT_OF_RESOURCES), and is the only part of the + * error that will be returned via the PXE API, since PXE has + * predefined error codes. + * + * Bits 12-8 : Per-file disambiguator + * + * When the same error number can be generated from multiple points + * within a file, this field can be used to identify the unique + * instance. + * + * Bits 23-13 : File identifier + * + * This is a unique identifier for the file generating the error + * (e.g. ERRFILE_tcp for tcp.c). + * + * Bits 30-24 : POSIX error code + * + * This is the closest equivalent POSIX error code (e.g. ENOMEM). + * + * Bit 31 : Reserved + * + * Errors are usually return as negative error numbers (e.g. -EINVAL); + * bit 31 is therefore unusable. + * + * + * The convention within the code is that errors are negative and + * expressed using the POSIX error code and (optionally) a per-file + * disambiguator, e.g. + * + * return -EINVAL; + * + * or + * + * #define ETCP_BAD_CHECKSUM EUNIQ_02 + * return -( EINVAL | ETCP_BAD_CHECKSUM ) + * + * By various bits of preprocessor magic, the PXE error code and file + * identifier are already incorporated into the definition of the + * POSIX error code, which keeps the code relatively clean. + * + * + * Functions that wish to return failures should be declared as + * returning an integer @c rc "Return status code". A return value of + * zero indicates success, a non-zero value indicates failure. The + * return value can be passed directly to strerror() in order to + * generate a human-readable error message, e.g. + * + * if ( ( rc = some_function ( ... ) ) != 0 ) { + * DBG ( "Whatever I was trying to do failed: %s\n", strerror ( rc ) ); + * return rc; + * } + * + * As illustrated in the above example, error returns should generally + * be directly propagated upward to the calling function. + * + */ + +/* Get definitions for file identifiers */ +#include <gpxe/errfile.h> + +/* If we do not have a valid file identifier, generate a compiler + * warning upon usage of any error codes. (Don't just use a #warning, + * because some files include errno.h but don't ever actually use any + * error codes.) + */ +extern char missing_errfile_declaration[] __attribute__ (( deprecated )); +#undef ERRFILE +#define ERRFILE ( 0 * ( ( int ) missing_errfile_declaration ) ) + +/** Derive PXENV_STATUS code from gPXE error number */ +#define PXENV_STATUS( rc ) ( (-(rc)) & 0x00ff ) + +/** + * @defgroup pxeerrors PXE error codes + * + * The names, meanings and values of these error codes are defined by + * the PXE specification. + * + * @{ + */ + +/* Generic errors */ +#define PXENV_STATUS_SUCCESS 0x0000 +#define PXENV_STATUS_FAILURE 0x0001 +#define PXENV_STATUS_BAD_FUNC 0x0002 +#define PXENV_STATUS_UNSUPPORTED 0x0003 +#define PXENV_STATUS_KEEP_UNDI 0x0004 +#define PXENV_STATUS_KEEP_ALL 0x0005 +#define PXENV_STATUS_OUT_OF_RESOURCES 0x0006 + +/* ARP errors (0x0010 to 0x001f) */ +#define PXENV_STATUS_ARP_TIMEOUT 0x0011 + +/* Base-Code state errors */ +#define PXENV_STATUS_UDP_CLOSED 0x0018 +#define PXENV_STATUS_UDP_OPEN 0x0019 +#define PXENV_STATUS_TFTP_CLOSED 0x001a +#define PXENV_STATUS_TFTP_OPEN 0x001b + +/* BIOS/system errors (0x0020 to 0x002f) */ +#define PXENV_STATUS_MCOPY_PROBLEM 0x0020 +#define PXENV_STATUS_BIS_INTEGRITY_FAILURE 0x0021 +#define PXENV_STATUS_BIS_VALIDATE_FAILURE 0x0022 +#define PXENV_STATUS_BIS_INIT_FAILURE 0x0023 +#define PXENV_STATUS_BIS_SHUTDOWN_FAILURE 0x0024 +#define PXENV_STATUS_BIS_GBOA_FAILURE 0x0025 +#define PXENV_STATUS_BIS_FREE_FAILURE 0x0026 +#define PXENV_STATUS_BIS_GSI_FAILURE 0x0027 +#define PXENV_STATUS_BIS_BAD_CKSUM 0x0028 + +/* TFTP/MTFTP errors (0x0030 to 0x003f) */ +#define PXENV_STATUS_TFTP_CANNOT_ARP_ADDRESS 0x0030 +#define PXENV_STATUS_TFTP_OPEN_TIMEOUT 0x0032 +#define PXENV_STATUS_TFTP_UNKNOWN_OPCODE 0x0033 +#define PXENV_STATUS_TFTP_READ_TIMEOUT 0x0035 +#define PXENV_STATUS_TFTP_ERROR_OPCODE 0x0036 +#define PXENV_STATUS_TFTP_CANNOT_OPEN_CONNECTION 0x0038 +#define PXENV_STATUS_TFTP_CANNOT_READ_FROM_CONNECTION 0x0039 +#define PXENV_STATUS_TFTP_TOO_MANY_PACKAGES 0x003a +#define PXENV_STATUS_TFTP_FILE_NOT_FOUND 0x003b +#define PXENV_STATUS_TFTP_ACCESS_VIOLATION 0x003c +#define PXENV_STATUS_TFTP_NO_MCAST_ADDRESS 0x003d +#define PXENV_STATUS_TFTP_NO_FILESIZE 0x003e +#define PXENV_STATUS_TFTP_INVALID_PACKET_SIZE 0x003f + +/* Reserved errors 0x0040 to 0x004f) */ + +/* DHCP/BOOTP errors (0x0050 to 0x005f) */ +#define PXENV_STATUS_DHCP_TIMEOUT 0x0051 +#define PXENV_STATUS_DHCP_NO_IP_ADDRESS 0x0052 +#define PXENV_STATUS_DHCP_NO_BOOTFILE_NAME 0x0053 +#define PXENV_STATUS_DHCP_BAD_IP_ADDRESS 0x0054 + +/* Driver errors (0x0060 to 0x006f) */ +#define PXENV_STATUS_UNDI_INVALID_FUNCTION 0x0060 +#define PXENV_STATUS_UNDI_MEDIATEST_FAILED 0x0061 +#define PXENV_STATUS_UNDI_CANNOT_INIT_NIC_FOR_MCAST 0x0062 +#define PXENV_STATUS_UNDI_CANNOT_INITIALIZE_NIC 0x0063 +#define PXENV_STATUS_UNDI_CANNOT_INITIALIZE_PHY 0x0064 +#define PXENV_STATUS_UNDI_CANNOT_READ_CONFIG_DATA 0x0065 +#define PXENV_STATUS_UNDI_CANNOT_READ_INIT_DATA 0x0066 +#define PXENV_STATUS_UNDI_BAD_MAC_ADDRESS 0x0067 +#define PXENV_STATUS_UNDI_BAD_EEPROM_CHECKSUM 0x0068 +#define PXENV_STATUS_UNDI_ERROR_SETTING_ISR 0x0069 +#define PXENV_STATUS_UNDI_INVALID_STATE 0x006a +#define PXENV_STATUS_UNDI_TRANSMIT_ERROR 0x006b +#define PXENV_STATUS_UNDI_INVALID_PARAMETER 0x006c + +/* ROM and NBP bootstrap errors (0x0070 to 0x007f) */ +#define PXENV_STATUS_BSTRAP_PROMPT_MENU 0x0074 +#define PXENV_STATUS_BSTRAP_MCAST_ADDR 0x0076 +#define PXENV_STATUS_BSTRAP_MISSING_LIST 0x0077 +#define PXENV_STATUS_BSTRAP_NO_RESPONSE 0x0078 +#define PXENV_STATUS_BSTRAP_FILE_TOO_BIG 0x0079 + +/* Environment NBP errors (0x0080 to 0x008f) */ + +/* Reserved errors (0x0090 to 0x009f) */ + +/* Miscellaneous errors (0x00a0 to 0x00af) */ +#define PXENV_STATUS_BINL_CANCELED_BY_KEYSTROKE 0x00a0 +#define PXENV_STATUS_BINL_NO_PXE_SERVER 0x00a1 +#define PXENV_STATUS_NOT_AVAILABLE_IN_PMODE 0x00a2 +#define PXENV_STATUS_NOT_AVAILABLE_IN_RMODE 0x00a3 + +/* BUSD errors (0x00b0 to 0x00bf) */ +#define PXENV_STATUS_BUSD_DEVICE_NOT_SUPPORTED 0x00b0 + +/* Loader errors (0x00c0 to 0x00cf) */ +#define PXENV_STATUS_LOADER_NO_FREE_BASE_MEMORY 0x00c0 +#define PXENV_STATUS_LOADER_NO_BC_ROMID 0x00c1 +#define PXENV_STATUS_LOADER_BAD_BC_ROMID 0x00c2 +#define PXENV_STATUS_LOADER_BAD_BC_RUNTIME_IMAGE 0x00c3 +#define PXENV_STATUS_LOADER_NO_UNDI_ROMID 0x00c4 +#define PXENV_STATUS_LOADER_BAD_UNDI_ROMID 0x00c5 +#define PXENV_STATUS_LOADER_BAD_UNDI_DRIVER_IMAGE 0x00c6 +#define PXENV_STATUS_LOADER_NO_PXE_STRUCT 0x00c8 +#define PXENV_STATUS_LOADER_NO_PXENV_STRUCT 0x00c9 +#define PXENV_STATUS_LOADER_UNDI_START 0x00ca +#define PXENV_STATUS_LOADER_BC_START 0x00cb + +/** @} */ + +/** + * @defgroup posixerrors POSIX error codes + * + * The names and meanings (but not the values) of these error codes + * are defined by POSIX. We choose to assign unique values which + * incorporate the closest equivalent PXE error code, so that code may + * simply use ENOMEM, rather than having to use the cumbersome + * (ENOMEM|PXENV_STATUS_OUT_OF_RESOURCES). + * + * @{ + */ + +/** Operation completed successfully */ +#define ENOERR ( ERRFILE | PXENV_STATUS_SUCCESS | 0x00000000 ) + +/** Arg list too long */ +#define E2BIG ( ERRFILE | PXENV_STATUS_BAD_FUNC | 0x01000000 ) + +/** Permission denied */ +#define EACCES ( ERRFILE | PXENV_STATUS_TFTP_ACCESS_VIOLATION | 0x02000000 ) + +/** Address in use */ +#define EADDRINUSE ( ERRFILE | PXENV_STATUS_UDP_OPEN | 0x03000000 ) + +/** Address not available */ +#define EADDRNOTAVAIL ( ERRFILE | PXENV_STATUS_UDP_OPEN | 0x04000000 ) + +/** Address family not supported */ +#define EAFNOSUPPORT ( ERRFILE | PXENV_STATUS_UNSUPPORTED | 0x05000000 ) + +/** Resource temporarily unavailable */ +#define EAGAIN ( ERRFILE | PXENV_STATUS_FAILURE | 0x06000000 ) + +/** Connection already in progress */ +#define EALREADY ( ERRFILE | PXENV_STATUS_UDP_OPEN | 0x07000000 ) + +/** Bad file descriptor */ +#define EBADF ( ERRFILE | PXENV_STATUS_TFTP_CLOSED | 0x08000000 ) + +/** Bad message */ +#define EBADMSG ( ERRFILE | PXENV_STATUS_FAILURE | 0x09000000 ) + +/** Resource busy */ +#define EBUSY ( ERRFILE | PXENV_STATUS_OUT_OF_RESOURCES | 0x0a000000 ) + +/** Operation canceled */ +#define ECANCELED \ + ( ERRFILE | PXENV_STATUS_BINL_CANCELED_BY_KEYSTROKE | 0x0b000000 ) + +/** No child processes */ +#define ECHILD ( ERRFILE | PXENV_STATUS_TFTP_FILE_NOT_FOUND | 0x0c000000 ) + +/** Connection aborted */ +#define ECONNABORTED \ + ( ERRFILE | PXENV_STATUS_TFTP_CANNOT_READ_FROM_CONNECTION | 0x0d000000 ) + +/** Connection refused */ +#define ECONNREFUSED \ + ( ERRFILE | PXENV_STATUS_TFTP_CANNOT_OPEN_CONNECTION | 0x0e000000 ) + +/** Connection reset */ +#define ECONNRESET \ + ( ERRFILE | PXENV_STATUS_TFTP_CANNOT_READ_FROM_CONNECTION | 0x0f000000 ) + +/** Resource deadlock avoided */ +#define EDEADLK ( ERRFILE | PXENV_STATUS_FAILURE | 0x10000000 ) + +/** Destination address required */ +#define EDESTADDRREQ ( ERRFILE | PXENV_STATUS_BAD_FUNC | 0x11000000 ) + +/** Domain error */ +#define EDOM ( ERRFILE | PXENV_STATUS_FAILURE | 0x12000000 ) + +/** Reserved */ +#define EDQUOT ( ERRFILE | PXENV_STATUS_FAILURE | 0x13000000 ) + +/** File exists */ +#define EEXIST ( ERRFILE | PXENV_STATUS_FAILURE | 0x14000000 ) + +/** Bad address */ +#define EFAULT ( ERRFILE | PXENV_STATUS_MCOPY_PROBLEM | 0x15000000 ) + +/** File too large */ +#define EFBIG ( ERRFILE | PXENV_STATUS_MCOPY_PROBLEM | 0x16000000 ) + +/** Host is unreachable */ +#define EHOSTUNREACH ( ERRFILE | PXENV_STATUS_ARP_TIMEOUT | 0x17000000 ) + +/** Identifier removed */ +#define EIDRM ( ERRFILE | PXENV_STATUS_FAILURE | 0x18000000 ) + +/** Illegal byte sequence */ +#define EILSEQ ( ERRFILE | PXENV_STATUS_FAILURE | 0x19000000 ) + +/** Operation in progress */ +#define EINPROGRESS ( ERRFILE | PXENV_STATUS_FAILURE | 0x1a000000 ) + +/** Interrupted function call */ +#define EINTR ( ERRFILE | PXENV_STATUS_FAILURE | 0x1b000000 ) + +/** Invalid argument */ +#define EINVAL ( ERRFILE | PXENV_STATUS_BAD_FUNC | 0x1c000000 ) + +/** Input/output error */ +#define EIO \ + ( ERRFILE | PXENV_STATUS_TFTP_CANNOT_READ_FROM_CONNECTION | 0x1d000000 ) + +/** Socket is connected */ +#define EISCONN ( ERRFILE | PXENV_STATUS_UDP_OPEN | 0x1e000000 ) + +/** Is a directory */ +#define EISDIR ( ERRFILE | PXENV_STATUS_FAILURE | 0x1f000000 ) + +/** Too many levels of symbolic links */ +#define ELOOP ( ERRFILE | PXENV_STATUS_FAILURE | 0x20000000 ) + +/** Too many open files */ +#define EMFILE ( ERRFILE | PXENV_STATUS_OUT_OF_RESOURCES | 0x21000000 ) + +/** Too many links */ +#define EMLINK ( ERRFILE | PXENV_STATUS_FAILURE | 0x22000000 ) + +/** Inappropriate message buffer length */ +#define EMSGSIZE ( ERRFILE | PXENV_STATUS_BAD_FUNC | 0x23000000 ) + +/** Reserved */ +#define EMULTIHOP ( ERRFILE | PXENV_STATUS_FAILURE | 0x24000000 ) + +/** Filename too long */ +#define ENAMETOOLONG ( ERRFILE | PXENV_STATUS_FAILURE | 0x25000000 ) + +/** Network is down */ +#define ENETDOWN ( ERRFILE | PXENV_STATUS_ARP_TIMEOUT | 0x26000000 ) + +/** Connection aborted by network */ +#define ENETRESET ( ERRFILE | PXENV_STATUS_FAILURE | 0x27000000 ) + +/** Network unreachable */ +#define ENETUNREACH ( ERRFILE | PXENV_STATUS_ARP_TIMEOUT | 0x28000000 ) + +/** Too many open files in system */ +#define ENFILE ( ERRFILE | PXENV_STATUS_OUT_OF_RESOURCES | 0x29000000 ) + +/** No buffer space available */ +#define ENOBUFS ( ERRFILE | PXENV_STATUS_OUT_OF_RESOURCES | 0x2a000000 ) + +/** No message is available on the STREAM head read queue */ +#define ENODATA ( ERRFILE | PXENV_STATUS_FAILURE | 0x2b000000 ) + +/** No such device */ +#define ENODEV ( ERRFILE | PXENV_STATUS_TFTP_FILE_NOT_FOUND | 0x2c000000 ) + +/** No such file or directory */ +#define ENOENT ( ERRFILE | PXENV_STATUS_TFTP_FILE_NOT_FOUND | 0x2d000000 ) + +/** Exec format error */ +#define ENOEXEC ( ERRFILE | PXENV_STATUS_FAILURE | 0x2e000000 ) + +/** No locks available */ +#define ENOLCK ( ERRFILE | PXENV_STATUS_FAILURE | 0x2f000000 ) + +/** Reserved */ +#define ENOLINK ( ERRFILE | PXENV_STATUS_FAILURE | 0x30000000 ) + +/** Not enough space */ +#define ENOMEM ( ERRFILE | PXENV_STATUS_OUT_OF_RESOURCES | 0x31000000 ) + +/** No message of the desired type */ +#define ENOMSG ( ERRFILE | PXENV_STATUS_FAILURE | 0x32000000 ) + +/** Protocol not available */ +#define ENOPROTOOPT ( ERRFILE | PXENV_STATUS_UNSUPPORTED | 0x33000000 ) + +/** No space left on device */ +#define ENOSPC ( ERRFILE | PXENV_STATUS_OUT_OF_RESOURCES | 0x34000000 ) + +/** No STREAM resources */ +#define ENOSR ( ERRFILE | PXENV_STATUS_OUT_OF_RESOURCES | 0x35000000 ) + +/** Not a STREAM */ +#define ENOSTR ( ERRFILE | PXENV_STATUS_FAILURE | 0x36000000 ) + +/** Function not implemented */ +#define ENOSYS ( ERRFILE | PXENV_STATUS_UNSUPPORTED | 0x37000000 ) + +/** The socket is not connected */ +#define ENOTCONN ( ERRFILE | PXENV_STATUS_FAILURE | 0x38000000 ) + +/** Not a directory */ +#define ENOTDIR ( ERRFILE | PXENV_STATUS_FAILURE | 0x39000000 ) + +/** Directory not empty */ +#define ENOTEMPTY ( ERRFILE | PXENV_STATUS_FAILURE | 0x3a000000 ) + +/** Not a socket */ +#define ENOTSOCK ( ERRFILE | PXENV_STATUS_FAILURE | 0x3b000000 ) + +/** Not supported */ +#define ENOTSUP ( ERRFILE | PXENV_STATUS_UNSUPPORTED | 0x3c000000 ) + +/** Inappropriate I/O control operation */ +#define ENOTTY ( ERRFILE | PXENV_STATUS_FAILURE | 0x3d000000 ) + +/** No such device or address */ +#define ENXIO ( ERRFILE | PXENV_STATUS_TFTP_FILE_NOT_FOUND | 0x3e000000 ) + +/** Operation not supported on socket */ +#define EOPNOTSUPP ( ERRFILE | PXENV_STATUS_UNSUPPORTED | 0x3f000000 ) + +/** Value too large to be stored in data type */ +#define EOVERFLOW ( ERRFILE | PXENV_STATUS_FAILURE | 0x40000000 ) + +/** Operation not permitted */ +#define EPERM ( ERRFILE | PXENV_STATUS_TFTP_ACCESS_VIOLATION | 0x41000000 ) + +/** Broken pipe */ +#define EPIPE ( ERRFILE | PXENV_STATUS_FAILURE | 0x42000000 ) + +/** Protocol error */ +#define EPROTO ( ERRFILE | PXENV_STATUS_FAILURE | 0x43000000 ) + +/** Protocol not supported */ +#define EPROTONOSUPPORT ( ERRFILE | PXENV_STATUS_UNSUPPORTED | 0x44000000 ) + +/** Protocol wrong type for socket */ +#define EPROTOTYPE ( ERRFILE | PXENV_STATUS_FAILURE | 0x45000000 ) + +/** Result too large */ +#define ERANGE ( ERRFILE | PXENV_STATUS_FAILURE | 0x46000000 ) + +/** Read-only file system */ +#define EROFS ( ERRFILE | PXENV_STATUS_FAILURE | 0x47000000 ) + +/** Invalid seek */ +#define ESPIPE ( ERRFILE | PXENV_STATUS_FAILURE | 0x48000000 ) + +/** No such process */ +#define ESRCH ( ERRFILE | PXENV_STATUS_TFTP_FILE_NOT_FOUND | 0x49000000 ) + +/** Stale file handle */ +#define ESTALE ( ERRFILE | PXENV_STATUS_FAILURE | 0x4a000000 ) + +/** STREAM ioctl() timeout */ +#define ETIME ( ERRFILE | PXENV_STATUS_FAILURE | 0x4b000000 ) + +/** Operation timed out */ +#define ETIMEDOUT ( ERRFILE | PXENV_STATUS_TFTP_READ_TIMEOUT | 0x4c000000 ) + +/** Text file busy */ +#define ETXTBSY ( ERRFILE | PXENV_STATUS_FAILURE | 0x4d000000 ) + +/** Operation would block (different from EAGAIN!) */ +#define EWOULDBLOCK ( ERRFILE | PXENV_STATUS_TFTP_OPEN | 0x4e000000 ) + +/** Improper link */ +#define EXDEV ( ERRFILE | PXENV_STATUS_FAILURE | 0x4f000000 ) + +/** @} */ + +/** + * @defgroup euniq Per-file error disambiguators + * + * Files which use the same error number multiple times should + * probably define their own error subspace using these + * disambiguators. For example: + * + * #define ETCP_HEADER_TOO_SHORT EUNIQ_01 + * #define ETCP_BAD_CHECKSUM EUNIQ_02 + * + * @{ + */ + +#define EUNIQ_01 0x00000100 +#define EUNIQ_02 0x00000200 +#define EUNIQ_03 0x00000300 +#define EUNIQ_04 0x00000400 +#define EUNIQ_05 0x00000500 +#define EUNIQ_06 0x00000600 +#define EUNIQ_07 0x00000700 +#define EUNIQ_08 0x00000800 +#define EUNIQ_09 0x00000900 +#define EUNIQ_0A 0x00000a00 +#define EUNIQ_0B 0x00000b00 +#define EUNIQ_0C 0x00000c00 +#define EUNIQ_0D 0x00000d00 +#define EUNIQ_0E 0x00000e00 +#define EUNIQ_0F 0x00000f00 +#define EUNIQ_10 0x00001000 +#define EUNIQ_11 0x00001100 +#define EUNIQ_12 0x00001200 +#define EUNIQ_13 0x00001300 +#define EUNIQ_14 0x00001400 +#define EUNIQ_15 0x00001500 +#define EUNIQ_16 0x00001600 +#define EUNIQ_17 0x00001700 +#define EUNIQ_18 0x00001800 +#define EUNIQ_19 0x00001900 +#define EUNIQ_1A 0x00001a00 +#define EUNIQ_1B 0x00001b00 +#define EUNIQ_1C 0x00001c00 +#define EUNIQ_1D 0x00001d00 +#define EUNIQ_1E 0x00001e00 +#define EUNIQ_1F 0x00001f00 + +/** @} */ + +extern int errno; + +#endif /* ERRNO_H */ diff --git a/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/device.h b/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/device.h new file mode 100644 index 0000000..441a7e1 --- /dev/null +++ b/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/device.h @@ -0,0 +1 @@ +#include <gpxe/pci.h> diff --git a/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/efi/efi_uaccess.h b/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/efi/efi_uaccess.h new file mode 100644 index 0000000..b1a5272 --- /dev/null +++ b/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/efi/efi_uaccess.h @@ -0,0 +1 @@ +#include <gpxe/wrap.h> diff --git a/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/features.h b/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/features.h new file mode 100644 index 0000000..f17ade3 --- /dev/null +++ b/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/features.h @@ -0,0 +1,68 @@ +#ifndef _GPXE_FEATURES_H +#define _GPXE_FEATURES_H + +#include <stdint.h> +#include <gpxe/tables.h> +#include <gpxe/dhcp.h> + +/** @file + * + * Feature list + * + */ + +FILE_LICENCE ( GPL2_OR_LATER ); + +/** + * @defgroup featurecat Feature categories + * @{ + */ + +#define FEATURE_PROTOCOL 01 /**< Network protocols */ +#define FEATURE_IMAGE 02 /**< Image formats */ +#define FEATURE_MISC 03 /**< Miscellaneous */ + +/** @} */ + +/** + * @defgroup dhcpfeatures DHCP feature option tags + * + * DHCP feature option tags are Etherboot encapsulated options in the + * range 0x10-0x7f. + * + * @{ + */ + +#define DHCP_EB_FEATURE_PXE_EXT 0x10 /**< PXE API extensions */ +#define DHCP_EB_FEATURE_ISCSI 0x11 /**< iSCSI protocol */ +#define DHCP_EB_FEATURE_AOE 0x12 /**< AoE protocol */ +#define DHCP_EB_FEATURE_HTTP 0x13 /**< HTTP protocol */ +#define DHCP_EB_FEATURE_HTTPS 0x14 /**< HTTPS protocol */ +#define DHCP_EB_FEATURE_TFTP 0x15 /**< TFTP protocol */ +#define DHCP_EB_FEATURE_FTP 0x16 /**< FTP protocol */ +#define DHCP_EB_FEATURE_DNS 0x17 /**< DNS protocol */ +#define DHCP_EB_FEATURE_BZIMAGE 0x18 /**< bzImage format */ +#define DHCP_EB_FEATURE_MULTIBOOT 0x19 /**< Multiboot format */ +#define DHCP_EB_FEATURE_SLAM 0x1a /**< SLAM protocol */ +#define DHCP_EB_FEATURE_SRP 0x1b /**< SRP protocol */ +#define DHCP_EB_FEATURE_NBI 0x20 /**< NBI format */ +#define DHCP_EB_FEATURE_PXE 0x21 /**< PXE format */ +#define DHCP_EB_FEATURE_ELF 0x22 /**< ELF format */ +#define DHCP_EB_FEATURE_COMBOOT 0x23 /**< COMBOOT format */ +#define DHCP_EB_FEATURE_EFI 0x24 /**< EFI format */ + +/** @} */ + + +/** Construct a DHCP feature table entry */ +#define DHCP_FEATURE( feature_opt, ... ) +/** Construct a named feature */ +#define FEATURE_NAME( category, text ) + +/** Declare a feature */ +#define FEATURE( category, text, feature_opt, version ) + +/** Declare the version number feature */ +#define FEATURE_VERSION( ... ) + +#endif /* _GPXE_FEATURES_H */ diff --git a/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/io.h b/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/io.h new file mode 100644 index 0000000..441a7e1 --- /dev/null +++ b/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/io.h @@ -0,0 +1 @@ +#include <gpxe/pci.h> diff --git a/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/list.h b/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/list.h new file mode 100644 index 0000000..a4bcdb7 --- /dev/null +++ b/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/list.h @@ -0,0 +1,118 @@ +/* + * Copyright © 2009 Vladimir 'phcoder' Serbinenko <phcoder@gmail.com> + * 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 ); + +#ifndef _GPXE_LIST_H +#define _GPXE_LIST_H 1 + +#include <grub/types.h> +#include <gpxe/wrap.h> + +struct list_head +{ + struct list_head *next; + struct list_head *prev; +}; + +#define LIST_HEAD struct list_head + +#define INIT_LIST_HEAD(x) ((x)->next = NULL) +#define LIST_HEAD_INIT(x) { .next = NULL, .prev = NULL } +#define list_empty(x) ((x)->next == NULL) + +#define offsetof(type, elem) ((grub_uint8_t *) (&((type *) NULL)->elem) - (grub_uint8_t *) NULL) +#define container_of(var, type, elem) ((type *) ((grub_uint8_t *)(var) - offsetof (type, elem))) + +#define list_get_next(it, lst_el, hold) \ + container_of ((it)->lst_el.next, typeof (*hold), lst_el) + +#define list_for_each_entry(it, lst, lst_el) \ + for ((it) = container_of((lst)->next, typeof (*(it)), lst_el); \ + &(it)->lst_el != NULL && &(it)->lst_el != (void *) lst; \ + (it) = list_get_next(it, lst_el, it)) + +#define list_for_each_entry_safe(it, next_h, lst, lst_el) \ + for ((it) = container_of((lst)->next, typeof (*(it)), lst_el); \ + &(it)->lst_el != NULL && &(it)->lst_el != (void *) lst; \ + ((it) = container_of ((next_h), typeof (*(next_h)), lst_el)), \ + (next_h) = list_get_next(it, lst_el, next_h)) + + +static inline void +list_del (struct list_head *head) +{ + if (head->next == head->prev) + { + head->next->prev = NULL; + head->prev->next = NULL; + } + else + { + head->prev->next = head->next; + head->next->prev = head->prev; + } +} + +static inline void +list_add_tail (struct list_head *head, struct list_head *new) +{ + if (list_empty (head)) + { + head->next = head->prev = new; + new->next = new->prev = head; + } + else + { + head->prev->next = new; + new->prev = head->prev; + new->next = head; + head->prev = new; + } +} + +static inline void +list_add (struct list_head *head, struct list_head *new) +{ + if (list_empty (head)) + { + head->next = head->prev = new; + new->next = new->prev = head; + } + else + { + head->next->prev = new; + new->next = head->next; + new->prev = head; + head->next = new; + } +} + +#endif diff --git a/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/nap.h b/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/nap.h new file mode 100644 index 0000000..a4bd90b --- /dev/null +++ b/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/nap.h @@ -0,0 +1,44 @@ +/* + * Copyright © 2009 Vladimir 'phcoder' Serbinenko <phcoder@gmail.com> + * 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 ); + +#ifndef _GPXE_NAP_H +#define _GPXE_NAP_H + +#include <grub/time.h> + +static inline void +cpu_nap ( void ) +{ + grub_cpu_idle (); +} + +#endif diff --git a/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/pci.h b/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/pci.h new file mode 100644 index 0000000..964cf43 --- /dev/null +++ b/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/pci.h @@ -0,0 +1,296 @@ +/* + * Copyright © 2009 Vladimir 'phcoder' Serbinenko <phcoder@gmail.com> + * 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 ); + +#ifndef _GPXE_PCI_H +#define _GPXE_PCI_H + +#include <grub/pci.h> +#include <gpxe/wrap.h> +#include <gpxe/timer.h> + +static inline grub_uint8_t +inb (grub_uint16_t port) +{ + return grub_inb (GRUB_MACHINE_PCI_IO_BASE + port); +} + +static inline void +outb (grub_uint8_t data, grub_uint16_t port) +{ + return grub_outb (data, GRUB_MACHINE_PCI_IO_BASE + port); +} + +static inline void +outw (grub_uint16_t data, grub_uint16_t port) +{ + return grub_outw (data, GRUB_MACHINE_PCI_IO_BASE + port); +} + +static inline grub_uint16_t +inw (grub_uint16_t port) +{ + return grub_inw (GRUB_MACHINE_PCI_IO_BASE + port); +} + +static inline void +insw (grub_uint16_t port, grub_uint16_t *data, int count) +{ + while (count--) + *data++ = grub_inw (GRUB_MACHINE_PCI_IO_BASE + port); +} + +static inline void +outsw (grub_uint16_t port, grub_uint16_t *data, int count) +{ + while (count--) + grub_outw (*data++, GRUB_MACHINE_PCI_IO_BASE + port); +} + +static inline void +outsb (grub_uint16_t port, grub_uint8_t *data, int count) +{ + while (count--) + grub_outb (*data++, GRUB_MACHINE_PCI_IO_BASE + port); +} + +static inline void +insb (grub_uint16_t port, grub_uint8_t *data, int count) +{ + while (count--) + *data++ = grub_inb (GRUB_MACHINE_PCI_IO_BASE + port); +} + +static inline void +outl (grub_uint32_t data, grub_uint16_t port) +{ + return grub_outw (data, GRUB_MACHINE_PCI_IO_BASE + port); +} + +static inline grub_uint16_t +inl (grub_uint32_t port) +{ + return grub_inw (GRUB_MACHINE_PCI_IO_BASE + port); +} + +struct device_description +{ + enum {BUS_TYPE_PCI, BUS_TYPE_ISA} bus_type; + int bus; + int location; + grub_uint16_t vendor; + grub_uint16_t device; +}; + +struct device +{ + struct device_description desc; + char *name; + union + { + grub_pci_device_t pci_dev; + }; +}; + +struct pci_device +{ + struct device dev; + + grub_uint16_t ioaddr; + grub_uint16_t vendor; + grub_uint16_t device; + + int irq; + + void *priv; + + void *drvdata; +}; + +struct pci_device_id +{ + grub_pci_id_t devid; +}; + +#define PCI_ROM(vendor, model, short_name, long_name, num) {.devid = ((vendor) | ((model) << 16))} +#define __pci_driver + +struct nic; + +struct pci_driver +{ + struct pci_device_id *ids; + grub_size_t id_count; + int (*probe) (struct pci_device *pci, const struct pci_device_id *id); + void (*remove) (struct pci_device *pci); + void (*irq) (struct nic *nic, int action); +}; + +static inline void +pci_read_config_byte (struct pci_device *dev, grub_uint32_t reg, + grub_uint8_t *val) +{ + grub_pci_address_t addr; + addr = grub_pci_make_address (dev->dev.pci_dev, reg); + *val = grub_pci_read_byte (addr); +} + +static inline void +pci_read_config_word (struct pci_device *dev, grub_uint32_t reg, + grub_uint16_t *val) +{ + grub_pci_address_t addr; + addr = grub_pci_make_address (dev->dev.pci_dev, reg); + *val = grub_pci_read_word (addr); +} + +static inline void +pci_read_config_dword (struct pci_device *dev, grub_uint32_t reg, + grub_uint32_t *val) +{ + grub_pci_address_t addr; + addr = grub_pci_make_address (dev->dev.pci_dev, reg); + *val = grub_pci_read (addr); +} + +static inline void +pci_write_config_byte (struct pci_device *dev, grub_uint32_t reg, + grub_uint8_t val) +{ + grub_pci_address_t addr; + addr = grub_pci_make_address (dev->dev.pci_dev, reg); + grub_pci_write_byte (addr, val); +} + +static inline void +pci_write_config_word (struct pci_device *dev, grub_uint32_t reg, + grub_uint16_t val) +{ + grub_pci_address_t addr; + addr = grub_pci_make_address (dev->dev.pci_dev, reg); + grub_pci_write_word (addr, val); +} + +static inline void +pci_write_config_dword (struct pci_device *dev, grub_uint32_t reg, + grub_uint32_t val) +{ + grub_pci_address_t addr; + addr = grub_pci_make_address (dev->dev.pci_dev, reg); + grub_pci_write (addr, val); +} + +static inline void * +pci_get_drvdata (struct pci_device *dev) +{ + return dev->drvdata; +} + +static inline void +pci_set_drvdata (struct pci_device *dev, void *data) +{ + dev->drvdata = data; +} + +static inline grub_uint32_t +readl (volatile void *ptr) +{ + return *(volatile grub_uint32_t *) ptr; +} + +static inline void +writel (grub_uint32_t data, volatile void *ptr) +{ + *(volatile grub_uint32_t *) ptr = data; +} + +static inline grub_addr_t +pci_bar_start (struct pci_device *dev, grub_uint32_t reg) +{ + grub_pci_address_t addr; + grub_uint64_t space; + + addr = grub_pci_make_address (dev->dev.pci_dev, reg >> 2); + space = grub_pci_read (addr); + + if ((space & GRUB_PCI_ADDR_SPACE_MASK) == GRUB_PCI_ADDR_SPACE_IO) + return space & GRUB_PCI_ADDR_IO_MASK; + + if ((space & GRUB_PCI_ADDR_MEM_TYPE_MASK) == GRUB_PCI_ADDR_MEM_TYPE_64) + { + addr = grub_pci_make_address (dev->dev.pci_dev, (reg >> 2) + 1); + space |= ((grub_uint64_t) grub_pci_read (addr)) << 32; + } + + return space & GRUB_PCI_ADDR_MEM_MASK; +} + +/* XXX: make it use grub_pci_device_map_range. */ +static inline void * +bus_to_virt (grub_uint32_t bus) +{ + return (void *) bus; +} + +static inline void * +ioremap (grub_uint32_t bus, grub_size_t size __attribute__ ((unused))) +{ + return (void *) bus; +} + +static inline grub_uint32_t +virt_to_bus (void *virt) +{ + return (grub_addr_t) virt; +} + +void +grub_gpxe_register_pci_nic (struct pci_driver *nic); + +void +grub_gpxe_unregister_pci_nic (struct pci_driver *nic); + +void adjust_pci_device ( struct pci_device *pci ); + +#define PCI_VENDOR_ID_DAVICOM 0x0291 +#define PCI_VENDOR_ID_WINBOND2 0x1050 +#define PCI_VENDOR_ID_COMPEX 0x11f6 +#define PCI_COMMAND GRUB_PCI_REG_COMMAND +#define PCI_REVISION_ID GRUB_PCI_REG_REVISION +#define PCI_REVISION PCI_REVISION_ID +#define PCI_LATENCY_TIMER GRUB_PCI_REG_LAT_TIMER +#define PCI_BASE_ADDRESS_0 GRUB_PCI_REG_ADDRESS_REG0 +#define PCI_BASE_ADDRESS_1 GRUB_PCI_REG_ADDRESS_REG1 +#define PCI_COMMAND_IO 0x1 +#define PCI_COMMAND_MEM 0x2 +#define PCI_COMMAND_MASTER 0x4 + +#endif diff --git a/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/timer.h b/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/timer.h new file mode 100644 index 0000000..22484c7 --- /dev/null +++ b/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/timer.h @@ -0,0 +1,66 @@ +/* + * Copyright © 2009 Vladimir 'phcoder' Serbinenko <phcoder@gmail.com> + * 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 ); + +#ifndef _GPXE_TIMER_H +#define _GPXE_TIMER_H + +#include <grub/time.h> + +static inline void +udelay ( unsigned long usecs ) +{ + grub_millisleep ((usecs + 999) / 1000); +} + +static inline void +mdelay (unsigned delay) +{ + grub_millisleep (delay); +} + +static inline void +sleep (unsigned delay) +{ + grub_millisleep (1000 * delay); +} + + +static inline unsigned long +currticks ( void ) +{ + return grub_get_time_ms (); +} + +#define TICKS_PER_SEC (1000) +#define ticks_per_sec() TICKS_PER_SEC + +#endif /* _GPXE_TIMER_H */ diff --git a/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/vsprintf.h b/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/vsprintf.h new file mode 100644 index 0000000..b1a5272 --- /dev/null +++ b/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/vsprintf.h @@ -0,0 +1 @@ +#include <gpxe/wrap.h> diff --git a/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/wrap.h b/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/wrap.h new file mode 100644 index 0000000..61b7570 --- /dev/null +++ b/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/wrap.h @@ -0,0 +1,261 @@ +/* + * Copyright © 2009 Vladimir 'phcoder' Serbinenko <phcoder@gmail.com> + * 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 ); + +#ifndef _GPXE_WRAP_H +#define _GPXE_WRAP_H + +#include <config.h> + +#include <grub/misc.h> +#include <grub/dl.h> +#include <errno.h> +#include <grub/mm.h> +#include <gpxe/list.h> +#include <gpxe/timer.h> + +void * +memchr (void *s, grub_uint8_t c, grub_size_t size); + +#define be64_to_cpu grub_be_to_cpu64 +#define cpu_to_be64 grub_cpu_to_be64 +#define cpu_to_be32 grub_cpu_to_be32 +#define cpu_to_be16 grub_cpu_to_be16 +#define le16_to_cpu grub_le_to_cpu16 +#define be16_to_cpu grub_be_to_cpu16 +#define be32_to_cpu grub_be_to_cpu32 +#define cpu_to_le16 grub_cpu_to_le16 +#define cpu_to_le32 grub_cpu_to_le32 +#define le32_to_cpu grub_le_to_cpu32 + +/* In gPXE codebase following has to be a macro. + So grub_cpu_to_be isn't usable. */ +#define bswap_16(x) ((((x) & 0xff) << 8) | (((x) & 0xff00) >> 8)) +#define swap16 bswap_16 +#ifdef GRUB_CPU_WORDS_BIGENDIAN +#define htons(x) (x) +#define htonl(x) (x) +#else +#define htons(x) (bswap_16(x)) +#define htonl(x) ((((x) & 0xff) << 24) | (((x) & 0xff00) << 8) | (((x) & 0xff0000) >> 8) | (((x) & 0xff000000) >> 24)) +#endif + +#define ntohl(x) htonl(x) +#define ntohs(x) htons(x) + +typedef grub_uint64_t u64; +typedef grub_uint64_t uint64_t; +typedef grub_uint32_t u32; +typedef grub_int32_t s32; +typedef grub_uint32_t uint32_t; +typedef grub_int32_t int32_t; +typedef grub_uint16_t u16; +typedef grub_int16_t s16; +typedef grub_uint16_t uint16_t; +typedef grub_int16_t int16_t; +typedef grub_uint8_t u8; +typedef grub_uint8_t uint8_t; +typedef grub_int8_t int8_t; +typedef grub_size_t size_t; + +#define __malloc +#define __shared +#define __unused __attribute__ ((unused)) + +#define off_t grub_off_t + +#define strcpy grub_strcpy + +#if 0 +typedef void *userptr_t; + +static inline void memcpy_user ( userptr_t dest, off_t dest_off, + userptr_t src, off_t src_off, size_t len ) +{ + grub_memcpy ((void *) (dest + dest_off), (void *) (src + src_off), len); +} +#endif + +#define memcpy grub_memcpy + +#define zalloc grub_zalloc +#define strdup grub_strdup +#define strncmp grub_strncmp +#define strchr grub_strchr +#define strcasecmp grub_strcasecmp +#define printf grub_printf +#define intptr_t grub_addr_t + +static inline void * +malloc (grub_size_t size) +{ + return grub_malloc (size); +} + +static inline void * +realloc (void *ptr, grub_size_t size) +{ + return grub_realloc (ptr, size); +} + +static inline grub_size_t +strlen (const char *s) +{ + return grub_strlen (s); +} + +static inline int +strcmp (const char *s1, const char *s2) +{ + return grub_strcmp (s1, s2); +} + +static inline int +toupper (int c) +{ + return grub_toupper (c); +} + +static inline int +tolower (int c) +{ + return grub_tolower (c); +} + +unsigned long strtoul ( const char *p, char **endp, int base ); + +static inline int +isspace (int c) +{ + return grub_isspace (c); +} + +static inline int +isdigit (int c) +{ + return grub_isdigit (c); +} + +static inline int +isalpha (int c) +{ + return grub_isalpha (c); +} + +static inline int +islower (int c) +{ + return (c >= 'a' && c <= 'z'); +} + +static inline int +isupper (int c) +{ + return (c >= 'A' && c <= 'Z'); +} + +typedef grub_ssize_t ssize_t; + +static inline void +free (void *ptr) +{ + grub_free (ptr); +} + +#define assert(x) assert_real(__FILE__, __LINE__, x) + +static inline void +assert_real (const char *file, int line, int cond) +{ + if (!cond) + grub_fatal ("Assertion failed at %s:%d\n", file, line); +} + +#define __assert_fail grub_abort + +#define __always_inline + +#define VERSION_MAJOR 1 +#define VERSION_MINOR 97 +#define VERSION_PATCH 1 + +#define strstr grub_strstr +#define alloc_memblock(size,align) grub_memalign(align,size) + +#define DBG(fmt,args...) grub_dprintf("net", fmt, ## args) +#define DBG2(fmt,args...) grub_dprintf("net", fmt, ## args) +#define DBG_HD(data,len) +#define DBGP(fmt,args...) grub_dprintf("net", fmt, ## args) +#define DBGP_HD(data,len) +#define DBGC(ptr, fmt,args...) grub_dprintf("net", fmt, ## args) +#define DBGCP(ptr, fmt,args...) grub_dprintf("net", fmt, ## args) +#define DBGC2(ptr, fmt,args...) grub_dprintf("net", fmt, ## args) +#define DBGC_HD(ptr,data,len) +#define DBGCP_HD(ptr,data,len) +#define DBGC_HDA(ptr,s,data,len) +#define DBGC2_HDA(ptr,s,data,len) +#define DBGCP_HDA(ptr,s,data,len) + +#define strrchr grub_strrchr + +static inline void +memswap (void *b1, void *b2, grub_size_t size) +{ + register grub_uint8_t t; + while (size--) + { + t = *(grub_uint8_t *) b1; + *(grub_uint8_t *) b1 = *(grub_uint8_t *) b2; + *(grub_uint8_t *) b2 = t; + b1 = (grub_uint8_t *) b1 + 1; + b2 = (grub_uint8_t *) b2 + 1; + } +} + +static inline int +flsl (long n) +{ + int i; + for (i = sizeof (n) - 1; i >= 0; i--) + if (n & (1 << i)) + return i + 1; + return 0; +} + +#define INT_MAX 2147483647L + +#define putchar(x) grub_printf("%c", x) + +#define snprintf grub_snprintf +#define ssnprintf grub_snprintf +#define vsnprintf grub_vsnprintf + +#endif diff --git a/debian/grub-extras/disabled/gpxe/include_wrap/libgen.h b/debian/grub-extras/disabled/gpxe/include_wrap/libgen.h new file mode 100644 index 0000000..b1a5272 --- /dev/null +++ b/debian/grub-extras/disabled/gpxe/include_wrap/libgen.h @@ -0,0 +1 @@ +#include <gpxe/wrap.h> diff --git a/debian/grub-extras/disabled/gpxe/include_wrap/limits.h b/debian/grub-extras/disabled/gpxe/include_wrap/limits.h new file mode 100644 index 0000000..b1a5272 --- /dev/null +++ b/debian/grub-extras/disabled/gpxe/include_wrap/limits.h @@ -0,0 +1 @@ +#include <gpxe/wrap.h> diff --git a/debian/grub-extras/disabled/gpxe/include_wrap/stddef.h b/debian/grub-extras/disabled/gpxe/include_wrap/stddef.h new file mode 100644 index 0000000..b1a5272 --- /dev/null +++ b/debian/grub-extras/disabled/gpxe/include_wrap/stddef.h @@ -0,0 +1 @@ +#include <gpxe/wrap.h> diff --git a/debian/grub-extras/disabled/gpxe/include_wrap/stdint.h b/debian/grub-extras/disabled/gpxe/include_wrap/stdint.h new file mode 100644 index 0000000..b1a5272 --- /dev/null +++ b/debian/grub-extras/disabled/gpxe/include_wrap/stdint.h @@ -0,0 +1 @@ +#include <gpxe/wrap.h> diff --git a/debian/grub-extras/disabled/gpxe/include_wrap/stdio.h b/debian/grub-extras/disabled/gpxe/include_wrap/stdio.h new file mode 100644 index 0000000..b1a5272 --- /dev/null +++ b/debian/grub-extras/disabled/gpxe/include_wrap/stdio.h @@ -0,0 +1 @@ +#include <gpxe/wrap.h> diff --git a/debian/grub-extras/disabled/gpxe/include_wrap/stdlib.h b/debian/grub-extras/disabled/gpxe/include_wrap/stdlib.h new file mode 100644 index 0000000..b1a5272 --- /dev/null +++ b/debian/grub-extras/disabled/gpxe/include_wrap/stdlib.h @@ -0,0 +1 @@ +#include <gpxe/wrap.h> diff --git a/debian/grub-extras/disabled/gpxe/include_wrap/string.h b/debian/grub-extras/disabled/gpxe/include_wrap/string.h new file mode 100644 index 0000000..b1a5272 --- /dev/null +++ b/debian/grub-extras/disabled/gpxe/include_wrap/string.h @@ -0,0 +1 @@ +#include <gpxe/wrap.h> diff --git a/debian/grub-extras/disabled/gpxe/include_wrap/strings.h b/debian/grub-extras/disabled/gpxe/include_wrap/strings.h new file mode 100644 index 0000000..b1a5272 --- /dev/null +++ b/debian/grub-extras/disabled/gpxe/include_wrap/strings.h @@ -0,0 +1 @@ +#include <gpxe/wrap.h> diff --git a/debian/grub-extras/disabled/gpxe/include_wrap/unistd.h b/debian/grub-extras/disabled/gpxe/include_wrap/unistd.h new file mode 100644 index 0000000..b1a5272 --- /dev/null +++ b/debian/grub-extras/disabled/gpxe/include_wrap/unistd.h @@ -0,0 +1 @@ +#include <gpxe/wrap.h> |