Index: Makefile.inc1 =================================================================== --- Makefile.inc1 +++ Makefile.inc1 @@ -336,7 +336,7 @@ .else XFLAGS+= -B${WORLDTMP}/usr/bin .endif -.if ${TARGET} == "arm" && ${MK_ARM_EABI} != "no" +.if ${TARGET} == "arm" .if ${TARGET_ARCH:M*eb*} == "" TARGET_ABI= gnueabi .elif ${TARGET_ARCH} == "armv6hf" Index: gnu/lib/csu/Makefile =================================================================== --- gnu/lib/csu/Makefile +++ gnu/lib/csu/Makefile @@ -24,7 +24,7 @@ CRTS_CFLAGS= -DCRTSTUFFS_O -DSHARED ${PICFLAG} MKDEP= -DCRT_BEGIN -.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +.if ${TARGET_CPUARCH} == "arm" CFLAGS+= -DTARGET_ARM_EABI .endif Index: gnu/lib/libgcc/Makefile =================================================================== --- gnu/lib/libgcc/Makefile +++ gnu/lib/libgcc/Makefile @@ -15,7 +15,7 @@ .include "${.CURDIR}/../../usr.bin/cc/Makefile.tgt" -.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +.if ${TARGET_CPUARCH} == "arm" CFLAGS+= -DTARGET_ARM_EABI .endif @@ -56,7 +56,7 @@ .endfor # Likewise double-word routines. -.if ${TARGET_CPUARCH} != "arm" || ${MK_ARM_EABI} == "no" +.if ${TARGET_CPUARCH} != "arm" # These are implemented in an ARM specific file but will not be filtered out .for mode in sf df xf tf LIB2FUNCS+= _fix${mode}di _fixuns${mode}di @@ -117,14 +117,10 @@ LIB1ASMSRC = lib1funcs.asm LIB1ASMFUNCS = _dvmd_tls _bb_init_func -.if ${MK_ARM_EABI} != "no" LIB2ADDEH = unwind-arm.c libunwind.S pr-support.c unwind-c.c # Some compilers generate __aeabi_ functions libgcc_s is missing DPADD+= ${LIBCOMPILER_RT} LDADD+= -lcompiler_rt -.else -LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c -.endif .endif .if ${TARGET_CPUARCH} == mips @@ -319,7 +315,7 @@ SHLIB_MKMAP = ${GCCDIR}/mkmap-symver.awk SHLIB_MKMAP_OPTS = SHLIB_MAPFILES = ${GCCDIR}/libgcc-std.ver -.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +.if ${TARGET_CPUARCH} == "arm" SHLIB_MAPFILES += ${GCCDIR}/config/arm/libgcc-bpabi.ver .endif VERSION_MAP = libgcc.map Index: gnu/lib/libgcov/Makefile =================================================================== --- gnu/lib/libgcov/Makefile +++ gnu/lib/libgcov/Makefile @@ -17,7 +17,7 @@ CFLAGS+= -I${.CURDIR}/../../usr.bin/cc/cc_tools \ -I${GCCLIB}/include -I${GCCDIR}/config -I${GCCDIR} -I. -.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +.if ${TARGET_CPUARCH} == "arm" CFLAGS+= -DTARGET_ARM_EABI .endif Index: gnu/lib/libstdc++/Makefile =================================================================== --- gnu/lib/libstdc++/Makefile +++ gnu/lib/libstdc++/Makefile @@ -16,9 +16,6 @@ SHLIB_MAJOR= 6 CFLAGS+= -DIN_GLIBCPP_V3 -DHAVE_CONFIG_H -.if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} == "no" -CFLAGS+= -D_GLIBCXX_SJLJ_EXCEPTIONS=1 -.endif CFLAGS+= -I${.CURDIR} -I${SUPDIR} -I${GCCDIR} -I${SRCDIR}/include CFLAGS+= -I${GCCLIB}/include -I${SRCDIR}/include -I. CFLAGS+= -frandom-seed=RepeatabilityConsideredGood @@ -596,7 +593,7 @@ CLEANFILES+= ${THRHDRS} -.if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +.if ${MACHINE_CPUARCH} == "arm" unwind.h: ${GCCDIR}/config/arm/unwind-arm.h .else unwind.h: ${GCCDIR}/unwind-generic.h Index: gnu/lib/libsupc++/Makefile =================================================================== --- gnu/lib/libsupc++/Makefile +++ gnu/lib/libsupc++/Makefile @@ -22,9 +22,6 @@ SRCS+= cp-demangle.c CFLAGS+= -DIN_GLIBCPP_V3 -DHAVE_CONFIG_H -.if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} == "no" -CFLAGS+= -D_GLIBCXX_SJLJ_EXCEPTIONS=1 -.endif CFLAGS+= -I${GCCLIB}/include -I${SRCDIR} -I${GCCDIR} CFLAGS+= -I${.CURDIR}/../libstdc++ -I. CFLAGS+= -frandom-seed=RepeatabilityConsideredGood @@ -35,7 +32,7 @@ INCS= ${HDRS:S;^;${SRCDIR}/;} INCSDIR=${INCLUDEDIR}/c++/${GCCVER} -.if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +.if ${MACHINE_CPUARCH} == "arm" unwind.h: ${GCCDIR}/config/arm/unwind-arm.h .else unwind.h: ${GCCDIR}/unwind-generic.h Index: gnu/usr.bin/cc/Makefile.inc =================================================================== --- gnu/usr.bin/cc/Makefile.inc +++ gnu/usr.bin/cc/Makefile.inc @@ -27,7 +27,7 @@ CFLAGS+= -DCROSS_DIRECTORY_STRUCTURE .endif -.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +.if ${TARGET_CPUARCH} == "arm" CFLAGS+= -DTARGET_ARM_EABI .endif Index: gnu/usr.bin/cc/cc_tools/Makefile =================================================================== --- gnu/usr.bin/cc/cc_tools/Makefile +++ gnu/usr.bin/cc/cc_tools/Makefile @@ -51,10 +51,8 @@ .endif .if ${TARGET_CPUARCH} == "arm" TARGET_INC+= ${GCC_CPU}/aout.h -.if ${MK_ARM_EABI} != "no" TARGET_INC+= ${GCC_CPU}/bpabi.h .endif -.endif .if ${TARGET_ARCH} == "powerpc64" TARGET_INC+= ${GCC_CPU}/biarch64.h TARGET_INC+= ${GCC_CPU}/default64.h @@ -352,7 +350,7 @@ GENSRCS+= gthr-default.h -.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +.if ${TARGET_CPUARCH} == "arm" unwind.h: ${GCCDIR}/config/arm/unwind-arm.h .else unwind.h: ${GCCDIR}/unwind-generic.h Index: lib/clang/clang.build.mk =================================================================== --- lib/clang/clang.build.mk +++ lib/clang/clang.build.mk @@ -22,8 +22,7 @@ TARGET_ARCH?= ${MACHINE_ARCH} BUILD_ARCH?= ${MACHINE_ARCH} -.if (${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "armv6") && \ - ${MK_ARM_EABI} != "no" +.if (${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "armv6") TARGET_ABI= gnueabi .elif ${TARGET_ARCH} == "armv6hf" TARGET_ABI= gnueabihf Index: lib/libc/arm/Makefile.inc =================================================================== --- lib/libc/arm/Makefile.inc +++ lib/libc/arm/Makefile.inc @@ -9,12 +9,7 @@ MDSRCS+=machdep_ldisd.c SYM_MAPS+=${LIBC_SRCTOP}/arm/Symbol.map -.if ${MK_ARM_EABI} == "no" -# This contains the symbols that were removed when moving to the ARM EABI -SYM_MAPS+=${LIBC_SRCTOP}/arm/Symbol_oabi.map -.else .include "${LIBC_SRCTOP}/arm/aeabi/Makefile.inc" -.endif .if ${MACHINE_ARCH} == "armv6hf" SYM_MAPS+=${LIBC_SRCTOP}/arm/Symbol_vfp.map Index: lib/libc/arm/Symbol_oabi.map =================================================================== --- lib/libc/arm/Symbol_oabi.map +++ /dev/null @@ -1,16 +0,0 @@ -/* - * $FreeBSD$ - */ - -/* - * This only needs to contain symbols that are not listed in - * symbol maps from other parts of libc (i.e., not found in - * stdlib/Symbol.map, string/Symbol.map, sys/Symbol.map, ...) - * and are not used in the ARM EABI. - */ -FBSDprivate_1.0 { - __umodsi3; - __modsi3; - __udivsi3; - __divsi3; -}; Index: lib/libc/arm/gen/Makefile.inc =================================================================== --- lib/libc/arm/gen/Makefile.inc +++ lib/libc/arm/gen/Makefile.inc @@ -6,10 +6,6 @@ __aeabi_read_tp.S setjmp.S signalcontext.c sigsetjmp.S flt_rounds.c \ arm_initfini.c -.if ${MK_ARM_EABI} == "no" -SRCS+= divsi3.S -.endif - .if ${MACHINE_ARCH} == "armv6hf" SRCS+= fpgetmask_vfp.c fpgetround_vfp.c fpgetsticky_vfp.c fpsetmask_vfp.c \ fpsetround_vfp.c fpsetsticky_vfp.c Index: lib/libc/quad/Makefile.inc =================================================================== --- lib/libc/quad/Makefile.inc +++ lib/libc/quad/Makefile.inc @@ -8,7 +8,7 @@ SRCS+= cmpdi2.c divdi3.c moddi3.c qdivrem.c ucmpdi2.c udivdi3.c umoddi3.c -.elif ${LIBC_ARCH} == "arm" && ${MK_ARM_EABI} != "no" +.elif ${LIBC_ARCH} == "arm" SRCS+= adddi3.c anddi3.c floatunsdidf.c iordi3.c lshldi3.c notdi2.c \ qdivrem.c subdi3.c xordi3.c Index: lib/libcompiler_rt/Makefile =================================================================== --- lib/libcompiler_rt/Makefile +++ lib/libcompiler_rt/Makefile @@ -144,8 +144,7 @@ truncdfsf2 .endif -.if ${MACHINE_CPUARCH} != "mips" && \ - (${MACHINE_CPUARCH} != "arm" || ${MK_ARM_EABI} != "no") +.if ${MACHINE_CPUARCH} != "mips" SRCF+= divsi3 \ modsi3 \ udivsi3 \ @@ -174,7 +173,7 @@ . endif .endfor -.if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +.if ${MACHINE_CPUARCH} == "arm" SRCS+= aeabi_idivmod.S \ aeabi_ldivmod.S \ aeabi_memcmp.S \ Index: lib/libstand/Makefile =================================================================== --- lib/libstand/Makefile +++ lib/libstand/Makefile @@ -64,9 +64,6 @@ .if ${MACHINE_CPUARCH} == "arm" .PATH: ${.CURDIR}/../libc/arm/gen -.if ${MK_ARM_EABI} == "no" -SRCS+= divsi3.S -.else # Compiler support functions .PATH: ${.CURDIR}/../../contrib/compiler-rt/lib/ # __clzsi2 and ctzsi2 for various builtin functions @@ -78,7 +75,6 @@ .PATH: ${.CURDIR}/../../contrib/compiler-rt/lib/arm/ SRCS+= aeabi_idivmod.S aeabi_ldivmod.S aeabi_uidivmod.S aeabi_uldivmod.S SRCS+= aeabi_memcmp.S aeabi_memcpy.S aeabi_memmove.S aeabi_memset.S -.endif .endif .if ${MACHINE_CPUARCH} == "powerpc" Index: libexec/rtld-elf/Makefile =================================================================== --- libexec/rtld-elf/Makefile +++ libexec/rtld-elf/Makefile @@ -46,7 +46,7 @@ DPADD= ${LIBC_PIC} LDADD= -lc_pic -.if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +.if ${MACHINE_CPUARCH} == "arm" # Some of the required math functions (div & mod) are implemented in # libcompiler_rt on ARM. The library also needs to be placed first to be # correctly linked. As some of the functions are used before we have Index: share/mk/src.opts.mk =================================================================== --- share/mk/src.opts.mk +++ share/mk/src.opts.mk @@ -48,7 +48,6 @@ ACPI \ AMD \ APM \ - ARM_EABI \ AT \ ATM \ AUDIT \ Index: sys/arm/arm/syscall.c =================================================================== --- /dev/null +++ sys/arm/arm/syscall.c @@ -0,0 +1,212 @@ +/* $NetBSD: fault.c,v 1.45 2003/11/20 14:44:36 scw Exp $ */ + +/*- + * Copyright 2004 Olivier Houchard + * Copyright 2003 Wasabi Systems, Inc. + * All rights reserved. + * + * Written by Steve C. Woodford for Wasabi Systems, Inc. + * + * 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. + * 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed for the NetBSD Project by + * Wasabi Systems, Inc. + * 4. The name of Wasabi Systems, Inc. may not be used to endorse + * or promote products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC + * 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. + */ +/*- + * Copyright (c) 1994-1997 Mark Brinicombe. + * Copyright (c) 1994 Brini. + * All rights reserved. + * + * This code is derived from software written for Brini by Mark Brinicombe + * + * 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. + * 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Brini. + * 4. The name of the company nor the name of the author may be used to + * endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY BRINI ``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 BRINI OR CONTRIBUTORS 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. + * + * RiscBSD kernel project + * + * fault.c + * + * Fault handlers + * + * Created : 28/11/94 + */ + + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +void swi_handler(struct trapframe *); + +static __inline void +call_trapsignal(struct thread *td, int sig, u_long code) +{ + ksiginfo_t ksi; + + ksiginfo_init_trap(&ksi); + ksi.ksi_signo = sig; + ksi.ksi_code = (int)code; + trapsignal(td, &ksi); +} + +int +cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa) +{ + struct proc *p; + register_t *ap; + int error; + +#ifdef __ARM_EABI__ + sa->code = td->td_frame->tf_r7; +#else + sa->code = sa->insn & 0x000fffff; +#endif + ap = &td->td_frame->tf_r0; + if (sa->code == SYS_syscall) { + sa->code = *ap++; + sa->nap--; + } else if (sa->code == SYS___syscall) { + sa->code = ap[_QUAD_LOWWORD]; + sa->nap -= 2; + ap += 2; + } + p = td->td_proc; + if (p->p_sysent->sv_mask) + sa->code &= p->p_sysent->sv_mask; + if (sa->code >= p->p_sysent->sv_size) + sa->callp = &p->p_sysent->sv_table[0]; + else + sa->callp = &p->p_sysent->sv_table[sa->code]; + sa->narg = sa->callp->sy_narg; + error = 0; + memcpy(sa->args, ap, sa->nap * sizeof(register_t)); + if (sa->narg > sa->nap) { + error = copyin((void *)td->td_frame->tf_usr_sp, sa->args + + sa->nap, (sa->narg - sa->nap) * sizeof(register_t)); + } + if (error == 0) { + td->td_retval[0] = 0; + td->td_retval[1] = 0; + } + return (error); +} + +#include "../../kern/subr_syscall.c" + +static void +syscall(struct thread *td, struct trapframe *frame) +{ + struct syscall_args sa; + int error; + +#ifndef __ARM_EABI__ + sa.insn = *(uint32_t *)(frame->tf_pc - INSN_SIZE); + switch (sa.insn & SWI_OS_MASK) { + case 0: /* XXX: we need our own one. */ + break; + default: + call_trapsignal(td, SIGILL, 0); + userret(td, frame); + return; + } +#endif + sa.nap = 4; + + error = syscallenter(td, &sa); + KASSERT(error != 0 || td->td_ar == NULL, + ("returning from syscall with td_ar set!")); + syscallret(td, error, &sa); +} + +void +swi_handler(struct trapframe *frame) +{ + struct thread *td = curthread; + + td->td_frame = frame; + + td->td_pticks = 0; + /* + * Make sure the program counter is correctly aligned so we + * don't take an alignment fault trying to read the opcode. + * XXX: Fix for Thumb mode + */ + if (__predict_false(((frame->tf_pc - INSN_SIZE) & 3) != 0)) { + call_trapsignal(td, SIGILL, 0); + userret(td, frame); + return; + } + /* + * Enable interrupts if they were enabled before the exception. + * Since all syscalls *should* come from user mode it will always + * be safe to enable them, but check anyway. + */ + if (td->td_md.md_spinlock_count == 0) { + if (__predict_true(frame->tf_spsr & PSR_I) == 0) + enable_interrupts(PSR_I); + if (__predict_true(frame->tf_spsr & PSR_F) == 0) + enable_interrupts(PSR_F); + } + + syscall(td, frame); +} Index: sys/boot/arm/ixp425/boot2/Makefile =================================================================== --- sys/boot/arm/ixp425/boot2/Makefile +++ sys/boot/arm/ixp425/boot2/Makefile @@ -17,9 +17,7 @@ SRCS=arm_init.S boot2.c ${BOOT_FLAVOR:tl}_board.c SRCS+=memchr.c memcmp.c memcpy.c memmem.c memset.c printf.c strcmp.c strcpy.c SRCS+=strlen.c ashldi3.c divsi3.S muldi3.c -.if ${MK_ARM_EABI} != "no" SRCS+=aeabi_unwind.c -.endif MAN= KERNPHYSADDR=0x180000 Index: sys/boot/libstand32/Makefile =================================================================== --- sys/boot/libstand32/Makefile +++ sys/boot/libstand32/Makefile @@ -67,9 +67,6 @@ .if ${MACHINE_CPUARCH} == "arm" .PATH: ${LIBC}/arm/gen -.if ${MK_ARM_EABI} == "no" -SRCS+= divsi3.S -.else # Compiler support functions .PATH: ${.CURDIR}/../../../contrib/compiler-rt/lib/ # __clzsi2 and ctzsi2 for various builtin functions @@ -81,7 +78,6 @@ .PATH: ${.CURDIR}/../../../contrib/compiler-rt/lib/arm/ SRCS+= aeabi_idivmod.S aeabi_ldivmod.S aeabi_uidivmod.S aeabi_uldivmod.S SRCS+= aeabi_memcmp.S aeabi_memcpy.S aeabi_memmove.S aeabi_memset.S -.endif .endif .if ${MACHINE_CPUARCH} == "powerpc" Index: sys/conf/Makefile.arm =================================================================== --- sys/conf/Makefile.arm +++ sys/conf/Makefile.arm @@ -42,11 +42,7 @@ # We don't support gcc's thump interwork stuff, so disable it CFLAGS.gcc += -mno-thumb-interwork -.if empty(DDB_ENABLED) -.if ${MK_ARM_EABI} == "no" -CFLAGS.gcc += -mno-apcs-frame -.endif -.elif ${MK_ARM_EABI} != "no" +.if !empty(DDB_ENABLED) CFLAGS += -funwind-tables # clang requires us to tell it to emit assembly with unwind information CFLAGS.clang += -mllvm -arm-enable-ehabi Index: sys/conf/kern.opts.mk =================================================================== --- sys/conf/kern.opts.mk +++ sys/conf/kern.opts.mk @@ -23,7 +23,6 @@ # src tree. __DEFAULT_YES_OPTIONS = \ - ARM_EABI \ BLUETOOTH \ CDDL \ CRYPT \