ppc64_elf_freebsd.c (279799) | ppc64_elf_freebsd.c (291598) |
---|---|
1/*- 2 * Copyright (c) 2001 Benno Rice <benno@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001 Benno Rice <benno@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/boot/ofw/libofw/ppc64_elf_freebsd.c 279799 2015-03-09 02:57:34Z nwhitehorn $"); | 28__FBSDID("$FreeBSD: head/sys/boot/ofw/libofw/ppc64_elf_freebsd.c 291598 2015-12-01 17:01:27Z nwhitehorn $"); |
29 30#define __ELF_WORD_SIZE 64 31 32#include <sys/param.h> 33#include <sys/linker.h> 34 35#include <machine/metadata.h> 36#include <machine/elf.h> --- 35 unchanged lines hidden (view full) --- 72 int error; 73 intptr_t entry; 74 75 if ((fmp = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) { 76 return(EFTYPE); 77 } 78 e = (Elf_Ehdr *)&fmp->md_data; 79 | 29 30#define __ELF_WORD_SIZE 64 31 32#include <sys/param.h> 33#include <sys/linker.h> 34 35#include <machine/metadata.h> 36#include <machine/elf.h> --- 35 unchanged lines hidden (view full) --- 72 int error; 73 intptr_t entry; 74 75 if ((fmp = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) { 76 return(EFTYPE); 77 } 78 e = (Elf_Ehdr *)&fmp->md_data; 79 |
80 /* Handle function descriptor */ 81 entry = *(uint64_t *)e->e_entry; | 80 /* Handle function descriptor for ELFv1 kernels */ 81 if ((e->e_flags & 3) == 2) 82 entry = e->e_entry; 83 else 84 entry = *(uint64_t *)e->e_entry; |
82 83 if ((error = md_load64(fp->f_args, &mdp, &dtbp)) != 0) 84 return (error); 85 86 printf("Kernel entry at 0x%lx ...\n", entry); 87 88 dev_cleanup(); 89 ofw_release_heap(); --- 18 unchanged lines hidden --- | 85 86 if ((error = md_load64(fp->f_args, &mdp, &dtbp)) != 0) 87 return (error); 88 89 printf("Kernel entry at 0x%lx ...\n", entry); 90 91 dev_cleanup(); 92 ofw_release_heap(); --- 18 unchanged lines hidden --- |