003 File Manager
Current Path:
/usr/src/sys/powerpc/powerpc
usr
/
src
/
sys
/
powerpc
/
powerpc
/
📁
..
📄
altivec.c
(4.74 KB)
📄
autoconf.c
(2.69 KB)
📄
bus_machdep.c
(22.3 KB)
📄
busdma_machdep.c
(31.78 KB)
📄
clock.c
(8.72 KB)
📄
copyinout.c
(15.08 KB)
📄
cpu.c
(23.74 KB)
📄
cpu_subr64.S
(2.99 KB)
📄
db_disasm.c
(31.78 KB)
📄
db_hwwatch.c
(1.71 KB)
📄
db_interface.c
(1.78 KB)
📄
db_trace.c
(8.56 KB)
📄
dump_machdep.c
(1.63 KB)
📄
elf32_machdep.c
(11.71 KB)
📄
elf64_machdep.c
(12 KB)
📄
elf_common.c
(4.21 KB)
📄
exec_machdep.c
(29.55 KB)
📄
fpu.c
(6.47 KB)
📄
gdb_machdep.c
(3.5 KB)
📄
genassym.c
(10.78 KB)
📄
in_cksum.c
(6.64 KB)
📄
interrupt.c
(3.9 KB)
📄
intr_machdep.c
(15.53 KB)
📄
iommu_if.m
(1.74 KB)
📄
machdep.c
(21.72 KB)
📄
mem.c
(8.4 KB)
📄
minidump_machdep.c
(9.09 KB)
📄
mp_machdep.c
(8.81 KB)
📄
nexus.c
(7.06 KB)
📄
openpic.c
(11.35 KB)
📄
pic_if.m
(2.45 KB)
📄
platform.c
(9.15 KB)
📄
platform_if.m
(6.15 KB)
📄
pmap_dispatch.c
(8.92 KB)
📄
ptrace_machdep.c
(3.58 KB)
📄
sc_machdep.c
(2.21 KB)
📄
setjmp.S
(2.45 KB)
📄
sigcode32.S
(2.4 KB)
📄
sigcode64.S
(2.94 KB)
📄
stack_machdep.c
(3.1 KB)
📄
support.S
(11.06 KB)
📄
swtch32.S
(7.31 KB)
📄
swtch64.S
(10.59 KB)
📄
syncicache.c
(2.51 KB)
📄
sys_machdep.c
(1.73 KB)
📄
trap.c
(25.06 KB)
📄
uio_machdep.c
(4.04 KB)
📄
uma_machdep.c
(2.89 KB)
📄
vm_machdep.c
(7.5 KB)
Editing: elf_common.c
/*- * SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 2019 Justin Hibbits * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer * in this position and unchanged. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD$ */ static int __elfN(powerpc_copyout_auxargs)(struct image_params *imgp, uintptr_t base) { Elf_Auxargs *args; Elf_Auxinfo *argarray, *pos; int error; /* * XXX If we can't find image's OSREL, assume it uses the new auxv * format. * * This is specially important for rtld, that is not tagged. Using * direct exec mode with new (ELFv2) binaries that expect the new auxv * format would result in crashes otherwise. * * Unfortunately, this may break direct exec'ing old binaries, * but it seems better to correctly support new binaries by default, * considering the transition to ELFv2 happened quite some time * ago. If needed, a sysctl may be added to allow old auxv format to * be used when OSREL is not found. */ if (imgp->proc->p_osrel >= P_OSREL_POWERPC_NEW_AUX_ARGS || imgp->proc->p_osrel == 0) return (__elfN(freebsd_copyout_auxargs)(imgp, base)); args = (Elf_Auxargs *)imgp->auxargs; argarray = pos = malloc(AT_OLD_COUNT * sizeof(*pos), M_TEMP, M_WAITOK | M_ZERO); if (args->execfd != -1) AUXARGS_ENTRY(pos, AT_OLD_EXECFD, args->execfd); AUXARGS_ENTRY(pos, AT_OLD_PHDR, args->phdr); AUXARGS_ENTRY(pos, AT_OLD_PHENT, args->phent); AUXARGS_ENTRY(pos, AT_OLD_PHNUM, args->phnum); AUXARGS_ENTRY(pos, AT_OLD_PAGESZ, args->pagesz); AUXARGS_ENTRY(pos, AT_OLD_FLAGS, args->flags); AUXARGS_ENTRY(pos, AT_OLD_ENTRY, args->entry); AUXARGS_ENTRY(pos, AT_OLD_BASE, args->base); AUXARGS_ENTRY(pos, AT_OLD_EHDRFLAGS, args->hdr_eflags); if (imgp->execpathp != 0) AUXARGS_ENTRY_PTR(pos, AT_OLD_EXECPATH, imgp->execpathp); AUXARGS_ENTRY(pos, AT_OLD_OSRELDATE, imgp->proc->p_ucred->cr_prison->pr_osreldate); if (imgp->canary != 0) { AUXARGS_ENTRY_PTR(pos, AT_OLD_CANARY, imgp->canary); AUXARGS_ENTRY(pos, AT_OLD_CANARYLEN, imgp->canarylen); } AUXARGS_ENTRY(pos, AT_OLD_NCPUS, mp_ncpus); if (imgp->pagesizes != 0) { AUXARGS_ENTRY_PTR(pos, AT_OLD_PAGESIZES, imgp->pagesizes); AUXARGS_ENTRY(pos, AT_OLD_PAGESIZESLEN, imgp->pagesizeslen); } if (imgp->sysent->sv_timekeep_base != 0) { AUXARGS_ENTRY(pos, AT_OLD_TIMEKEEP, imgp->sysent->sv_timekeep_base); } AUXARGS_ENTRY(pos, AT_OLD_STACKPROT, imgp->sysent->sv_shared_page_obj != NULL && imgp->stack_prot != 0 ? imgp->stack_prot : imgp->sysent->sv_stackprot); if (imgp->sysent->sv_hwcap != NULL) AUXARGS_ENTRY(pos, AT_OLD_HWCAP, *imgp->sysent->sv_hwcap); if (imgp->sysent->sv_hwcap2 != NULL) AUXARGS_ENTRY(pos, AT_OLD_HWCAP2, *imgp->sysent->sv_hwcap2); AUXARGS_ENTRY(pos, AT_OLD_NULL, 0); free(imgp->auxargs, M_TEMP); imgp->auxargs = NULL; KASSERT(pos - argarray <= AT_OLD_COUNT, ("Too many auxargs")); error = copyout(argarray, (void *)base, sizeof(*argarray) * AT_OLD_COUNT); free(argarray, M_TEMP); return (error); }
Upload File
Create Folder