OSDN Git Service

2001-11-14 David O'Brien <obrien@FreeBSD.org>
[pf3gnuchains/gcc-fork.git] / gcc / config / sparc / sunos4.h
1 /* Definitions of target machine for GNU compiler, for SunOS 4.x
2    Copyright (C) 1994, 1999 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 #define SUNOS4_SHARED_LIBRARIES 1
22
23 #undef CPP_PREDEFINES
24 #define CPP_PREDEFINES "-Dsparc -Dsun -Dunix -Asystem=unix -Asystem=bsd"
25
26 /* Use N_BINCL stabs.  */
27
28 #define DBX_USE_BINCL
29
30 /* The Sun as doesn't like unaligned data.  */
31 #define DWARF2_UNWIND_INFO 0
32
33 /* Override MACHINE_STATE_{SAVE,RESTORE} because we have special
34    traps available which can get and set the condition codes
35    reliably.  */
36 #undef MACHINE_STATE_SAVE
37 #define MACHINE_STATE_SAVE(ID)                          \
38   unsigned long int ms_flags, ms_saveret;               \
39   asm volatile("ta      0x20\n\t"                       \
40                "mov     %%g1, %0\n\t"                   \
41                "mov     %%g2, %1\n\t"                   \
42                : "=r" (ms_flags), "=r" (ms_saveret));
43
44 #undef MACHINE_STATE_RESTORE
45 #define MACHINE_STATE_RESTORE(ID)                       \
46   asm volatile("mov     %0, %%g1\n\t"                   \
47                "mov     %1, %%g2\n\t"                   \
48                "ta      0x21\n\t"                       \
49                : /* no outputs */                       \
50                : "r" (ms_flags), "r" (ms_saveret));
51
52 /* SunOS has on_exit instead of atexit.  */
53 /* The man page says it returns int.  */
54 extern int on_exit PARAMS ((void *, void *));
55 #define ON_EXIT(FUNC) on_exit ((FUNC), 0)
56 #define NEED_ATEXIT