summaryrefslogtreecommitdiffstats
path: root/src/arch
diff options
context:
space:
mode:
authorMichael Brown2007-01-12 01:09:16 +0100
committerMichael Brown2007-01-12 01:09:16 +0100
commite4c6418ac086ff1cbad48c5f08b5fa693400d080 (patch)
tree51f1e98144276f1aac979746e5e0605d91c0fc12 /src/arch
parentAllow for named images. (diff)
downloadipxe-e4c6418ac086ff1cbad48c5f08b5fa693400d080.tar.gz
ipxe-e4c6418ac086ff1cbad48c5f08b5fa693400d080.tar.xz
ipxe-e4c6418ac086ff1cbad48c5f08b5fa693400d080.zip
We may be required to page-align modules, so let's make sure we catch
it if we don't.
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/i386/image/multiboot.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/arch/i386/image/multiboot.c b/src/arch/i386/image/multiboot.c
index 2370a304a..b9fb16396 100644
--- a/src/arch/i386/image/multiboot.c
+++ b/src/arch/i386/image/multiboot.c
@@ -24,6 +24,7 @@
*/
#include <errno.h>
+#include <assert.h>
#include <alloca.h>
#include <multiboot.h>
#include <gpxe/uaccess.h>
@@ -106,10 +107,12 @@ multiboot_build_module_list ( struct image *image,
unsigned int count = 0;
for_each_image ( module_image ) {
- /* Do not include kernel image as a module */
+
+ /* Do not include kernel image itself as a module */
if ( module_image == image )
continue;
module = &modules[count++];
+
/* Populate module data structure, if applicable */
if ( ! modules )
continue;
@@ -118,6 +121,9 @@ multiboot_build_module_list ( struct image *image,
module_image->len );
if ( image->cmdline )
module->string = virt_to_phys ( image->cmdline );
+
+ /* We promise to page-align modules, so at least check */
+ assert ( ( module->mod_start & 0xfff ) == 0 );
}
return count;