diff options
| author | H. Peter Anvin <hpa@zytor.com> | 2008-06-13 16:20:05 -0700 |
|---|---|---|
| committer | H. Peter Anvin <hpa@zytor.com> | 2008-06-13 16:20:05 -0700 |
| commit | 958ddda00522f768bf9adc86c0d5b446e0a672cf (patch) | |
| tree | d03715b7cbd8580f90ebb231fcc987137776b3f7 /gpxe/src/include | |
| parent | 0095d560ef91676d3a07db560f58ca83d85bff95 (diff) | |
| download | syslinux-958ddda00522f768bf9adc86c0d5b446e0a672cf.tar.gz | |
gpxe: update gpxe to latest git
Diffstat (limited to 'gpxe/src/include')
| -rw-r--r-- | gpxe/src/include/gpxe/aoe.h | 1 | ||||
| -rw-r--r-- | gpxe/src/include/gpxe/async.h | 228 | ||||
| -rw-r--r-- | gpxe/src/include/gpxe/errfile.h | 1 | ||||
| -rw-r--r-- | gpxe/src/include/gpxe/features.h | 2 | ||||
| -rw-r--r-- | gpxe/src/include/gpxe/in.h | 9 | ||||
| -rw-r--r-- | gpxe/src/include/gpxe/retry.h | 14 |
6 files changed, 25 insertions, 230 deletions
diff --git a/gpxe/src/include/gpxe/aoe.h b/gpxe/src/include/gpxe/aoe.h index 85683384..4aab4291 100644 --- a/gpxe/src/include/gpxe/aoe.h +++ b/gpxe/src/include/gpxe/aoe.h @@ -11,7 +11,6 @@ #include <gpxe/list.h> #include <gpxe/if_ether.h> #include <gpxe/retry.h> -#include <gpxe/async.h> #include <gpxe/ata.h> /** An AoE ATA command */ diff --git a/gpxe/src/include/gpxe/async.h b/gpxe/src/include/gpxe/async.h deleted file mode 100644 index 2d1d31a4..00000000 --- a/gpxe/src/include/gpxe/async.h +++ /dev/null @@ -1,228 +0,0 @@ -#ifndef _GPXE_ASYNC_H -#define _GPXE_ASYNC_H - -/** @file - * - * Asynchronous operations - * - */ - -#include <gpxe/list.h> - -struct async; - -/** An asynchronous operation ID - * - * Only positive identifiers are valid; negative values are used to - * indicate errors. - */ -typedef long aid_t; - -/** Signals that can be delivered to asynchronous operations */ -enum signal { - /** A child asynchronous operation has completed - * - * The parent should call async_wait() to reap the completed - * child. async_wait() will return the exit status and - * operation identifier of the child. - * - * The handler for this signal can be set to @c NULL; if it - * is, then the children will accumulate as zombies until - * async_wait() is called. - * - * The handler for this signal can also be set to @c SIG_IGN; - * if it is, then the children will automatically be reaped. - * Note that if you use @c SIG_IGN then you will not be able - * to retrieve the return status of the children; the call to - * async_wait() will simply return -ECHILD. - */ - SIGCHLD = 0, - /** Cancel asynchronous operation - * - * This signal should trigger the asynchronous operation to - * cancel itself (including killing all its own children, if - * any), and then call async_done(). The asynchronous - * operation is allowed to not complete immediately. - * - * The handler for this signal can be set to @c NULL; if it - * is, then attempts to cancel the asynchronous operation will - * fail and the operation will complete normally. Anything - * waiting for the operation to cancel will block. - */ - SIGKILL, - /** Update progress of asynchronous operation - * - * This signal should cause the asynchronous operation to - * immediately update the @c completed and @c total fields. - * - * The handler for this signal can be set to @c NULL; if it - * is, then the asynchronous operation is expected to keep its - * @c completed and @c total fields up to date at all times. - */ - SIGUPDATE, - SIGMAX -}; - -/** - * A signal handler - * - * @v async Asynchronous operation - * @v signal Signal received - */ -typedef void ( * signal_handler_t ) ( struct async *async, - enum signal signal ); - -/** Asynchronous operation operations */ -struct async_operations { - /** Reap asynchronous operation - * - * @v async Asynchronous operation - * - * Release all resources associated with the asynchronous - * operation. This will be called only after the asynchronous - * operation itself calls async_done(), so the only remaining - * resources will probably be the memory used by the struct - * async itself. - * - * This method can be set to @c NULL; if it is, then no - * resources will be freed. This may be suitable for - * asynchronous operations that consume no dynamically - * allocated memory. - */ - void ( * reap ) ( struct async *async ); - /** Handle signals */ - signal_handler_t signal[SIGMAX]; -}; - -/** An asynchronous operation */ -struct async { - /** Other asynchronous operations with the same parent */ - struct list_head siblings; - /** Child asynchronous operations */ - struct list_head children; - /** Parent asynchronous operation - * - * This field is optional; if left to NULL then the owner must - * never call async_done(). - */ - struct async *parent; - /** Asynchronous operation ID */ - aid_t aid; - /** Final return status code */ - int rc; - - /** Amount of operation completed so far - * - * The units for this quantity are arbitrary. @c completed - * divded by @total should give something which approximately - * represents the progress through the operation. For a - * download operation, using byte counts would make sense. - * - * This progress indicator should also incorporate the status - * of any child asynchronous operations. - */ - unsigned long completed; - /** Total operation size - * - * See @c completed. A zero value means "total size unknown" - * and is explcitly permitted; users should take this into - * account before calculating @c completed/total. - */ - unsigned long total; - - struct async_operations *aop; -}; - -extern struct async_operations default_async_operations; -extern struct async_operations orphan_async_operations; - -extern aid_t async_init ( struct async *async, struct async_operations *aop, - struct async *parent ); -extern void async_uninit ( struct async *async ); -extern void async_ignore_signal ( struct async *async, enum signal signal ); -extern void async_signal ( struct async *async, enum signal signal ); -extern void async_signal_children ( struct async *async, enum signal signal ); -extern void async_done ( struct async *async, int rc ); -extern aid_t async_wait ( struct async *async, int *rc, int block ); - -/** Default signal handler */ -#define SIG_DFL NULL - -/** Ignore signal */ -#define SIG_IGN async_ignore_signal - -/** - * Initialise orphan asynchronous operation - * - * @v async Asynchronous operation - * @ret aid Asynchronous operation ID - * - * An orphan asynchronous operation can act as a context for child - * operations. However, you must not call async_done() on such an - * operation, since this would attempt to send a signal to its - * (non-existent) parent. Instead, simply free the structure (after - * calling async_wait() to ensure that any child operations have - * completed). - */ -static inline aid_t async_init_orphan ( struct async *async ) { - return async_init ( async, &orphan_async_operations, NULL ); -} - -/** - * Execute and block on an asynchronous operation - * - * @v async_temp Temporary asynchronous operation structure to use - * @v START Code used to start the asynchronous operation - * @ret rc Return status code - * - * This is a notational shorthand for writing - * - * async_init_orphan ( &async_temp ); - * if ( ( rc = START ) == 0 ) - * async_wait ( &async_temp ); - * if ( rc != 0 ) { - * ...handle failure... - * } - * - * and allows you instead to write - * - * if ( ( rc = async_block ( &async_temp, START ) ) != 0 ) { - * ...handle failure... - * } - * - * The argument START is a code snippet; it should initiate an - * asynchronous operation as a child of @c async_temp and return an - * error status code if it failed to do so (e.g. due to malloc() - * failure). - */ -#define async_block( async_temp, START ) ( { \ - int rc; \ - \ - async_init_orphan ( async_temp ); \ - if ( ( rc = START ) == 0 ) \ - async_wait ( async_temp, &rc, 1 ); \ - rc; \ - } ) - -/** - * Execute and block on an asynchronous operation, with progress indicator - * - * @v async_temp Temporary asynchronous operation structure to use - * @v START Code used to start the asynchronous operation - * @ret rc Return status code - * - * As for async_block(), the argument START is a code snippet; it - * should initiate an asynchronous operation as a child of @c - * async_temp and return an error status code if it failed to do so - * (e.g. due to malloc() failure). - */ -#define async_block_progress( async_temp, START ) ( { \ - int rc; \ - \ - async_init_orphan ( async_temp ); \ - if ( ( rc = START ) == 0 ) \ - async_wait_progress ( async_temp, &rc );\ - rc; \ - } ) - -#endif /* _GPXE_ASYNC_H */ diff --git a/gpxe/src/include/gpxe/errfile.h b/gpxe/src/include/gpxe/errfile.h index 42952d7d..a0591952 100644 --- a/gpxe/src/include/gpxe/errfile.h +++ b/gpxe/src/include/gpxe/errfile.h @@ -132,6 +132,7 @@ #define ERRFILE_infiniband ( ERRFILE_NET | 0x00130000 ) #define ERRFILE_netdev_settings ( ERRFILE_NET | 0x00140000 ) #define ERRFILE_dhcppkt ( ERRFILE_NET | 0x00150000 ) +#define ERRFILE_slam ( ERRFILE_NET | 0x00160000 ) #define ERRFILE_image ( ERRFILE_IMAGE | 0x00000000 ) #define ERRFILE_elf ( ERRFILE_IMAGE | 0x00010000 ) diff --git a/gpxe/src/include/gpxe/features.h b/gpxe/src/include/gpxe/features.h index a520131f..70daac37 100644 --- a/gpxe/src/include/gpxe/features.h +++ b/gpxe/src/include/gpxe/features.h @@ -41,8 +41,10 @@ #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_NBI 0x20 /**< NBI format */ #define DHCP_EB_FEATURE_PXE 0x21 /**< PXE format */ +#define DHCP_EB_FEATURE_ELF 0x22 /**< ELF format */ /** @} */ diff --git a/gpxe/src/include/gpxe/in.h b/gpxe/src/include/gpxe/in.h index 89530a55..40e4d407 100644 --- a/gpxe/src/include/gpxe/in.h +++ b/gpxe/src/include/gpxe/in.h @@ -62,6 +62,15 @@ struct sockaddr_in { uint16_t sin_port; /** IPv4 address */ struct in_addr sin_addr; + /** Padding + * + * This ensures that a struct @c sockaddr_tcpip is large + * enough to hold a socket address for any TCP/IP address + * family. + */ + char pad[ sizeof ( struct sockaddr ) - sizeof ( sa_family_t ) + - sizeof ( uint16_t ) + - sizeof ( struct in_addr ) ]; }; /** diff --git a/gpxe/src/include/gpxe/retry.h b/gpxe/src/include/gpxe/retry.h index e71e7b3b..71982fca 100644 --- a/gpxe/src/include/gpxe/retry.h +++ b/gpxe/src/include/gpxe/retry.h @@ -35,10 +35,22 @@ struct retry_timer { }; extern void start_timer ( struct retry_timer *timer ); -extern void start_timer_nodelay ( struct retry_timer *timer ); +extern void start_timer_fixed ( struct retry_timer *timer, + unsigned long timeout ); extern void stop_timer ( struct retry_timer *timer ); /** + * Start timer with no delay + * + * @v timer Retry timer + * + * This starts the timer running with a zero timeout value. + */ +static inline void start_timer_nodelay ( struct retry_timer *timer ) { + start_timer_fixed ( timer, 0 ); +} + +/** * Test to see if timer is currently running * * @v timer Retry timer |
