Date: Tue, 19 Sep 2006 21:25:13 GMT From: Suleiman Souhlal <ssouhlal@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 106362 for review Message-ID: <200609192125.k8JLPDXC013290@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=106362 Change 106362 by ssouhlal@ssouhlal-maho on 2006/09/19 21:24:24 Add ELF sysvec/brands for mips. Affected files ... .. //depot/projects/mips2/src/sys/mips/include/md_var.h#3 edit .. //depot/projects/mips2/src/sys/mips/mips/elf_machdep.c#3 edit .. //depot/projects/mips2/src/sys/mips/mips/locore.S#14 edit .. //depot/projects/mips2/src/sys/mips/mips/machdep.c#20 edit Differences ... ==== //depot/projects/mips2/src/sys/mips/include/md_var.h#3 (text+ko) ==== @@ -28,6 +28,9 @@ #ifndef _MACHINE_MD_VAR_H_ #define _MACHINE_MD_VAR_H_ +extern char sigcode[]; +extern int szsigcode; + extern vm_offset_t kstack0; extern vm_paddr_t kstack0_phys; ==== //depot/projects/mips2/src/sys/mips/mips/elf_machdep.c#3 (text+ko) ==== @@ -26,10 +26,82 @@ */ #include <sys/param.h> +#include <sys/kernel.h> #include <sys/systm.h> +#include <sys/exec.h> +#include <sys/imgact.h> #include <sys/linker.h> -#include <sys/imgact.h> +#include <sys/sysent.h> #include <sys/imgact_elf.h> +#include <sys/syscall.h> +#include <sys/signalvar.h> + +#include <vm/vm.h> +#include <vm/pmap.h> +#include <vm/vm_param.h> + +#include <machine/elf.h> +#include <machine/md_var.h> + +struct sysentvec elf32_freebsd_sysvec = { + SYS_MAXSYSCALL, + sysent, + 0, + 0, + NULL, + 0, + NULL, + NULL, + __elfN(freebsd_fixup), + sendsig, + sigcode, + &szsigcode, + NULL, + "FreeBSD ELF32", + __elfN(coredump), + NULL, + MINSIGSTKSZ, + PAGE_SIZE, + VM_MIN_ADDRESS, + VM_MAXUSER_ADDRESS, + USRSTACK, + PS_STRINGS, + VM_PROT_ALL, + exec_copyout_strings, + exec_setregs, + NULL +}; + +static Elf32_Brandinfo freebsd_brand_info = { + ELFOSABI_FREEBSD, + EM_MIPS, + "FreeBSD", + NULL, + "/libexec/ld-elf.so.1", + &elf32_freebsd_sysvec, + NULL, + 0, + }; + +SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY, + (sysinit_cfunc_t) elf32_insert_brand_entry, + &freebsd_brand_info); + +static Elf32_Brandinfo freebsd_brand_oinfo = { + ELFOSABI_FREEBSD, + EM_MIPS, + "FreeBSD", + NULL, + "/usr/libexec/ld-elf.so.1", + &elf32_freebsd_sysvec, + NULL, + 0, + }; + +SYSINIT(oelf32, SI_SUB_EXEC, SI_ORDER_ANY, + (sysinit_cfunc_t) elf32_insert_brand_entry, + &freebsd_brand_oinfo); + void elf32_dump_thread(struct thread *td, void *dst, size_t *off) ==== //depot/projects/mips2/src/sys/mips/mips/locore.S#14 (text+ko) ==== @@ -114,3 +114,12 @@ nop /* NOTREACHED */ + +ASM_ENTRY(sigcode) + break + +esigcode: + .data + .global szsigcode +szsigcode: + .long esigcode-sigcode ==== //depot/projects/mips2/src/sys/mips/mips/machdep.c#20 (text+ko) ==== @@ -87,6 +87,12 @@ SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL); void +sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) +{ + __asm __volatile("break"); +} + +void mips_init(void) { int i;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200609192125.k8JLPDXC013290>