mirror of https://github.com/ipxe/ipxe.git
We may be required to page-align modules, so let's make sure we catch
it if we don't.pull/1/head
parent
7bf94b5ad6
commit
e4c6418ac0
|
@ -24,6 +24,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <assert.h>
|
||||||
#include <alloca.h>
|
#include <alloca.h>
|
||||||
#include <multiboot.h>
|
#include <multiboot.h>
|
||||||
#include <gpxe/uaccess.h>
|
#include <gpxe/uaccess.h>
|
||||||
|
@ -106,10 +107,12 @@ multiboot_build_module_list ( struct image *image,
|
||||||
unsigned int count = 0;
|
unsigned int count = 0;
|
||||||
|
|
||||||
for_each_image ( module_image ) {
|
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 )
|
if ( module_image == image )
|
||||||
continue;
|
continue;
|
||||||
module = &modules[count++];
|
module = &modules[count++];
|
||||||
|
|
||||||
/* Populate module data structure, if applicable */
|
/* Populate module data structure, if applicable */
|
||||||
if ( ! modules )
|
if ( ! modules )
|
||||||
continue;
|
continue;
|
||||||
|
@ -118,6 +121,9 @@ multiboot_build_module_list ( struct image *image,
|
||||||
module_image->len );
|
module_image->len );
|
||||||
if ( image->cmdline )
|
if ( image->cmdline )
|
||||||
module->string = virt_to_phys ( 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;
|
return count;
|
||||||
|
|
Loading…
Reference in New Issue