Skip to content

Commit

Permalink
We may be required to page-align modules, so let's make sure we catch
Browse files Browse the repository at this point in the history
it if we don't.
  • Loading branch information
Michael Brown committed Jan 12, 2007
1 parent 7bf94b5 commit e4c6418
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/arch/i386/image/multiboot.c
Expand Up @@ -24,6 +24,7 @@
*/

#include <errno.h>
#include <assert.h>
#include <alloca.h>
#include <multiboot.h>
#include <gpxe/uaccess.h>
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit e4c6418

Please sign in to comment.