]>
Commit | Line | Data |
---|---|---|
dd3b648e RP |
1 | /* Copyright (C) 1990 Free Software Foundation, Inc. |
2 | ||
3 | This file is part of GDB. | |
4 | ||
99a7de40 | 5 | This program is free software; you can redistribute it and/or modify |
dd3b648e | 6 | it under the terms of the GNU General Public License as published by |
99a7de40 JG |
7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | |
dd3b648e | 9 | |
99a7de40 | 10 | This program is distributed in the hope that it will be useful, |
dd3b648e RP |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | GNU General Public License for more details. | |
14 | ||
15 | You should have received a copy of the GNU General Public License | |
99a7de40 JG |
16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
dd3b648e RP |
18 | |
19 | #if !defined (PARAM_H) | |
20 | #define PARAM_H 1 | |
21 | ||
22 | /* DO NOT #include "tm.h" -- a particular tm file has been inc'd by caller */ | |
23 | ||
24 | #include "xm.h" | |
25 | ||
26 | /* TARGET_BYTE_ORDER and HOST_BYTE_ORDER should be defined to one of these. */ | |
27 | #if !defined (BIG_ENDIAN) | |
28 | #define BIG_ENDIAN 4321 | |
29 | #endif | |
30 | ||
31 | #if !defined (LITTLE_ENDIAN) | |
32 | #define LITTLE_ENDIAN 1234 | |
33 | #endif | |
34 | ||
35 | /* The bit byte-order has to do just with numbering of bits in | |
36 | debugging symbols and such. Conceptually, it's quite separate | |
37 | from byte/word byte order. */ | |
38 | ||
122ad9ab | 39 | #if !defined (BITS_BIG_ENDIAN) |
dd3b648e RP |
40 | #if TARGET_BYTE_ORDER == BIG_ENDIAN |
41 | #define BITS_BIG_ENDIAN 1 | |
122ad9ab | 42 | #endif /* Big endian. */ |
dd3b648e RP |
43 | |
44 | #if TARGET_BYTE_ORDER == LITTLE_ENDIAN | |
122ad9ab JK |
45 | #define BITS_BIG_ENDIAN 0 |
46 | #endif /* Little endian. */ | |
47 | #endif /* BITS_BIG_ENDIAN not defined. */ | |
dd3b648e RP |
48 | |
49 | /* Swap LEN bytes at BUFFER between target and host byte-order. */ | |
50 | #if TARGET_BYTE_ORDER == HOST_BYTE_ORDER | |
51 | #define SWAP_TARGET_AND_HOST(buffer,len) | |
52 | #else /* Target and host byte order differ. */ | |
53 | #define SWAP_TARGET_AND_HOST(buffer,len) \ | |
54 | { \ | |
55 | char tmp; \ | |
56 | char *p = (char *)(buffer); \ | |
57 | char *q = ((char *)(buffer)) + len - 1; \ | |
58 | for (; p < q; p++, q--) \ | |
59 | { \ | |
60 | tmp = *q; \ | |
61 | *q = *p; \ | |
62 | *p = tmp; \ | |
63 | } \ | |
64 | } | |
65 | #endif /* Target and host byte order differ. */ | |
66 | ||
67 | /* On some machines there are bits in addresses which are not really | |
68 | part of the address, but are used by the kernel, the hardware, etc. | |
69 | for special purposes. ADDR_BITS_REMOVE takes out any such bits | |
70 | so we get a "real" address such as one would find in a symbol | |
71 | table. ADDR_BITS_SET sets those bits the way the system wants | |
72 | them. */ | |
73 | #if !defined (ADDR_BITS_REMOVE) | |
74 | #define ADDR_BITS_REMOVE(addr) (addr) | |
75 | #define ADDR_BITS_SET(addr) (addr) | |
76 | #endif /* No ADDR_BITS_REMOVE. */ | |
77 | ||
ff8aef19 JK |
78 | #if !defined (SYS_SIGLIST_MISSING) |
79 | #define SYS_SIGLIST_MISSING defined (USG) | |
80 | #endif /* No SYS_SIGLIST_MISSING */ | |
81 | ||
dd3b648e | 82 | #endif /* param.h not already included. */ |