Changeset View
Changeset View
Standalone View
Standalone View
sys/boot/uboot/lib/elf_freebsd.c
Show All 25 Lines | |||||
*/ | */ | ||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/linker.h> | #include <sys/linker.h> | ||||
#ifdef __mips | |||||
andrew: Missing the trailing `__`? | |||||
impUnsubmitted Done Inline ActionsAnd do you need 64-bit flavors? imp: And do you need 64-bit flavors?
| |||||
Sgalabov_gmail.comAuthorUnsubmitted Done Inline ActionsWe don't need anything 64-bit specific here, this compiles (and works) properly for both 32- and 64-bit MIPS under QEMU. Sgalabov_gmail.com: We don't need anything 64-bit specific here, this compiles (and works) properly for both 32… | |||||
Sgalabov_gmail.comAuthorUnsubmitted Done Inline ActionsYes, I meant to use mips instead of __mips, although GCC defines both. I'll fix this. Sgalabov_gmail.com: Yes, I meant to use __mips__ instead of __mips, although GCC defines both. I'll fix this. | |||||
#include <sys/proc.h> | |||||
#include <machine/frame.h> | |||||
#endif | |||||
#include <machine/md_var.h> | #include <machine/md_var.h> | ||||
#include <machine/metadata.h> | #include <machine/metadata.h> | ||||
#include <machine/elf.h> | #include <machine/elf.h> | ||||
#include <inttypes.h> | |||||
#include <stand.h> | #include <stand.h> | ||||
#include "bootstrap.h" | #include "bootstrap.h" | ||||
#include "libuboot.h" | #include "libuboot.h" | ||||
extern vm_offset_t md_load(char *, vm_offset_t *); | extern vm_offset_t md_load(char *, vm_offset_t *); | ||||
int | int | ||||
Show All 30 Lines | if ((fmp = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) | ||||
return (EFTYPE); | return (EFTYPE); | ||||
e = (Elf_Ehdr *)&fmp->md_data; | e = (Elf_Ehdr *)&fmp->md_data; | ||||
if ((error = md_load(fp->f_args, &mdp)) != 0) | if ((error = md_load(fp->f_args, &mdp)) != 0) | ||||
return (error); | return (error); | ||||
entry = (void *)e->e_entry; | entry = (void *)e->e_entry; | ||||
printf("Kernel entry at 0x%x...\n", (unsigned)entry); | printf("Kernel entry at 0x%" PRIxPTR "...\n", (uintptr_t)entry); | ||||
andrewUnsubmitted Done Inline Actionswhy not %p? andrew: why not `%p`? | |||||
dev_cleanup(); | dev_cleanup(); | ||||
printf("Kernel args: %s\n", fp->f_args); | printf("Kernel args: %s\n", fp->f_args); | ||||
(*entry)((void *)mdp); | (*entry)((void *)mdp); | ||||
panic("exec returned"); | panic("exec returned"); | ||||
} | } | ||||
struct file_format uboot_elf = { | struct file_format uboot_elf = { | ||||
__elfN(uboot_load), | __elfN(uboot_load), | ||||
__elfN(uboot_exec) | __elfN(uboot_exec) | ||||
}; | }; |
Missing the trailing __?