Merge branch 'master' into strings

This commit is contained in:
Holger Lubitz
2007-08-02 00:13:40 +02:00
66 changed files with 4028 additions and 735 deletions

60
src/core/abft.c Normal file
View File

@@ -0,0 +1,60 @@
/*
* Copyright (C) 2007 Michael Brown <mbrown@fensystems.co.uk>.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* 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.
*/
#include <realmode.h>
#include <gpxe/aoe.h>
#include <gpxe/netdevice.h>
#include <gpxe/abft.h>
/** @file
*
* AoE Boot Firmware Table
*
*/
#define abftab __use_data16 ( abftab )
/** The aBFT used by gPXE */
struct abft_table __data16 ( abftab ) __attribute__ (( aligned ( 16 ) )) = {
/* ACPI header */
.acpi = {
.signature = ABFT_SIG,
.length = sizeof ( abftab ),
.revision = 1,
.oem_id = "FENSYS",
.oem_table_id = "gPXE",
},
};
/**
* Fill in all variable portions of aBFT
*
* @v aoe AoE session
*/
void abft_fill_data ( struct aoe_session *aoe ) {
/* Fill in boot parameters */
abftab.shelf = aoe->major;
abftab.slot = aoe->minor;
memcpy ( abftab.mac, aoe->netdev->ll_addr, sizeof ( abftab.mac ) );
/* Update checksum */
acpi_fix_checksum ( &abftab.acpi );
DBG ( "AoE boot firmware table:\n" );
DBG_HD ( &abftab, sizeof ( abftab ) );
}

View File

@@ -87,6 +87,9 @@ REQUIRE_OBJECT ( nfs );
#ifdef DOWNLOAD_PROTO_HTTP
REQUIRE_OBJECT ( http );
#endif
#ifdef DOWNLOAD_PROTO_HTTPS
REQUIRE_OBJECT ( https );
#endif
#ifdef DOWNLOAD_PROTO_FTP
REQUIRE_OBJECT ( ftp );
#endif

78
src/core/filter.c Normal file
View File

@@ -0,0 +1,78 @@
/*
* Copyright (C) 2007 Michael Brown <mbrown@fensystems.co.uk>.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* 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.
*/
#include <gpxe/xfer.h>
#include <gpxe/filter.h>
/** @file
*
* Data transfer filters
*
*/
/*
* Pass-through methods to be used by filters which don't want to
* intercept all events.
*
*/
void filter_close ( struct xfer_interface *xfer, int rc ) {
struct xfer_interface *other = filter_other_half ( xfer );
xfer_close ( other, rc );
}
int filter_vredirect ( struct xfer_interface *xfer, int type,
va_list args ) {
struct xfer_interface *other = filter_other_half ( xfer );
return xfer_vredirect ( other, type, args );
}
int filter_seek ( struct xfer_interface *xfer, off_t offset, int whence ) {
struct xfer_interface *other = filter_other_half ( xfer );
return xfer_seek ( other, offset, whence );
}
size_t filter_window ( struct xfer_interface *xfer ) {
struct xfer_interface *other = filter_other_half ( xfer );
return xfer_window ( other );
}
struct io_buffer * filter_alloc_iob ( struct xfer_interface *xfer,
size_t len ) {
struct xfer_interface *other = filter_other_half ( xfer );
return xfer_alloc_iob ( other, len );
}
int filter_deliver_iob ( struct xfer_interface *xfer, struct io_buffer *iobuf,
struct xfer_metadata *meta ) {
struct xfer_interface *other = filter_other_half ( xfer );
return xfer_deliver_iob_meta ( other, iobuf, meta );
}
int filter_deliver_raw ( struct xfer_interface *xfer, const void *data,
size_t len ) {
struct xfer_interface *other = filter_other_half ( xfer );
return xfer_deliver_raw ( other, data, len );
}

View File

@@ -1,20 +0,0 @@
/** @file
*
* gcc implicit functions
*
* gcc sometimes likes to insert implicit calls to memcpy().
* Unfortunately, there doesn't seem to be any way to prevent it from
* doing this, or to force it to use the optimised memcpy() as seen by
* C code; it insists on inserting a symbol reference to "memcpy". We
* therefore include wrapper functions just to keep gcc happy.
*
*/
#include <string.h>
void * gcc_implicit_memcpy ( void *dest, const void *src,
size_t len ) asm ( "memcpy" );
void * gcc_implicit_memcpy ( void *dest, const void *src, size_t len ) {
return memcpy ( dest, src, len );
}

View File

@@ -24,7 +24,7 @@ Literature dealing with the network protocols:
*
* @ret rc Return status code
*/
int main ( void ) {
__cdecl int main ( void ) {
initialise();
startup();