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

« back to all changes in this revision

Viewing changes to loader/i386/xnu.c

ImportĀ upstreamĀ versionĀ 1.97~beta3

Show diffs side-by-side

added added

removed removed

Lines of Context:
247
247
  curval->datasize = (SYSTEM_TABLE_SIZEOF (firmware_revision));
248
248
  curval->data = grub_malloc (curval->datasize);
249
249
  if (! curval->data)
250
 
    return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't create device tree");
 
250
    return grub_errno;
251
251
  grub_memcpy (curval->data, (SYSTEM_TABLE_VAR(firmware_revision)),
252
252
               curval->datasize);
253
253
 
258
258
    2 * (utf16_strlen (SYSTEM_TABLE_PTR (firmware_vendor)) + 1);
259
259
  curval->data = grub_malloc (curval->datasize);
260
260
  if (! curval->data)
261
 
    return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't create device tree");
 
261
    return grub_errno;
262
262
  grub_memcpy (curval->data, SYSTEM_TABLE_PTR (firmware_vendor),
263
263
               curval->datasize);
264
264
 
268
268
  curval->datasize = sizeof ("EFI32");
269
269
  curval->data = grub_malloc (curval->datasize);
270
270
  if (! curval->data)
271
 
    return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't create device tree");
 
271
    return grub_errno;
272
272
  if (SIZEOF_OF_UINTN == 4)
273
273
    grub_memcpy (curval->data, "EFI32", curval->datasize);
274
274
  else
287
287
  curval->datasize = sizeof (grub_uint64_t);
288
288
  curval->data = grub_malloc (curval->datasize);
289
289
  if (!curval->data)
290
 
    return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't create device tree");
 
290
    return grub_errno;
291
291
 
292
292
  /* First see if user supplies the value. */
293
293
  char *fsbvar = grub_env_get ("fsb");
362
362
      curval->datasize = sizeof (guid);
363
363
      curval->data = grub_malloc (curval->datasize);
364
364
      if (! curval->data)
365
 
        return grub_error (GRUB_ERR_OUT_OF_MEMORY,
366
 
                           "couldn't create device tree");
 
365
        return grub_errno;
367
366
      grub_memcpy (curval->data, &guid, curval->datasize);
368
367
 
369
368
      /* The value "table". */
373
372
      curval->datasize = SIZEOF_OF_UINTN;
374
373
      curval->data = grub_malloc (curval->datasize);
375
374
      if (! curval->data)
376
 
        return grub_error (GRUB_ERR_OUT_OF_MEMORY,
377
 
                           "couldn't create device tree");
 
375
        return grub_errno;
378
376
      if (SIZEOF_OF_UINTN == 4)
379
377
        *((grub_uint32_t *)curval->data) = PTR_TO_UINT32 (ptr);
380
378
      else
392
390
          curval->datasize = grub_strlen (table_aliases[j].name) + 1;
393
391
          curval->data = grub_malloc (curval->datasize);
394
392
          if (!curval->data)
395
 
            return grub_error (GRUB_ERR_OUT_OF_MEMORY,
396
 
                               "couldn't create device tree");
 
393
            return grub_errno;
397
394
          grub_memcpy (curval->data, table_aliases[j].name, curval->datasize);
398
395
        }
399
396
    }
409
406
  curval->datasize = SIZEOF_OF_UINTN;
410
407
  curval->data = grub_malloc (curval->datasize);
411
408
  if (! curval->data)
412
 
    return grub_error (GRUB_ERR_OUT_OF_MEMORY,
413
 
                       "couldn't create device tree");
 
409
    return grub_errno;
414
410
  if (SIZEOF_OF_UINTN == 4)
415
411
    *((grub_uint32_t *) curval->data)
416
412
      = PTR_TO_UINT32 (SYSTEM_TABLE_PTR (runtime_services));