elf.c (839c4e9c5bb09ac1ef2c129c7082a15b9cbd3a8a) | elf.c (447ae4f7adb2c667eec1e0861e2346694c57a2e0) |
---|---|
1/* 2 * Copyright (c) 2001 William L. Pitts 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms are freely 6 * permitted provided that the above copyright notice and this 7 * paragraph and the following disclaimer are duplicated in all 8 * such forms. --- 6 unchanged lines hidden (view full) --- 15 16#include <common.h> 17#include <command.h> 18#include <elf.h> 19#include <environment.h> 20#include <net.h> 21#include <vxworks.h> 22#ifdef CONFIG_X86 | 1/* 2 * Copyright (c) 2001 William L. Pitts 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms are freely 6 * permitted provided that the above copyright notice and this 7 * paragraph and the following disclaimer are duplicated in all 8 * such forms. --- 6 unchanged lines hidden (view full) --- 15 16#include <common.h> 17#include <command.h> 18#include <elf.h> 19#include <environment.h> 20#include <net.h> 21#include <vxworks.h> 22#ifdef CONFIG_X86 |
23#include <vbe.h> |
|
23#include <asm/e820.h> 24#include <linux/linkage.h> 25#endif 26 27/* 28 * A very simple ELF64 loader, assumes the image is valid, returns the 29 * entry point address. 30 * --- 218 unchanged lines hidden (view full) --- 249 char *bootline; /* Text of the bootline */ 250 char *tmp; /* Temporary char pointer */ 251 char build_buf[128]; /* Buffer for building the bootline */ 252 int ptr = 0; 253#ifdef CONFIG_X86 254 ulong base; 255 struct e820_info *info; 256 struct e820_entry *data; | 24#include <asm/e820.h> 25#include <linux/linkage.h> 26#endif 27 28/* 29 * A very simple ELF64 loader, assumes the image is valid, returns the 30 * entry point address. 31 * --- 218 unchanged lines hidden (view full) --- 250 char *bootline; /* Text of the bootline */ 251 char *tmp; /* Temporary char pointer */ 252 char build_buf[128]; /* Buffer for building the bootline */ 253 int ptr = 0; 254#ifdef CONFIG_X86 255 ulong base; 256 struct e820_info *info; 257 struct e820_entry *data; |
258 struct efi_gop_info *gop; 259 struct vesa_mode_info *vesa = &mode_info.vesa; |
|
257#endif 258 259 /* 260 * Check the loadaddr variable. 261 * If we don't know where the image is then we're done. 262 */ 263 if (argc < 2) 264 addr = load_addr; --- 127 unchanged lines hidden (view full) --- 392 E820_DATA_OFFSET; 393 394 /* 395 * Explicitly clear the bootloader image size otherwise if memory 396 * at this offset happens to contain some garbage data, the final 397 * available memory size for the kernel is insane. 398 */ 399 *(u32 *)(base + BOOT_IMAGE_SIZE_OFFSET) = 0; | 260#endif 261 262 /* 263 * Check the loadaddr variable. 264 * If we don't know where the image is then we're done. 265 */ 266 if (argc < 2) 267 addr = load_addr; --- 127 unchanged lines hidden (view full) --- 395 E820_DATA_OFFSET; 396 397 /* 398 * Explicitly clear the bootloader image size otherwise if memory 399 * at this offset happens to contain some garbage data, the final 400 * available memory size for the kernel is insane. 401 */ 402 *(u32 *)(base + BOOT_IMAGE_SIZE_OFFSET) = 0; |
403 404 /* 405 * Prepare compatible framebuffer information block. 406 * The VESA mode has to be 32-bit RGBA. 407 */ 408 if (vesa->x_resolution && vesa->y_resolution) { 409 gop = (struct efi_gop_info *)(base + EFI_GOP_INFO_OFFSET); 410 gop->magic = EFI_GOP_INFO_MAGIC; 411 gop->info.version = 0; 412 gop->info.width = vesa->x_resolution; 413 gop->info.height = vesa->y_resolution; 414 gop->info.pixel_format = EFI_GOT_RGBA8; 415 gop->info.pixels_per_scanline = vesa->bytes_per_scanline / 4; 416 gop->fb_base = vesa->phys_base_ptr; 417 gop->fb_size = vesa->bytes_per_scanline * vesa->y_resolution; 418 } |
|
400#endif 401 402 /* 403 * If the data at the load address is an elf image, then 404 * treat it like an elf image. Otherwise, assume that it is a 405 * binary image. 406 */ 407 if (valid_elf_image(addr)) --- 37 unchanged lines hidden --- | 419#endif 420 421 /* 422 * If the data at the load address is an elf image, then 423 * treat it like an elf image. Otherwise, assume that it is a 424 * binary image. 425 */ 426 if (valid_elf_image(addr)) --- 37 unchanged lines hidden --- |