]>
Commit | Line | Data |
---|---|---|
a4b6fc86 AC |
1 | /* Motorola m68k native support for GNU/Linux. |
2 | ||
3 | Copyright 1996, 1998, 2000, 2001, 2002 Free Software Foundation, | |
4 | Inc. | |
c906108c | 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 SS |
22 | |
23 | #include "defs.h" | |
24 | #include "frame.h" | |
25 | #include "inferior.h" | |
26 | #include "language.h" | |
27 | #include "gdbcore.h" | |
4e052eda | 28 | #include "regcache.h" |
c906108c SS |
29 | |
30 | #ifdef USG | |
31 | #include <sys/types.h> | |
32 | #endif | |
33 | ||
34 | #include <sys/param.h> | |
35 | #include <sys/dir.h> | |
36 | #include <signal.h> | |
0280a90a | 37 | #include <sys/ptrace.h> |
c906108c SS |
38 | #include <sys/user.h> |
39 | #include <sys/ioctl.h> | |
40 | #include <fcntl.h> | |
41 | #include <sys/procfs.h> | |
42 | ||
0280a90a AS |
43 | #ifdef HAVE_SYS_REG_H |
44 | #include <sys/reg.h> | |
45 | #endif | |
46 | ||
c906108c SS |
47 | #include <sys/file.h> |
48 | #include "gdb_stat.h" | |
49 | ||
50 | #include "floatformat.h" | |
51 | ||
52 | #include "target.h" | |
c906108c | 53 | \f |
c5aa993b | 54 | |
c906108c | 55 | /* This table must line up with REGISTER_NAMES in tm-m68k.h */ |
c5aa993b | 56 | static const int regmap[] = |
c906108c SS |
57 | { |
58 | PT_D0, PT_D1, PT_D2, PT_D3, PT_D4, PT_D5, PT_D6, PT_D7, | |
59 | PT_A0, PT_A1, PT_A2, PT_A3, PT_A4, PT_A5, PT_A6, PT_USP, | |
60 | PT_SR, PT_PC, | |
61 | /* PT_FP0, ..., PT_FP7 */ | |
62 | 21, 24, 27, 30, 33, 36, 39, 42, | |
63 | /* PT_FPCR, PT_FPSR, PT_FPIAR */ | |
64 | 45, 46, 47 | |
65 | }; | |
66 | ||
0280a90a AS |
67 | /* Which ptrace request retrieves which registers? |
68 | These apply to the corresponding SET requests as well. */ | |
69 | #define NUM_GREGS (18) | |
70 | #define MAX_NUM_REGS (NUM_GREGS + 11) | |
71 | ||
72 | int | |
73 | getregs_supplies (int regno) | |
74 | { | |
75 | return 0 <= regno && regno < NUM_GREGS; | |
76 | } | |
77 | ||
78 | int | |
79 | getfpregs_supplies (int regno) | |
80 | { | |
81 | return FP0_REGNUM <= regno && regno <= FPI_REGNUM; | |
82 | } | |
83 | ||
84 | /* Does the current host support the GETREGS request? */ | |
85 | int have_ptrace_getregs = | |
86 | #ifdef HAVE_PTRACE_GETREGS | |
87 | 1 | |
88 | #else | |
89 | 0 | |
90 | #endif | |
91 | ; | |
92 | ||
93 | \f | |
94 | ||
c906108c SS |
95 | /* BLOCKEND is the value of u.u_ar0, and points to the place where GS |
96 | is stored. */ | |
97 | ||
98 | int | |
fba45db2 | 99 | m68k_linux_register_u_addr (int blockend, int regnum) |
c906108c | 100 | { |
c5aa993b | 101 | return (blockend + 4 * regmap[regnum]); |
c906108c | 102 | } |
0280a90a AS |
103 | \f |
104 | ||
105 | /* Fetching registers directly from the U area, one at a time. */ | |
106 | ||
107 | /* FIXME: This duplicates code from `inptrace.c'. The problem is that we | |
108 | define FETCH_INFERIOR_REGISTERS since we want to use our own versions | |
109 | of {fetch,store}_inferior_registers that use the GETREGS request. This | |
110 | means that the code in `infptrace.c' is #ifdef'd out. But we need to | |
111 | fall back on that code when GDB is running on top of a kernel that | |
112 | doesn't support the GETREGS request. */ | |
113 | ||
114 | #ifndef PT_READ_U | |
115 | #define PT_READ_U PTRACE_PEEKUSR | |
116 | #endif | |
117 | #ifndef PT_WRITE_U | |
118 | #define PT_WRITE_U PTRACE_POKEUSR | |
119 | #endif | |
120 | ||
121 | /* Default the type of the ptrace transfer to int. */ | |
122 | #ifndef PTRACE_XFER_TYPE | |
123 | #define PTRACE_XFER_TYPE int | |
124 | #endif | |
125 | ||
126 | /* Fetch one register. */ | |
127 | ||
128 | static void | |
129 | fetch_register (int regno) | |
130 | { | |
131 | /* This isn't really an address. But ptrace thinks of it as one. */ | |
132 | CORE_ADDR regaddr; | |
133 | char mess[128]; /* For messages */ | |
134 | register int i; | |
135 | unsigned int offset; /* Offset of registers within the u area. */ | |
136 | char buf[MAX_REGISTER_RAW_SIZE]; | |
137 | int tid; | |
138 | ||
139 | if (CANNOT_FETCH_REGISTER (regno)) | |
140 | { | |
141 | memset (buf, '\0', REGISTER_RAW_SIZE (regno)); /* Supply zeroes */ | |
142 | supply_register (regno, buf); | |
143 | return; | |
144 | } | |
145 | ||
146 | /* Overload thread id onto process id */ | |
147 | if ((tid = TIDGET (inferior_ptid)) == 0) | |
148 | tid = PIDGET (inferior_ptid); /* no thread id, just use process id */ | |
149 | ||
150 | offset = U_REGS_OFFSET; | |
151 | ||
152 | regaddr = register_addr (regno, offset); | |
153 | for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (PTRACE_XFER_TYPE)) | |
154 | { | |
155 | errno = 0; | |
156 | *(PTRACE_XFER_TYPE *) & buf[i] = ptrace (PT_READ_U, tid, | |
157 | (PTRACE_ARG3_TYPE) regaddr, 0); | |
158 | regaddr += sizeof (PTRACE_XFER_TYPE); | |
159 | if (errno != 0) | |
160 | { | |
161 | sprintf (mess, "reading register %s (#%d)", | |
162 | REGISTER_NAME (regno), regno); | |
163 | perror_with_name (mess); | |
164 | } | |
165 | } | |
166 | supply_register (regno, buf); | |
167 | } | |
168 | ||
169 | /* Fetch register values from the inferior. | |
170 | If REGNO is negative, do this for all registers. | |
171 | Otherwise, REGNO specifies which register (so we can save time). */ | |
c906108c | 172 | |
0280a90a AS |
173 | void |
174 | old_fetch_inferior_registers (int regno) | |
175 | { | |
176 | if (regno >= 0) | |
177 | { | |
178 | fetch_register (regno); | |
179 | } | |
180 | else | |
181 | { | |
182 | for (regno = 0; regno < NUM_REGS; regno++) | |
183 | { | |
184 | fetch_register (regno); | |
185 | } | |
186 | } | |
187 | } | |
188 | ||
189 | /* Store one register. */ | |
190 | ||
191 | static void | |
192 | store_register (int regno) | |
193 | { | |
194 | /* This isn't really an address. But ptrace thinks of it as one. */ | |
195 | CORE_ADDR regaddr; | |
196 | char mess[128]; /* For messages */ | |
197 | register int i; | |
198 | unsigned int offset; /* Offset of registers within the u area. */ | |
199 | int tid; | |
9852326a | 200 | char *buf = alloca (MAX_REGISTER_RAW_SIZE); |
0280a90a AS |
201 | |
202 | if (CANNOT_STORE_REGISTER (regno)) | |
203 | { | |
204 | return; | |
205 | } | |
206 | ||
207 | /* Overload thread id onto process id */ | |
208 | if ((tid = TIDGET (inferior_ptid)) == 0) | |
209 | tid = PIDGET (inferior_ptid); /* no thread id, just use process id */ | |
210 | ||
211 | offset = U_REGS_OFFSET; | |
212 | ||
213 | regaddr = register_addr (regno, offset); | |
9852326a AS |
214 | |
215 | /* Put the contents of regno into a local buffer */ | |
216 | regcache_collect (regno, buf); | |
217 | ||
218 | /* Store the local buffer into the inferior a chunk at the time. */ | |
0280a90a AS |
219 | for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (PTRACE_XFER_TYPE)) |
220 | { | |
221 | errno = 0; | |
222 | ptrace (PT_WRITE_U, tid, (PTRACE_ARG3_TYPE) regaddr, | |
9852326a | 223 | *(PTRACE_XFER_TYPE *) (buf + i)); |
0280a90a AS |
224 | regaddr += sizeof (PTRACE_XFER_TYPE); |
225 | if (errno != 0) | |
226 | { | |
227 | sprintf (mess, "writing register %s (#%d)", | |
228 | REGISTER_NAME (regno), regno); | |
229 | perror_with_name (mess); | |
230 | } | |
231 | } | |
232 | } | |
233 | ||
234 | /* Store our register values back into the inferior. | |
235 | If REGNO is negative, do this for all registers. | |
236 | Otherwise, REGNO specifies which register (so we can save time). */ | |
237 | ||
238 | void | |
239 | old_store_inferior_registers (int regno) | |
240 | { | |
241 | if (regno >= 0) | |
242 | { | |
243 | store_register (regno); | |
244 | } | |
245 | else | |
246 | { | |
247 | for (regno = 0; regno < NUM_REGS; regno++) | |
248 | { | |
249 | store_register (regno); | |
250 | } | |
251 | } | |
252 | } | |
253 | \f | |
f175af98 DJ |
254 | /* Given a pointer to a general register set in /proc format |
255 | (elf_gregset_t *), unpack the register contents and supply | |
256 | them as gdb's idea of the current register values. */ | |
c906108c SS |
257 | |
258 | ||
259 | /* Note both m68k-tdep.c and m68klinux-nat.c contain definitions | |
260 | for supply_gregset and supply_fpregset. The definitions | |
261 | in m68k-tdep.c are valid if USE_PROC_FS is defined. Otherwise, | |
262 | the definitions in m68klinux-nat.c will be used. This is a | |
263 | bit of a hack. The supply_* routines do not belong in | |
264 | *_tdep.c files. But, there are several lynx ports that currently | |
c5aa993b | 265 | depend on these definitions. */ |
c906108c SS |
266 | |
267 | #ifndef USE_PROC_FS | |
268 | ||
c60c0f5f MS |
269 | /* Prototypes for supply_gregset etc. */ |
270 | #include "gregset.h" | |
271 | ||
c906108c | 272 | void |
f175af98 | 273 | supply_gregset (elf_gregset_t *gregsetp) |
c906108c | 274 | { |
0280a90a | 275 | elf_greg_t *regp = (elf_greg_t *) gregsetp; |
c906108c SS |
276 | int regi; |
277 | ||
c5aa993b | 278 | for (regi = D0_REGNUM; regi <= SP_REGNUM; regi++) |
0280a90a AS |
279 | supply_register (regi, (char *) ®p[regmap[regi]]); |
280 | supply_register (PS_REGNUM, (char *) ®p[PT_SR]); | |
281 | supply_register (PC_REGNUM, (char *) ®p[PT_PC]); | |
282 | } | |
283 | ||
284 | /* Fill register REGNO (if it is a general-purpose register) in | |
285 | *GREGSETPS with the value in GDB's register array. If REGNO is -1, | |
286 | do this for all registers. */ | |
287 | void | |
288 | fill_gregset (elf_gregset_t *gregsetp, int regno) | |
289 | { | |
290 | elf_greg_t *regp = (elf_greg_t *) gregsetp; | |
291 | int i; | |
292 | ||
293 | for (i = 0; i < NUM_GREGS; i++) | |
294 | if ((regno == -1 || regno == i)) | |
295 | regcache_collect (i, regp + regmap[i]); | |
296 | } | |
297 | ||
298 | #ifdef HAVE_PTRACE_GETREGS | |
299 | ||
300 | /* Fetch all general-purpose registers from process/thread TID and | |
301 | store their values in GDB's register array. */ | |
302 | ||
303 | static void | |
304 | fetch_regs (int tid) | |
305 | { | |
306 | elf_gregset_t regs; | |
307 | ||
308 | if (ptrace (PTRACE_GETREGS, tid, 0, (int) ®s) < 0) | |
309 | { | |
310 | if (errno == EIO) | |
311 | { | |
312 | /* The kernel we're running on doesn't support the GETREGS | |
313 | request. Reset `have_ptrace_getregs'. */ | |
314 | have_ptrace_getregs = 0; | |
315 | return; | |
316 | } | |
317 | ||
318 | perror_with_name ("Couldn't get registers"); | |
319 | } | |
320 | ||
321 | supply_gregset (®s); | |
c906108c SS |
322 | } |
323 | ||
0280a90a AS |
324 | /* Store all valid general-purpose registers in GDB's register array |
325 | into the process/thread specified by TID. */ | |
326 | ||
327 | static void | |
328 | store_regs (int tid, int regno) | |
329 | { | |
330 | elf_gregset_t regs; | |
331 | ||
332 | if (ptrace (PTRACE_GETREGS, tid, 0, (int) ®s) < 0) | |
333 | perror_with_name ("Couldn't get registers"); | |
334 | ||
335 | fill_gregset (®s, regno); | |
336 | ||
337 | if (ptrace (PTRACE_SETREGS, tid, 0, (int) ®s) < 0) | |
338 | perror_with_name ("Couldn't write registers"); | |
339 | } | |
340 | ||
341 | #else | |
342 | ||
343 | static void fetch_regs (int tid) {} | |
344 | static void store_regs (int tid, int regno) {} | |
345 | ||
346 | #endif | |
347 | ||
348 | \f | |
349 | /* Transfering floating-point registers between GDB, inferiors and cores. */ | |
350 | ||
351 | /* What is the address of fpN within the floating-point register set F? */ | |
352 | #define FPREG_ADDR(f, n) ((char *) &(f)->fpregs[(n) * 3]) | |
353 | ||
354 | /* Fill GDB's register array with the floating-point register values in | |
355 | *FPREGSETP. */ | |
c906108c | 356 | |
c5aa993b | 357 | void |
f175af98 | 358 | supply_fpregset (elf_fpregset_t *fpregsetp) |
c906108c SS |
359 | { |
360 | int regi; | |
361 | ||
c5aa993b | 362 | for (regi = FP0_REGNUM; regi < FPC_REGNUM; regi++) |
0280a90a | 363 | supply_register (regi, FPREG_ADDR (fpregsetp, regi - FP0_REGNUM)); |
c906108c SS |
364 | supply_register (FPC_REGNUM, (char *) &fpregsetp->fpcntl[0]); |
365 | supply_register (FPS_REGNUM, (char *) &fpregsetp->fpcntl[1]); | |
366 | supply_register (FPI_REGNUM, (char *) &fpregsetp->fpcntl[2]); | |
367 | } | |
368 | ||
0280a90a AS |
369 | /* Fill register REGNO (if it is a floating-point register) in |
370 | *FPREGSETP with the value in GDB's register array. If REGNO is -1, | |
371 | do this for all registers. */ | |
372 | ||
373 | void | |
374 | fill_fpregset (elf_fpregset_t *fpregsetp, int regno) | |
375 | { | |
376 | int i; | |
377 | ||
378 | /* Fill in the floating-point registers. */ | |
379 | for (i = FP0_REGNUM; i < FP0_REGNUM + 8; i++) | |
380 | if (regno == -1 || regno == i) | |
9852326a | 381 | regcache_collect (regno, FPREG_ADDR (fpregsetp, regno - FP0_REGNUM)); |
0280a90a AS |
382 | |
383 | /* Fill in the floating-point control registers. */ | |
384 | for (i = FPC_REGNUM; i <= FPI_REGNUM; i++) | |
385 | if (regno == -1 || regno == i) | |
2853c33c | 386 | regcache_collect (regno, (char *) &fpregsetp->fpcntl[regno - FPC_REGNUM]); |
0280a90a AS |
387 | } |
388 | ||
389 | #ifdef HAVE_PTRACE_GETREGS | |
390 | ||
391 | /* Fetch all floating-point registers from process/thread TID and store | |
392 | thier values in GDB's register array. */ | |
393 | ||
394 | static void | |
395 | fetch_fpregs (int tid) | |
396 | { | |
397 | elf_fpregset_t fpregs; | |
398 | ||
399 | if (ptrace (PTRACE_GETFPREGS, tid, 0, (int) &fpregs) < 0) | |
400 | perror_with_name ("Couldn't get floating point status"); | |
401 | ||
402 | supply_fpregset (&fpregs); | |
403 | } | |
404 | ||
405 | /* Store all valid floating-point registers in GDB's register array | |
406 | into the process/thread specified by TID. */ | |
407 | ||
408 | static void | |
409 | store_fpregs (int tid, int regno) | |
410 | { | |
411 | elf_fpregset_t fpregs; | |
412 | ||
413 | if (ptrace (PTRACE_GETFPREGS, tid, 0, (int) &fpregs) < 0) | |
414 | perror_with_name ("Couldn't get floating point status"); | |
415 | ||
416 | fill_fpregset (&fpregs, regno); | |
417 | ||
418 | if (ptrace (PTRACE_SETFPREGS, tid, 0, (int) &fpregs) < 0) | |
419 | perror_with_name ("Couldn't write floating point status"); | |
420 | } | |
421 | ||
422 | #else | |
423 | ||
424 | static void fetch_fpregs (int tid) {} | |
425 | static void store_fpregs (int tid, int regno) {} | |
426 | ||
427 | #endif | |
428 | ||
c906108c | 429 | #endif |
0280a90a AS |
430 | \f |
431 | /* Transferring arbitrary registers between GDB and inferior. */ | |
432 | ||
433 | /* Fetch register REGNO from the child process. If REGNO is -1, do | |
434 | this for all registers (including the floating point and SSE | |
435 | registers). */ | |
436 | ||
437 | void | |
438 | fetch_inferior_registers (int regno) | |
439 | { | |
440 | int tid; | |
441 | ||
442 | /* Use the old method of peeking around in `struct user' if the | |
443 | GETREGS request isn't available. */ | |
444 | if (! have_ptrace_getregs) | |
445 | { | |
446 | old_fetch_inferior_registers (regno); | |
447 | return; | |
448 | } | |
449 | ||
a4b6fc86 | 450 | /* GNU/Linux LWP ID's are process ID's. */ |
0280a90a AS |
451 | if ((tid = TIDGET (inferior_ptid)) == 0) |
452 | tid = PIDGET (inferior_ptid); /* Not a threaded program. */ | |
f175af98 | 453 | |
0280a90a AS |
454 | /* Use the PTRACE_GETFPXREGS request whenever possible, since it |
455 | transfers more registers in one system call, and we'll cache the | |
456 | results. But remember that fetch_fpxregs can fail, and return | |
457 | zero. */ | |
458 | if (regno == -1) | |
459 | { | |
460 | fetch_regs (tid); | |
461 | ||
462 | /* The call above might reset `have_ptrace_getregs'. */ | |
463 | if (! have_ptrace_getregs) | |
464 | { | |
465 | old_fetch_inferior_registers (-1); | |
466 | return; | |
467 | } | |
468 | ||
469 | fetch_fpregs (tid); | |
470 | return; | |
471 | } | |
472 | ||
473 | if (getregs_supplies (regno)) | |
474 | { | |
475 | fetch_regs (tid); | |
476 | return; | |
477 | } | |
478 | ||
479 | if (getfpregs_supplies (regno)) | |
480 | { | |
481 | fetch_fpregs (tid); | |
482 | return; | |
483 | } | |
484 | ||
485 | internal_error (__FILE__, __LINE__, | |
486 | "Got request for bad register number %d.", regno); | |
487 | } | |
488 | ||
489 | /* Store register REGNO back into the child process. If REGNO is -1, | |
490 | do this for all registers (including the floating point and SSE | |
491 | registers). */ | |
492 | void | |
493 | store_inferior_registers (int regno) | |
494 | { | |
495 | int tid; | |
496 | ||
497 | /* Use the old method of poking around in `struct user' if the | |
498 | SETREGS request isn't available. */ | |
499 | if (! have_ptrace_getregs) | |
500 | { | |
501 | old_store_inferior_registers (regno); | |
502 | return; | |
503 | } | |
504 | ||
a4b6fc86 | 505 | /* GNU/Linux LWP ID's are process ID's. */ |
0280a90a AS |
506 | if ((tid = TIDGET (inferior_ptid)) == 0) |
507 | tid = PIDGET (inferior_ptid); /* Not a threaded program. */ | |
508 | ||
509 | /* Use the PTRACE_SETFPREGS requests whenever possible, since it | |
510 | transfers more registers in one system call. But remember that | |
511 | store_fpregs can fail, and return zero. */ | |
512 | if (regno == -1) | |
513 | { | |
514 | store_regs (tid, regno); | |
515 | store_fpregs (tid, regno); | |
516 | return; | |
517 | } | |
518 | ||
519 | if (getregs_supplies (regno)) | |
520 | { | |
521 | store_regs (tid, regno); | |
522 | return; | |
523 | } | |
524 | ||
525 | if (getfpregs_supplies (regno)) | |
526 | { | |
527 | store_fpregs (tid, regno); | |
528 | return; | |
529 | } | |
530 | ||
531 | internal_error (__FILE__, __LINE__, | |
532 | "Got request to store bad register number %d.", regno); | |
533 | } | |
f175af98 DJ |
534 | \f |
535 | /* Interpreting register set info found in core files. */ | |
536 | ||
537 | /* Provide registers to GDB from a core file. | |
538 | ||
539 | (We can't use the generic version of this function in | |
540 | core-regset.c, because we need to use elf_gregset_t instead of | |
541 | gregset_t.) | |
542 | ||
543 | CORE_REG_SECT points to an array of bytes, which are the contents | |
544 | of a `note' from a core file which BFD thinks might contain | |
545 | register contents. CORE_REG_SIZE is its size. | |
546 | ||
547 | WHICH says which register set corelow suspects this is: | |
548 | 0 --- the general-purpose register set, in elf_gregset_t format | |
549 | 2 --- the floating-point register set, in elf_fpregset_t format | |
550 | ||
a4b6fc86 | 551 | REG_ADDR isn't used on GNU/Linux. */ |
f175af98 DJ |
552 | |
553 | static void | |
554 | fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, | |
555 | int which, CORE_ADDR reg_addr) | |
556 | { | |
557 | elf_gregset_t gregset; | |
558 | elf_fpregset_t fpregset; | |
559 | ||
560 | switch (which) | |
561 | { | |
562 | case 0: | |
563 | if (core_reg_size != sizeof (gregset)) | |
564 | warning ("Wrong size gregset in core file."); | |
565 | else | |
566 | { | |
567 | memcpy (&gregset, core_reg_sect, sizeof (gregset)); | |
568 | supply_gregset (&gregset); | |
569 | } | |
570 | break; | |
571 | ||
572 | case 2: | |
573 | if (core_reg_size != sizeof (fpregset)) | |
574 | warning ("Wrong size fpregset in core file."); | |
575 | else | |
576 | { | |
577 | memcpy (&fpregset, core_reg_sect, sizeof (fpregset)); | |
578 | supply_fpregset (&fpregset); | |
579 | } | |
580 | break; | |
581 | ||
582 | default: | |
583 | /* We've covered all the kinds of registers we know about here, | |
584 | so this must be something we wouldn't know what to do with | |
585 | anyway. Just ignore it. */ | |
586 | break; | |
587 | } | |
588 | } | |
c906108c | 589 | \f |
c5aa993b | 590 | |
c906108c | 591 | int |
fba45db2 | 592 | kernel_u_size (void) |
c906108c SS |
593 | { |
594 | return (sizeof (struct user)); | |
595 | } | |
596 | \f | |
a4b6fc86 AC |
597 | /* Register that we are able to handle GNU/Linux ELF core file |
598 | formats. */ | |
f175af98 DJ |
599 | |
600 | static struct core_fns linux_elf_core_fns = | |
601 | { | |
602 | bfd_target_elf_flavour, /* core_flavour */ | |
603 | default_check_format, /* check_format */ | |
604 | default_core_sniffer, /* core_sniffer */ | |
605 | fetch_core_registers, /* core_read_registers */ | |
606 | NULL /* next */ | |
607 | }; | |
608 | ||
609 | void | |
5ae5f592 | 610 | _initialize_m68k_linux_nat (void) |
f175af98 DJ |
611 | { |
612 | add_core_fns (&linux_elf_core_fns); | |
613 | } |