Deleted Added
full compact
ppc64_elf_freebsd.c (217044) 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/powerpc/ps3/ppc64_elf_freebsd.c 217044 2011-01-06 04:12:29Z nwhitehorn $");
28__FBSDID("$FreeBSD: head/sys/boot/powerpc/ps3/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>

--- 33 unchanged lines hidden (view full) ---

70 int error;
71 int (*entry)(u_long, u_long, u_long, void *, u_long);
72
73 if ((fmp = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) {
74 return(EFTYPE);
75 }
76 e = (Elf_Ehdr *)&fmp->md_data;
77
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>

--- 33 unchanged lines hidden (view full) ---

70 int error;
71 int (*entry)(u_long, u_long, u_long, void *, u_long);
72
73 if ((fmp = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) {
74 return(EFTYPE);
75 }
76 e = (Elf_Ehdr *)&fmp->md_data;
77
78 /* Handle function descriptor */
79 entry = (void *)(uintptr_t)(*(uint64_t *)e->e_entry);
78 /* Handle function descriptor for ELFv1 kernels */
79 if ((e->e_flags & 3) == 2)
80 entry = e->e_entry;
81 else
82 entry = (void *)(uintptr_t)(*(uint64_t *)e->e_entry);
80
81 if ((error = md_load64(fp->f_args, &mdp)) != 0)
82 return (error);
83
84 printf("Kernel entry at %p ...\n", entry);
85
86 dev_cleanup();
87
88 entry(0 /* FDT */, 0 /* Phys. mem offset */, 0 /* OF entry */,
89 (void *)mdp, sizeof(mdp));
90
91 panic("exec returned");
92}
93
94struct file_format ppc_elf64 =
95{
96 ppc64_elf_loadfile,
97 ppc64_elf_exec
98};
83
84 if ((error = md_load64(fp->f_args, &mdp)) != 0)
85 return (error);
86
87 printf("Kernel entry at %p ...\n", entry);
88
89 dev_cleanup();
90
91 entry(0 /* FDT */, 0 /* Phys. mem offset */, 0 /* OF entry */,
92 (void *)mdp, sizeof(mdp));
93
94 panic("exec returned");
95}
96
97struct file_format ppc_elf64 =
98{
99 ppc64_elf_loadfile,
100 ppc64_elf_exec
101};