From owner-p4-projects@FreeBSD.ORG Tue Sep 19 21:25:29 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9FA5C16A492; Tue, 19 Sep 2006 21:25:29 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 68E7916A47C for ; Tue, 19 Sep 2006 21:25:29 +0000 (UTC) (envelope-from ssouhlal@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 382CE43D5E for ; Tue, 19 Sep 2006 21:25:14 +0000 (GMT) (envelope-from ssouhlal@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8JLPEMJ013293 for ; Tue, 19 Sep 2006 21:25:14 GMT (envelope-from ssouhlal@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8JLPDXC013290 for perforce@freebsd.org; Tue, 19 Sep 2006 21:25:13 GMT (envelope-from ssouhlal@freebsd.org) Date: Tue, 19 Sep 2006 21:25:13 GMT Message-Id: <200609192125.k8JLPDXC013290@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to ssouhlal@freebsd.org using -f From: Suleiman Souhlal To: Perforce Change Reviews Cc: Subject: PERFORCE change 106362 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Sep 2006 21:25:29 -0000 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 +#include #include +#include +#include #include -#include +#include #include +#include +#include + +#include +#include +#include + +#include +#include + +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;