summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorHolger Lubitz2007-08-02 00:13:40 +0200
committerHolger Lubitz2007-08-02 00:13:40 +0200
commit58f5565eb04f08c51b4f123930294c3d033e3a8e (patch)
tree6df9ba9712544bad49f991006471f7e6c6511f84 /src/core
parentmake bcopy use memmove (diff)
parentInitrd concatenation now working (diff)
downloadipxe-58f5565eb04f08c51b4f123930294c3d033e3a8e.tar.gz
ipxe-58f5565eb04f08c51b4f123930294c3d033e3a8e.tar.xz
ipxe-58f5565eb04f08c51b4f123930294c3d033e3a8e.zip
Merge branch 'master' into strings
Diffstat (limited to 'src/core')
-rw-r--r--src/core/abft.c60
-rw-r--r--src/core/config.c3
-rw-r--r--src/core/filter.c78
-rw-r--r--src/core/gcc_implicit.c20
-rw-r--r--src/core/main.c2
5 files changed, 142 insertions, 21 deletions
diff --git a/src/core/abft.c b/src/core/abft.c
new file mode 100644
index 000000000..af28bbcfb
--- /dev/null
+++ b/src/core/abft.c
@@ -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 ) );
+}
diff --git a/src/core/config.c b/src/core/config.c
index a2194e8dc..7e70c12a1 100644
--- a/src/core/config.c
+++ b/src/core/config.c
@@ -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
diff --git a/src/core/filter.c b/src/core/filter.c
new file mode 100644
index 000000000..51ec5c4bc
--- /dev/null
+++ b/src/core/filter.c
@@ -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 );
+}
diff --git a/src/core/gcc_implicit.c b/src/core/gcc_implicit.c
deleted file mode 100644
index 8f217b6d3..000000000
--- a/src/core/gcc_implicit.c
+++ /dev/null
@@ -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 );
-}
diff --git a/src/core/main.c b/src/core/main.c
index 09dccc761..88fbb5794 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -24,7 +24,7 @@ Literature dealing with the network protocols:
*
* @ret rc Return status code
*/
-int main ( void ) {
+__cdecl int main ( void ) {
initialise();
startup();