]>
Commit | Line | Data |
---|---|---|
c906108c | 1 | /* Native support for i386 running SVR4. |
6aba47ca | 2 | Copyright 1986, 1987, 1989, 1992, 1996, 1997, 1998, 2007 |
b6ba6518 | 3 | Free Software Foundation, Inc. |
c906108c SS |
4 | Changes for 80386 by Pace Willisson (pace@prep.ai.mit.edu), July 1988. |
5 | ||
c5aa993b | 6 | This file is part of GDB. |
c906108c | 7 | |
c5aa993b JM |
8 | This program is free software; you can redistribute it and/or modify |
9 | it under the terms of the GNU General Public License as published by | |
10 | the Free Software Foundation; either version 2 of the License, or | |
11 | (at your option) any later version. | |
c906108c | 12 | |
c5aa993b JM |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | GNU General Public License for more details. | |
c906108c | 17 | |
c5aa993b JM |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software | |
20 | Foundation, Inc., 59 Temple Place - Suite 330, | |
21 | Boston, MA 02111-1307, USA. */ | |
c906108c | 22 | |
8674b74f MK |
23 | #ifndef NM_I386V42MP_H |
24 | #define NM_I386V42MP_H | |
25 | ||
80b93d6b AC |
26 | /* SVR4 has /proc support, so use it instead of ptrace. */ |
27 | ||
28 | #define USE_PROC_FS | |
8674b74f MK |
29 | |
30 | /* define to select for other sysv4.2mp weirdness (see procfs.c) */ | |
31 | ||
32 | #define UNIXWARE | |
33 | ||
34 | #if 0 | |
35 | /* The following macros extract process and lwp/thread ids from a | |
36 | composite id. | |
37 | ||
38 | For consistency with UnixWare core files, allocate bits 0-15 for | |
39 | process ids and bits 16 and up for lwp ids. Reserve bit 31 for | |
40 | negative return values to indicate exceptions, and use bit 30 as a | |
41 | flag to indicate a user-mode thread, leaving 14 bits for lwp | |
42 | ids. */ | |
43 | ||
44 | /* Number of bits in composite id allocated to process number. */ | |
45 | #define PIDBITS 16 | |
46 | ||
47 | /* Return the process id stored in composite PID. */ | |
48 | #define PIDGET(PID) (((PID) & ((1 << PIDBITS) - 1))) | |
49 | ||
50 | /* Return the thread or lwp id stored in composite PID. */ | |
51 | #define TIDGET(PID) (((PID) & 0x3fffffff) >> PIDBITS) | |
52 | #define LIDGET(PID) TIDGET(PID) | |
53 | ||
54 | /* Construct a composite id from lwp LID and the process portion of | |
55 | composite PID. */ | |
56 | #define MERGEPID(PID, LID) (PIDGET(PID) | ((LID) << PIDBITS)) | |
57 | #define MKLID(PID, LID) MERGEPID(PID, LID) | |
58 | ||
59 | /* Construct a composite id from thread TID and the process portion of | |
60 | composite PID. */ | |
61 | #define MKTID(PID, TID) (MERGEPID(PID, TID) | 0x40000000) | |
62 | ||
63 | /* Return whether PID contains a user-space thread id. */ | |
64 | #define ISTID(PID) ((PID) & 0x40000000) | |
65 | #endif | |
66 | ||
67 | /* New definitions of the ptid stuff. Due to the way the | |
68 | code is structured in uw-thread.c, I'm overloading the thread id | |
69 | and lwp id onto the lwp field. The tid field is used to indicate | |
70 | whether the lwp is a tid or not. | |
71 | ||
72 | FIXME: Check that core file support is not broken. (See original | |
73 | #if 0'd comments above.) | |
74 | FIXME: Restructure uw-thread.c so that the struct ptid fields | |
75 | can be used as intended. */ | |
76 | ||
77 | /* Return the process id stored in composite PID. */ | |
78 | #define PIDGET(PID) (ptid_get_pid (PID)) | |
79 | ||
80 | /* Return the thread or lwp id stored in composite PID. */ | |
81 | #define TIDGET(PID) (ptid_get_lwp (PID)) | |
82 | #define LIDGET(PID) TIDGET(PID) | |
83 | ||
84 | #define MERGEPID(PID, LID) (ptid_build ((PID), (LID), 0)) | |
85 | #define MKLID(PID, LID) (ptid_build ((PID), (LID), 0)) | |
86 | ||
87 | /* Construct a composite id from thread TID and the process portion of | |
88 | composite PID. */ | |
89 | #define MKTID(PID, TID) (ptid_build ((PID), (TID), 1)) | |
90 | ||
91 | /* Return whether PID contains a user-space thread id. */ | |
92 | #define ISTID(PID) (ptid_get_tid (PID)) | |
93 | ||
e910f676 AC |
94 | /* This is the amount to subtract from u.u_ar0 |
95 | to get the offset in the core file of the register values. */ | |
96 | #define KERNEL_U_ADDR 0xe0000000 | |
97 | ||
8674b74f | 98 | #endif /* NM_I386V42MP_H */ |