Changeset View
Changeset View
Standalone View
Standalone View
sys/powerpc/powerpc/elf64_machdep.c
Show First 20 Lines • Show All 143 Lines • ▼ Show 20 Lines | struct sysentvec elf64_freebsd_sysvec_v2 = { | ||||
.sv_hwcap = &cpu_features, | .sv_hwcap = &cpu_features, | ||||
.sv_hwcap2 = &cpu_features2, | .sv_hwcap2 = &cpu_features2, | ||||
.sv_onexec_old = exec_onexec_old, | .sv_onexec_old = exec_onexec_old, | ||||
.sv_onexit = exit_onexit, | .sv_onexit = exit_onexit, | ||||
.sv_regset_begin = SET_BEGIN(__elfN(regset)), | .sv_regset_begin = SET_BEGIN(__elfN(regset)), | ||||
.sv_regset_end = SET_LIMIT(__elfN(regset)), | .sv_regset_end = SET_LIMIT(__elfN(regset)), | ||||
}; | }; | ||||
static boolean_t ppc64_elfv1_header_match(struct image_params *params, | static bool ppc64_elfv1_header_match(struct image_params *params, | ||||
int32_t *, uint32_t *); | int32_t *, uint32_t *); | ||||
static boolean_t ppc64_elfv2_header_match(struct image_params *params, | static bool ppc64_elfv2_header_match(struct image_params *params, | ||||
int32_t *, uint32_t *); | int32_t *, uint32_t *); | ||||
static Elf64_Brandinfo freebsd_brand_info_elfv1 = { | static Elf64_Brandinfo freebsd_brand_info_elfv1 = { | ||||
.brand = ELFOSABI_FREEBSD, | .brand = ELFOSABI_FREEBSD, | ||||
.machine = EM_PPC64, | .machine = EM_PPC64, | ||||
.compat_3_brand = "FreeBSD", | .compat_3_brand = "FreeBSD", | ||||
.emul_path = NULL, | .emul_path = NULL, | ||||
.interp_path = "/libexec/ld-elf.so.1", | .interp_path = "/libexec/ld-elf.so.1", | ||||
▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | ppc64_init_sysvecs(void *arg) | ||||
* avoids two copies of the trampoline code being allocated! | * avoids two copies of the trampoline code being allocated! | ||||
*/ | */ | ||||
elf64_freebsd_sysvec_v2.sv_sigcode_offset += | elf64_freebsd_sysvec_v2.sv_sigcode_offset += | ||||
(uintptr_t)sigcode64_elfv2 - (uintptr_t)&sigcode64; | (uintptr_t)sigcode64_elfv2 - (uintptr_t)&sigcode64; | ||||
elf64_freebsd_sysvec_v2.sv_szsigcode = &szsigcode64_elfv2; | elf64_freebsd_sysvec_v2.sv_szsigcode = &szsigcode64_elfv2; | ||||
} | } | ||||
SYSINIT(elf64_sysvec, SI_SUB_EXEC, SI_ORDER_ANY, ppc64_init_sysvecs, NULL); | SYSINIT(elf64_sysvec, SI_SUB_EXEC, SI_ORDER_ANY, ppc64_init_sysvecs, NULL); | ||||
static boolean_t | static bool | ||||
ppc64_elfv1_header_match(struct image_params *params, int32_t *osrel __unused, | ppc64_elfv1_header_match(struct image_params *params, int32_t *osrel __unused, | ||||
uint32_t *fctl0 __unused) | uint32_t *fctl0 __unused) | ||||
{ | { | ||||
const Elf64_Ehdr *hdr = (const Elf64_Ehdr *)params->image_header; | const Elf64_Ehdr *hdr = (const Elf64_Ehdr *)params->image_header; | ||||
int abi = (hdr->e_flags & 3); | int abi = (hdr->e_flags & 3); | ||||
return (abi == 0 || abi == 1); | return (abi == 0 || abi == 1); | ||||
} | } | ||||
static boolean_t | static bool | ||||
ppc64_elfv2_header_match(struct image_params *params, int32_t *osrel __unused, | ppc64_elfv2_header_match(struct image_params *params, int32_t *osrel __unused, | ||||
uint32_t *fctl0 __unused) | uint32_t *fctl0 __unused) | ||||
{ | { | ||||
const Elf64_Ehdr *hdr = (const Elf64_Ehdr *)params->image_header; | const Elf64_Ehdr *hdr = (const Elf64_Ehdr *)params->image_header; | ||||
int abi = (hdr->e_flags & 3); | int abi = (hdr->e_flags & 3); | ||||
return (abi == 2); | return (abi == 2); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 219 Lines • Show Last 20 Lines |