xref: /openbsd-src/gnu/usr.bin/gcc/gcc/config/m88k/openbsd.h (revision 12091a50ae4a44c6da1220a4763af390c6971bf8)
1 /* Configuration file for an m88k OpenBSD target.
2    Copyright (C) 2000 Free Software Foundation, Inc.
3 
4 This file is part of GNU CC.
5 
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10 
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING.  If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA.  */
20 
21 /* <m88k/m88k.h> provided wrong GLOBAL_ASM_OP and SET_ASM_OP */
22 #undef SET_ASM_OP
23 #define SET_ASM_OP	"\tequ\t"
24 #undef GLOBAL_ASM_OP
25 #define GLOBAL_ASM_OP	"\t.globl\t"
26 
27 /* <m88k/m88k.h> provided wrong SUPPORTS_WEAK and SUPPORTS_ONE_ONLY values */
28 #undef SUPPORTS_WEAK
29 #undef SUPPORTS_ONE_ONLY
30 
31 /* Run-time target specifications.  */
32 #define TARGET_OS_CPP_BUILTINS()			\
33   do							\
34     {							\
35       OPENBSD_OS_CPP_BUILTINS_COMMON();			\
36       builtin_define ("__m88k");			\
37       builtin_define ("__m88k__");			\
38       builtin_assert ("cpu=m88k");			\
39       builtin_assert ("machine=m88k");			\
40       if (TARGET_88000)					\
41 	builtin_define ("__mc88000__");			\
42       else						\
43 	{						\
44 	  if (TARGET_88100)				\
45 	    builtin_define ("__mc88100__");		\
46 	  if (TARGET_88110)				\
47 	    builtin_define ("__mc88110__");		\
48 	}						\
49     }							\
50   while (0)
51 
52 /* Layout of source language data types. */
53 
54 /* This must agree with <machine/_types.h> */
55 #undef SIZE_TYPE
56 #define SIZE_TYPE "long unsigned int"
57 
58 #undef PTRDIFF_TYPE
59 #define PTRDIFF_TYPE "long int"
60 
61 #undef INTMAX_TYPE
62 #define INTMAX_TYPE "long long int"
63 
64 #undef UINTMAX_TYPE
65 #define UINTMAX_TYPE "long long unsigned int"
66 
67 #undef WCHAR_TYPE
68 #define WCHAR_TYPE "int"
69 
70 #undef WCHAR_TYPE_SIZE
71 #define WCHAR_TYPE_SIZE 32
72 
73 /* Every structure or union's size must be a multiple of 2 bytes.  */
74 #undef STRUCTURE_SIZE_BOUNDARY
75 #define STRUCTURE_SIZE_BOUNDARY 16
76 
77 /* Due to the split instruction and data caches, trampolines must cause the
78    data cache to be synced before attempting to execute the trampoline code.
79    Under OpenBSD, this is done by invoking trap #451 with r2 and r3 set to
80    the address of the trampoline area and its size, respectively.  */
81 #undef FINALIZE_TRAMPOLINE
82 #define FINALIZE_TRAMPOLINE(TRAMP)					\
83   emit_library_call(gen_rtx_SYMBOL_REF (Pmode, "__dcache_sync"),	\
84 		    0, VOIDmode, 2, (TRAMP), Pmode,			\
85 		    GEN_INT (TRAMPOLINE_SIZE), Pmode)
86 
87 #if defined(CROSS_COMPILE) && !defined(ATTRIBUTE_UNUSED)
88 #define ATTRIBUTE_UNUSED
89 #endif
90 #undef TRANSFER_FROM_TRAMPOLINE
91 #define TRANSFER_FROM_TRAMPOLINE					\
92 extern void __dcache_sync(int, int);					\
93 void									\
94 __dcache_sync (addr, len)						\
95      int addr ATTRIBUTE_UNUSED, len ATTRIBUTE_UNUSED;			\
96 {									\
97   /* r2 and r3 are set by the caller and need not be modified */	\
98   __asm __volatile ("tb0 0, r0, 451");					\
99 }
100 
101 /* All configurations that don't use elf must be explicit about not using
102    dwarf unwind information. egcs doesn't try too hard to check internal
103    configuration files...  */
104 #define DWARF2_UNWIND_INFO 0
105