~ubuntu-branches/debian/sid/grub2/sid-200907171837

« back to all changes in this revision

Viewing changes to loader/multiboot2.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Millan
  • Date: 2009-07-02 13:23:51 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20090702132351-tanpn0ryyijp93gu
Tags: 1.96+20090702-1
* New SVN snapshot.
* rules: Remove duplicated files in sparc64-ieee1275 port.
* rules: Comment out -DGRUB_ASSUME_LINUX_HAS_FB_SUPPORT=1 setting.  We'll
  re-evaluate using it when it's more mature.  (Closes: #535026).

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
18
18
 */
19
19
 
20
 
#include <multiboot2.h>
21
20
#include <grub/loader.h>
22
21
#include <grub/machine/loader.h>
23
22
#include <grub/multiboot2.h>
 
23
#include <multiboot2.h>
24
24
#include <grub/elfload.h>
25
25
#include <grub/file.h>
26
26
#include <grub/err.h>
27
 
#include <grub/rescue.h>
28
27
#include <grub/dl.h>
29
28
#include <grub/mm.h>
30
29
#include <grub/misc.h>
342
341
    }
343
342
 
344
343
  /* Look for the multiboot header in the buffer.  The header should
345
 
     be at least 12 bytes and aligned on a 4-byte boundary.  */
346
 
  for (p = buffer; p <= buffer + len - 12; p += 4)
 
344
     be at least 8 bytes and aligned on a 8-byte boundary.  */
 
345
  for (p = buffer; p <= buffer + len - 8; p += 8)
347
346
    {
348
347
      header = (struct multiboot_header *) p;
349
348
      if (header->magic == MULTIBOOT2_HEADER_MAGIC)
371
370
    }
372
371
  else
373
372
    {
 
373
      grub_errno = 0;
374
374
      grub_dprintf ("loader", "Loading non-ELF multiboot 2 file.\n");
375
375
 
376
376
      if (header)
434
434
 
435
435
  grub_dprintf ("loader", "Loading module at 0x%x - 0x%x\n", modaddr,
436
436
                modaddr + modsize);
437
 
  if (grub_file_read (file, (char *) modaddr, modsize) != modsize)
 
437
  if (grub_file_read (file, (void *) modaddr, modsize) != modsize)
438
438
    {
439
439
      grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
440
440
      goto out;