OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [config/] [arm/] [netbsd-elf.h] - Diff between revs 154 and 816

Only display areas with differences | Details | Blame | View Log

Rev 154 Rev 816
/* Definitions of target machine for GNU compiler, NetBSD/arm ELF version.
/* Definitions of target machine for GNU compiler, NetBSD/arm ELF version.
   Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
   Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
   Contributed by Wasabi Systems, Inc.
   Contributed by Wasabi Systems, Inc.
 
 
   This file is part of GCC.
   This file is part of GCC.
 
 
   GCC is free software; you can redistribute it and/or modify it
   GCC is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published
   under the terms of the GNU General Public License as published
   by the Free Software Foundation; either version 3, or (at your
   by the Free Software Foundation; either version 3, or (at your
   option) any later version.
   option) any later version.
 
 
   GCC is distributed in the hope that it will be useful, but WITHOUT
   GCC is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
   License for more details.
   License for more details.
 
 
   You should have received a copy of the GNU General Public License
   You should have received a copy of the GNU General Public License
   along with GCC; see the file COPYING3.  If not see
   along with GCC; see the file COPYING3.  If not see
   <http://www.gnu.org/licenses/>.  */
   <http://www.gnu.org/licenses/>.  */
 
 
/* Run-time Target Specification.  */
/* Run-time Target Specification.  */
#undef TARGET_VERSION
#undef TARGET_VERSION
#define TARGET_VERSION fputs (" (NetBSD/arm ELF)", stderr);
#define TARGET_VERSION fputs (" (NetBSD/arm ELF)", stderr);
 
 
/* arm.h defaults to ARM6 CPU.  */
/* arm.h defaults to ARM6 CPU.  */
 
 
/* This defaults us to little-endian.  */
/* This defaults us to little-endian.  */
#ifndef TARGET_ENDIAN_DEFAULT
#ifndef TARGET_ENDIAN_DEFAULT
#define TARGET_ENDIAN_DEFAULT 0
#define TARGET_ENDIAN_DEFAULT 0
#endif
#endif
 
 
#undef MULTILIB_DEFAULTS
#undef MULTILIB_DEFAULTS
 
 
/* Default it to use ATPCS with soft-VFP.  */
/* Default it to use ATPCS with soft-VFP.  */
#undef TARGET_DEFAULT
#undef TARGET_DEFAULT
#define TARGET_DEFAULT                  \
#define TARGET_DEFAULT                  \
  (MASK_APCS_FRAME                      \
  (MASK_APCS_FRAME                      \
   | TARGET_ENDIAN_DEFAULT)
   | TARGET_ENDIAN_DEFAULT)
 
 
#undef ARM_DEFAULT_ABI
#undef ARM_DEFAULT_ABI
#define ARM_DEFAULT_ABI ARM_ABI_ATPCS
#define ARM_DEFAULT_ABI ARM_ABI_ATPCS
 
 
#define TARGET_OS_CPP_BUILTINS()        \
#define TARGET_OS_CPP_BUILTINS()        \
  do                                    \
  do                                    \
    {                                   \
    {                                   \
      NETBSD_OS_CPP_BUILTINS_ELF();     \
      NETBSD_OS_CPP_BUILTINS_ELF();     \
    }                                   \
    }                                   \
  while (0)
  while (0)
 
 
#undef SUBTARGET_CPP_SPEC
#undef SUBTARGET_CPP_SPEC
#define SUBTARGET_CPP_SPEC NETBSD_CPP_SPEC
#define SUBTARGET_CPP_SPEC NETBSD_CPP_SPEC
 
 
#undef SUBTARGET_EXTRA_ASM_SPEC
#undef SUBTARGET_EXTRA_ASM_SPEC
#define SUBTARGET_EXTRA_ASM_SPEC        \
#define SUBTARGET_EXTRA_ASM_SPEC        \
  "-matpcs %{fpic|fpie:-k} %{fPIC|fPIE:-k}"
  "-matpcs %{fpic|fpie:-k} %{fPIC|fPIE:-k}"
 
 
/* Default to full VFP if -mhard-float is specified.  */
/* Default to full VFP if -mhard-float is specified.  */
#undef SUBTARGET_ASM_FLOAT_SPEC
#undef SUBTARGET_ASM_FLOAT_SPEC
#define SUBTARGET_ASM_FLOAT_SPEC        \
#define SUBTARGET_ASM_FLOAT_SPEC        \
  "%{mhard-float:{!mfpu=*:-mfpu=vfp}}   \
  "%{mhard-float:{!mfpu=*:-mfpu=vfp}}   \
   %{mfloat-abi=hard:{!mfpu=*:-mfpu=vfp}}"
   %{mfloat-abi=hard:{!mfpu=*:-mfpu=vfp}}"
 
 
#undef SUBTARGET_EXTRA_SPECS
#undef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS                           \
#define SUBTARGET_EXTRA_SPECS                           \
  { "subtarget_extra_asm_spec", SUBTARGET_EXTRA_ASM_SPEC }, \
  { "subtarget_extra_asm_spec", SUBTARGET_EXTRA_ASM_SPEC }, \
  { "subtarget_asm_float_spec", SUBTARGET_ASM_FLOAT_SPEC }, \
  { "subtarget_asm_float_spec", SUBTARGET_ASM_FLOAT_SPEC }, \
  { "netbsd_link_spec",         NETBSD_LINK_SPEC_ELF }, \
  { "netbsd_link_spec",         NETBSD_LINK_SPEC_ELF }, \
  { "netbsd_entry_point",       NETBSD_ENTRY_POINT },
  { "netbsd_entry_point",       NETBSD_ENTRY_POINT },
 
 
#define NETBSD_ENTRY_POINT "__start"
#define NETBSD_ENTRY_POINT "__start"
 
 
#undef LINK_SPEC
#undef LINK_SPEC
#define LINK_SPEC \
#define LINK_SPEC \
  "-X %{mbig-endian:-EB} %{mlittle-endian:-EL} \
  "-X %{mbig-endian:-EB} %{mlittle-endian:-EL} \
   %(netbsd_link_spec)"
   %(netbsd_link_spec)"
 
 
/* Make GCC agree with <machine/ansi.h>.  */
/* Make GCC agree with <machine/ansi.h>.  */
 
 
#undef SIZE_TYPE
#undef SIZE_TYPE
#define SIZE_TYPE "long unsigned int"
#define SIZE_TYPE "long unsigned int"
 
 
#undef PTRDIFF_TYPE
#undef PTRDIFF_TYPE
#define PTRDIFF_TYPE "long int"
#define PTRDIFF_TYPE "long int"
 
 
/* We don't have any limit on the length as out debugger is GDB.  */
/* We don't have any limit on the length as out debugger is GDB.  */
#undef DBX_CONTIN_LENGTH
#undef DBX_CONTIN_LENGTH
 
 
/* NetBSD does its profiling differently to the Acorn compiler. We
/* NetBSD does its profiling differently to the Acorn compiler. We
   don't need a word following the mcount call; and to skip it
   don't need a word following the mcount call; and to skip it
   requires either an assembly stub or use of fomit-frame-pointer when
   requires either an assembly stub or use of fomit-frame-pointer when
   compiling the profiling functions.  Since we break Acorn CC
   compiling the profiling functions.  Since we break Acorn CC
   compatibility below a little more won't hurt.  */
   compatibility below a little more won't hurt.  */
 
 
#undef ARM_FUNCTION_PROFILER                                  
#undef ARM_FUNCTION_PROFILER                                  
#define ARM_FUNCTION_PROFILER(STREAM,LABELNO)           \
#define ARM_FUNCTION_PROFILER(STREAM,LABELNO)           \
{                                                       \
{                                                       \
  asm_fprintf (STREAM, "\tmov\t%Rip, %Rlr\n");          \
  asm_fprintf (STREAM, "\tmov\t%Rip, %Rlr\n");          \
  asm_fprintf (STREAM, "\tbl\t__mcount%s\n",            \
  asm_fprintf (STREAM, "\tbl\t__mcount%s\n",            \
               (TARGET_ARM && NEED_PLT_RELOC)           \
               (TARGET_ARM && NEED_PLT_RELOC)           \
               ? "(PLT)" : "");                         \
               ? "(PLT)" : "");                         \
}
}
 
 
/* VERY BIG NOTE: Change of structure alignment for NetBSD/arm.
/* VERY BIG NOTE: Change of structure alignment for NetBSD/arm.
   There are consequences you should be aware of...
   There are consequences you should be aware of...
 
 
   Normally GCC/arm uses a structure alignment of 32 for compatibility
   Normally GCC/arm uses a structure alignment of 32 for compatibility
   with armcc.  This means that structures are padded to a word
   with armcc.  This means that structures are padded to a word
   boundary.  However this causes problems with bugged NetBSD kernel
   boundary.  However this causes problems with bugged NetBSD kernel
   code (possibly userland code as well - I have not checked every
   code (possibly userland code as well - I have not checked every
   binary).  The nature of this bugged code is to rely on sizeof()
   binary).  The nature of this bugged code is to rely on sizeof()
   returning the correct size of various structures rounded to the
   returning the correct size of various structures rounded to the
   nearest byte (SCSI and ether code are two examples, the vm system
   nearest byte (SCSI and ether code are two examples, the vm system
   is another).  This code breaks when the structure alignment is 32
   is another).  This code breaks when the structure alignment is 32
   as sizeof() will report a word=rounded size.  By changing the
   as sizeof() will report a word=rounded size.  By changing the
   structure alignment to 8. GCC will conform to what is expected by
   structure alignment to 8. GCC will conform to what is expected by
   NetBSD.
   NetBSD.
 
 
   This has several side effects that should be considered.
   This has several side effects that should be considered.
   1. Structures will only be aligned to the size of the largest member.
   1. Structures will only be aligned to the size of the largest member.
      i.e. structures containing only bytes will be byte aligned.
      i.e. structures containing only bytes will be byte aligned.
           structures containing shorts will be half word aligned.
           structures containing shorts will be half word aligned.
           structures containing ints will be word aligned.
           structures containing ints will be word aligned.
 
 
      This means structures should be padded to a word boundary if
      This means structures should be padded to a word boundary if
      alignment of 32 is required for byte structures etc.
      alignment of 32 is required for byte structures etc.
 
 
   2. A potential performance penalty may exist if strings are no longer
   2. A potential performance penalty may exist if strings are no longer
      word aligned.  GCC will not be able to use word load/stores to copy
      word aligned.  GCC will not be able to use word load/stores to copy
      short strings.
      short strings.
 
 
   This modification is not encouraged but with the present state of the
   This modification is not encouraged but with the present state of the
   NetBSD source tree it is currently the only solution that meets the
   NetBSD source tree it is currently the only solution that meets the
   requirements.  */
   requirements.  */
 
 
#undef DEFAULT_STRUCTURE_SIZE_BOUNDARY
#undef DEFAULT_STRUCTURE_SIZE_BOUNDARY
#define DEFAULT_STRUCTURE_SIZE_BOUNDARY 8
#define DEFAULT_STRUCTURE_SIZE_BOUNDARY 8
 
 
/* Clear the instruction cache from `BEG' to `END'.  This makes a
/* Clear the instruction cache from `BEG' to `END'.  This makes a
   call to the ARM_SYNC_ICACHE architecture specific syscall.  */
   call to the ARM_SYNC_ICACHE architecture specific syscall.  */
#define CLEAR_INSN_CACHE(BEG, END)                                      \
#define CLEAR_INSN_CACHE(BEG, END)                                      \
do                                                                      \
do                                                                      \
  {                                                                     \
  {                                                                     \
    extern int sysarch(int number, void *args);                         \
    extern int sysarch(int number, void *args);                         \
    struct                                                              \
    struct                                                              \
      {                                                                 \
      {                                                                 \
        unsigned int addr;                                              \
        unsigned int addr;                                              \
        int          len;                                               \
        int          len;                                               \
      } s;                                                              \
      } s;                                                              \
    s.addr = (unsigned int)(BEG);                                       \
    s.addr = (unsigned int)(BEG);                                       \
    s.len = (END) - (BEG);                                              \
    s.len = (END) - (BEG);                                              \
    (void) sysarch (0, &s);                                              \
    (void) sysarch (0, &s);                                              \
  }                                                                     \
  }                                                                     \
while (0)
while (0)
 
 
#undef FPUTYPE_DEFAULT
#undef FPUTYPE_DEFAULT
#define FPUTYPE_DEFAULT FPUTYPE_VFP
#define FPUTYPE_DEFAULT FPUTYPE_VFP
 
 
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.