~hamo/ubuntu/precise/grub2/grub2.hi_res

« back to all changes in this revision

Viewing changes to grub-core/loader/powerpc/ieee1275/linux.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2011-01-11 17:11:44 UTC
  • mto: (17.6.24 experimental)
  • mto: This revision was merged to the branch mainline in revision 100.
  • Revision ID: james.westby@ubuntu.com-20110111171144-o2h6luxzei5fivmf
Tags: upstream-1.99~20110111
ImportĀ upstreamĀ versionĀ 1.99~20110111

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#include <grub/command.h>
28
28
#include <grub/i18n.h>
29
29
#include <grub/memory.h>
 
30
#include <grub/lib/cmdline.h>
30
31
 
31
32
#define ELF32_LOADMASK (0xc0000000UL)
32
33
#define ELF64_LOADMASK (0xc000000000000000ULL)
238
239
                int argc, char *argv[])
239
240
{
240
241
  grub_elf_t elf = 0;
241
 
  int i;
242
242
  int size;
243
 
  char *dest;
244
243
 
245
244
  grub_dl_ref (my_mod);
246
245
 
275
274
      goto out;
276
275
    }
277
276
 
278
 
  size = sizeof ("BOOT_IMAGE=") + grub_strlen (argv[0]);
279
 
  for (i = 0; i < argc; i++)
280
 
    size += grub_strlen (argv[i]) + 1;
281
 
 
282
 
  linux_args = grub_malloc (size);
 
277
  size = grub_loader_cmdline_size(argc, argv);
 
278
  linux_args = grub_malloc (size + sizeof (LINUX_IMAGE));
283
279
  if (! linux_args)
284
280
    goto out;
285
281
 
286
 
  /* Specify the boot file.  */
287
 
  dest = grub_stpcpy (linux_args, "BOOT_IMAGE=");
288
 
  dest = grub_stpcpy (dest, argv[0]);
289
 
 
290
 
  for (i = 1; i < argc; i++)
291
 
    {
292
 
      *dest++ = ' ';
293
 
      dest = grub_stpcpy (dest, argv[i]);
294
 
    }
 
282
  /* Create kernel command line.  */
 
283
  grub_memcpy (linux_args, LINUX_IMAGE, sizeof (LINUX_IMAGE));
 
284
  grub_create_loader_cmdline (argc, argv, linux_args + sizeof (LINUX_IMAGE) - 1,
 
285
                              size);
295
286
 
296
287
out:
297
288