OSDN Git Service

Update/correct copyright notices.
[pf3gnuchains/pf3gnuchains3x.git] / gdb / config / m68k / tm-news.h
1 /* Parameters for execution on a Sony/NEWS, for GDB, the GNU debugger.
2    Copyright 1987, 1989, 1991, 1993, 1999, 2000
3    Free Software Foundation, Inc.
4
5    This file is part of GDB.
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, Inc., 59 Temple Place - Suite 330,
20    Boston, MA 02111-1307, USA.  */
21
22 /* See following cpu type determination macro to get the machine type.
23
24    Here is an m-news.h file for gdb.  It supports the 68881 registers.
25    by hikichi@srava.sra.junet
26
27    * Ptrace for handling floating register has a bug(before NEWS OS version 2.2),
28    * After NEWS OS version 3.2, some of ptrace's bug is fixed.
29    But we cannot change the floating register(see adb(1) in OS 3.2) yet.  */
30
31 /* Extract from an array REGBUF containing the (raw) register state
32    a function return value of type TYPE, and copy that, in virtual format,
33    into VALBUF.  */
34
35 /* when it return the floating value, use the FP0 in NEWS.  */
36 #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
37   { if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
38       { \
39         REGISTER_CONVERT_TO_VIRTUAL (FP0_REGNUM, TYPE, \
40                                      &REGBUF[REGISTER_BYTE (FP0_REGNUM)], \
41                                      VALBUF); \
42       } \
43     else \
44       memcpy (VALBUF, REGBUF, TYPE_LENGTH (TYPE)); }
45
46 /* Write into appropriate registers a function return value
47    of type TYPE, given in virtual format.  */
48
49 /* when it return the floating value, use the FP0 in NEWS.  */
50 #define STORE_RETURN_VALUE(TYPE,VALBUF) \
51   { if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
52       { \
53         char raw_buf[REGISTER_RAW_SIZE (FP0_REGNUM)]; \
54         REGISTER_CONVERT_TO_RAW (TYPE, FP0_REGNUM, VALBUF, raw_buf); \
55         write_register_bytes (REGISTER_BYTE (FP0_REGNUM), \
56                               raw_buf, REGISTER_RAW_SIZE (FP0_REGNUM)); \
57       } \
58     else \
59       write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE)); }
60
61 /* Return number of args passed to a frame.
62    Can return -1, meaning no way to tell.  */
63
64 extern int news_frame_num_args (struct frame_info *fi);
65 #define FRAME_NUM_ARGS(fi) (news_frame_num_args ((fi)))
66
67 #include "m68k/tm-m68k.h"