1 /* GNU/Linux/ARM specific low level interface, for the remote server for GDB.
2 Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
3 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
5 This file is part of GDB.
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 3 of the License, or
10 (at your option) any later version.
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.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 #include "linux-low.h"
23 /* Don't include elf.h if linux/elf.h got included by gdb_proc_service.h.
24 On Bionic elf.h and linux/elf.h have conflicting definitions. */
28 #include <sys/ptrace.h>
31 /* Defined in auto-generated files. */
32 void init_registers_arm (void);
33 void init_registers_arm_with_iwmmxt (void);
34 void init_registers_arm_with_vfpv2 (void);
35 void init_registers_arm_with_vfpv3 (void);
36 void init_registers_arm_with_neon (void);
38 #ifndef PTRACE_GET_THREAD_AREA
39 #define PTRACE_GET_THREAD_AREA 22
42 #ifndef PTRACE_GETWMMXREGS
43 # define PTRACE_GETWMMXREGS 18
44 # define PTRACE_SETWMMXREGS 19
47 #ifndef PTRACE_GETVFPREGS
48 # define PTRACE_GETVFPREGS 27
49 # define PTRACE_SETVFPREGS 28
52 #ifndef PTRACE_GETHBPREGS
53 #define PTRACE_GETHBPREGS 29
54 #define PTRACE_SETHBPREGS 30
57 /* Information describing the hardware breakpoint capabilities. */
61 unsigned char max_wp_length
;
62 unsigned char wp_count
;
63 unsigned char bp_count
;
66 /* Enum describing the different types of ARM hardware break-/watch-points. */
75 /* Type describing an ARM Hardware Breakpoint Control register value. */
76 typedef unsigned int arm_hwbp_control_t
;
78 /* Structure used to keep track of hardware break-/watch-points. */
79 struct arm_linux_hw_breakpoint
81 /* Address to break on, or being watched. */
83 /* Control register for break-/watch- point. */
84 arm_hwbp_control_t control
;
87 /* Since we cannot dynamically allocate subfields of arch_process_info,
88 assume a maximum number of supported break-/watchpoints. */
92 /* Per-process arch-specific data we want to keep. */
93 struct arch_process_info
95 /* Hardware breakpoints for this process. */
96 struct arm_linux_hw_breakpoint bpts
[MAX_BPTS
];
97 /* Hardware watchpoints for this process. */
98 struct arm_linux_hw_breakpoint wpts
[MAX_WPTS
];
101 /* Per-thread arch-specific data we want to keep. */
104 /* Non-zero if our copy differs from what's recorded in the thread. */
105 char bpts_changed
[MAX_BPTS
];
106 char wpts_changed
[MAX_WPTS
];
107 /* Cached stopped data address. */
108 CORE_ADDR stopped_data_address
;
111 static unsigned long arm_hwcap
;
113 /* These are in <asm/elf.h> in current kernels. */
115 #define HWCAP_IWMMXT 512
116 #define HWCAP_NEON 4096
117 #define HWCAP_VFPv3 8192
118 #define HWCAP_VFPv3D16 16384
120 #ifdef HAVE_SYS_REG_H
124 #define arm_num_regs 26
126 static int arm_regmap
[] = {
127 0, 4, 8, 12, 16, 20, 24, 28,
128 32, 36, 40, 44, 48, 52, 56, 60,
129 -1, -1, -1, -1, -1, -1, -1, -1, -1,
134 arm_cannot_store_register (int regno
)
136 return (regno
>= arm_num_regs
);
140 arm_cannot_fetch_register (int regno
)
142 return (regno
>= arm_num_regs
);
146 arm_fill_gregset (struct regcache
*regcache
, void *buf
)
150 for (i
= 0; i
< arm_num_regs
; i
++)
151 if (arm_regmap
[i
] != -1)
152 collect_register (regcache
, i
, ((char *) buf
) + arm_regmap
[i
]);
156 arm_store_gregset (struct regcache
*regcache
, const void *buf
)
161 memset (zerobuf
, 0, 8);
162 for (i
= 0; i
< arm_num_regs
; i
++)
163 if (arm_regmap
[i
] != -1)
164 supply_register (regcache
, i
, ((char *) buf
) + arm_regmap
[i
]);
166 supply_register (regcache
, i
, zerobuf
);
170 arm_fill_wmmxregset (struct regcache
*regcache
, void *buf
)
174 if (!(arm_hwcap
& HWCAP_IWMMXT
))
177 for (i
= 0; i
< 16; i
++)
178 collect_register (regcache
, arm_num_regs
+ i
, (char *) buf
+ i
* 8);
180 /* We only have access to wcssf, wcasf, and wcgr0-wcgr3. */
181 for (i
= 0; i
< 6; i
++)
182 collect_register (regcache
, arm_num_regs
+ i
+ 16,
183 (char *) buf
+ 16 * 8 + i
* 4);
187 arm_store_wmmxregset (struct regcache
*regcache
, const void *buf
)
191 if (!(arm_hwcap
& HWCAP_IWMMXT
))
194 for (i
= 0; i
< 16; i
++)
195 supply_register (regcache
, arm_num_regs
+ i
, (char *) buf
+ i
* 8);
197 /* We only have access to wcssf, wcasf, and wcgr0-wcgr3. */
198 for (i
= 0; i
< 6; i
++)
199 supply_register (regcache
, arm_num_regs
+ i
+ 16,
200 (char *) buf
+ 16 * 8 + i
* 4);
204 arm_fill_vfpregset (struct regcache
*regcache
, void *buf
)
208 if (!(arm_hwcap
& HWCAP_VFP
))
211 if ((arm_hwcap
& (HWCAP_VFPv3
| HWCAP_VFPv3D16
)) == HWCAP_VFPv3
)
216 base
= find_regno ("d0");
217 for (i
= 0; i
< num
; i
++)
218 collect_register (regcache
, base
+ i
, (char *) buf
+ i
* 8);
220 collect_register_by_name (regcache
, "fpscr", (char *) buf
+ 32 * 8);
224 arm_store_vfpregset (struct regcache
*regcache
, const void *buf
)
228 if (!(arm_hwcap
& HWCAP_VFP
))
231 if ((arm_hwcap
& (HWCAP_VFPv3
| HWCAP_VFPv3D16
)) == HWCAP_VFPv3
)
236 base
= find_regno ("d0");
237 for (i
= 0; i
< num
; i
++)
238 supply_register (regcache
, base
+ i
, (char *) buf
+ i
* 8);
240 supply_register_by_name (regcache
, "fpscr", (char *) buf
+ 32 * 8);
243 extern int debug_threads
;
246 arm_get_pc (struct regcache
*regcache
)
249 collect_register_by_name (regcache
, "pc", &pc
);
251 fprintf (stderr
, "stop pc is %08lx\n", pc
);
256 arm_set_pc (struct regcache
*regcache
, CORE_ADDR pc
)
258 unsigned long newpc
= pc
;
259 supply_register_by_name (regcache
, "pc", &newpc
);
262 /* Correct in either endianness. */
263 static const unsigned long arm_breakpoint
= 0xef9f0001;
264 #define arm_breakpoint_len 4
265 static const unsigned short thumb_breakpoint
= 0xde01;
266 static const unsigned short thumb2_breakpoint
[] = { 0xf7f0, 0xa000 };
268 /* For new EABI binaries. We recognize it regardless of which ABI
269 is used for gdbserver, so single threaded debugging should work
270 OK, but for multi-threaded debugging we only insert the current
271 ABI's breakpoint instruction. For now at least. */
272 static const unsigned long arm_eabi_breakpoint
= 0xe7f001f0;
275 arm_breakpoint_at (CORE_ADDR where
)
277 struct regcache
*regcache
= get_thread_regcache (current_inferior
, 1);
280 collect_register_by_name (regcache
, "cpsr", &cpsr
);
287 (*the_target
->read_memory
) (where
, (unsigned char *) &insn
, 2);
288 if (insn
== thumb_breakpoint
)
291 if (insn
== thumb2_breakpoint
[0])
293 (*the_target
->read_memory
) (where
+ 2, (unsigned char *) &insn
, 2);
294 if (insn
== thumb2_breakpoint
[1])
303 (*the_target
->read_memory
) (where
, (unsigned char *) &insn
, 4);
304 if (insn
== arm_breakpoint
)
307 if (insn
== arm_eabi_breakpoint
)
314 /* We only place breakpoints in empty marker functions, and thread locking
315 is outside of the function. So rather than importing software single-step,
316 we can just run until exit. */
318 arm_reinsert_addr (void)
320 struct regcache
*regcache
= get_thread_regcache (current_inferior
, 1);
322 collect_register_by_name (regcache
, "lr", &pc
);
326 /* Fetch the thread-local storage pointer for libthread_db. */
329 ps_get_thread_area (const struct ps_prochandle
*ph
,
330 lwpid_t lwpid
, int idx
, void **base
)
332 if (ptrace (PTRACE_GET_THREAD_AREA
, lwpid
, NULL
, base
) != 0)
335 /* IDX is the bias from the thread pointer to the beginning of the
336 thread descriptor. It has to be subtracted due to implementation
337 quirks in libthread_db. */
338 *base
= (void *) ((char *)*base
- idx
);
344 /* Query Hardware Breakpoint information for the target we are attached to
345 (using PID as ptrace argument) and set up arm_linux_hwbp_cap. */
347 arm_linux_init_hwbp_cap (int pid
)
351 if (ptrace (PTRACE_GETHBPREGS
, pid
, 0, &val
) < 0)
354 arm_linux_hwbp_cap
.arch
= (unsigned char)((val
>> 24) & 0xff);
355 if (arm_linux_hwbp_cap
.arch
== 0)
358 arm_linux_hwbp_cap
.max_wp_length
= (unsigned char)((val
>> 16) & 0xff);
359 arm_linux_hwbp_cap
.wp_count
= (unsigned char)((val
>> 8) & 0xff);
360 arm_linux_hwbp_cap
.bp_count
= (unsigned char)(val
& 0xff);
362 if (arm_linux_hwbp_cap
.wp_count
> MAX_WPTS
)
363 internal_error (__FILE__
, __LINE__
, "Unsupported number of watchpoints");
364 if (arm_linux_hwbp_cap
.bp_count
> MAX_BPTS
)
365 internal_error (__FILE__
, __LINE__
, "Unsupported number of breakpoints");
368 /* How many hardware breakpoints are available? */
370 arm_linux_get_hw_breakpoint_count (void)
372 return arm_linux_hwbp_cap
.bp_count
;
375 /* How many hardware watchpoints are available? */
377 arm_linux_get_hw_watchpoint_count (void)
379 return arm_linux_hwbp_cap
.wp_count
;
382 /* Maximum length of area watched by hardware watchpoint. */
384 arm_linux_get_hw_watchpoint_max_length (void)
386 return arm_linux_hwbp_cap
.max_wp_length
;
389 /* Initialize an ARM hardware break-/watch-point control register value.
390 BYTE_ADDRESS_SELECT is the mask of bytes to trigger on; HWBP_TYPE is the
391 type of break-/watch-point; ENABLE indicates whether the point is enabled.
393 static arm_hwbp_control_t
394 arm_hwbp_control_initialize (unsigned byte_address_select
,
395 arm_hwbp_type hwbp_type
,
398 gdb_assert ((byte_address_select
& ~0xffU
) == 0);
399 gdb_assert (hwbp_type
!= arm_hwbp_break
400 || ((byte_address_select
& 0xfU
) != 0));
402 return (byte_address_select
<< 5) | (hwbp_type
<< 3) | (3 << 1) | enable
;
405 /* Does the breakpoint control value CONTROL have the enable bit set? */
407 arm_hwbp_control_is_enabled (arm_hwbp_control_t control
)
409 return control
& 0x1;
412 /* Is the breakpoint control value CONTROL initialized? */
414 arm_hwbp_control_is_initialized (arm_hwbp_control_t control
)
419 /* Change a breakpoint control word so that it is in the disabled state. */
420 static arm_hwbp_control_t
421 arm_hwbp_control_disable (arm_hwbp_control_t control
)
423 return control
& ~0x1;
426 /* Are two break-/watch-points equal? */
428 arm_linux_hw_breakpoint_equal (const struct arm_linux_hw_breakpoint
*p1
,
429 const struct arm_linux_hw_breakpoint
*p2
)
431 return p1
->address
== p2
->address
&& p1
->control
== p2
->control
;
434 /* Initialize the hardware breakpoint structure P for a breakpoint or
435 watchpoint at ADDR to LEN. The type of watchpoint is given in TYPE.
436 Returns -1 if TYPE is unsupported, 0 if TYPE represents a breakpoint,
437 and 1 if type represents a watchpoint. */
439 arm_linux_hw_point_initialize (char type
, CORE_ADDR addr
, int len
,
440 struct arm_linux_hw_breakpoint
*p
)
442 arm_hwbp_type hwbp_type
;
445 /* Breakpoint/watchpoint types (GDB terminology):
446 0 = memory breakpoint for instructions
447 (not supported; done via memory write instead)
448 1 = hardware breakpoint for instructions (supported)
449 2 = write watchpoint (supported)
450 3 = read watchpoint (supported)
451 4 = access watchpoint (supported). */
455 hwbp_type
= arm_hwbp_break
;
458 hwbp_type
= arm_hwbp_store
;
461 hwbp_type
= arm_hwbp_load
;
464 hwbp_type
= arm_hwbp_access
;
471 if (hwbp_type
== arm_hwbp_break
)
473 /* For breakpoints, the length field encodes the mode. */
476 case 2: /* 16-bit Thumb mode breakpoint */
477 case 3: /* 32-bit Thumb mode breakpoint */
478 mask
= 0x3 << (addr
& 2);
480 case 4: /* 32-bit ARM mode breakpoint */
492 CORE_ADDR max_wp_length
= arm_linux_get_hw_watchpoint_max_length ();
493 CORE_ADDR aligned_addr
;
495 /* Can not set watchpoints for zero or negative lengths. */
498 /* The current ptrace interface can only handle watchpoints that are a
500 if ((len
& (len
- 1)) != 0)
503 /* Test that the range [ADDR, ADDR + LEN) fits into the largest address
504 range covered by a watchpoint. */
505 aligned_addr
= addr
& ~(max_wp_length
- 1);
506 if (aligned_addr
+ max_wp_length
< addr
+ len
)
509 mask
= (1 << len
) - 1;
512 p
->address
= (unsigned int) addr
;
513 p
->control
= arm_hwbp_control_initialize (mask
, hwbp_type
, 1);
515 return hwbp_type
!= arm_hwbp_break
;
518 /* Callback to mark a watch-/breakpoint to be updated in all threads of
519 the current process. */
521 struct update_registers_data
528 update_registers_callback (struct inferior_list_entry
*entry
, void *arg
)
530 struct lwp_info
*lwp
= (struct lwp_info
*) entry
;
531 struct update_registers_data
*data
= (struct update_registers_data
*) arg
;
533 /* Only update the threads of the current process. */
534 if (pid_of (lwp
) == pid_of (get_thread_lwp (current_inferior
)))
536 /* The actual update is done later just before resuming the lwp,
537 we just mark that the registers need updating. */
539 lwp
->arch_private
->wpts_changed
[data
->i
] = 1;
541 lwp
->arch_private
->bpts_changed
[data
->i
] = 1;
543 /* If the lwp isn't stopped, force it to momentarily pause, so
544 we can update its breakpoint registers. */
546 linux_stop_lwp (lwp
);
552 /* Insert hardware break-/watchpoint. */
554 arm_insert_point (char type
, CORE_ADDR addr
, int len
)
556 struct process_info
*proc
= current_process ();
557 struct arm_linux_hw_breakpoint p
, *pts
;
560 watch
= arm_linux_hw_point_initialize (type
, addr
, len
, &p
);
569 count
= arm_linux_get_hw_watchpoint_count ();
570 pts
= proc
->private->arch_private
->wpts
;
574 count
= arm_linux_get_hw_breakpoint_count ();
575 pts
= proc
->private->arch_private
->bpts
;
578 for (i
= 0; i
< count
; i
++)
579 if (!arm_hwbp_control_is_enabled (pts
[i
].control
))
581 struct update_registers_data data
= { watch
, i
};
583 find_inferior (&all_lwps
, update_registers_callback
, &data
);
587 /* We're out of watchpoints. */
591 /* Remove hardware break-/watchpoint. */
593 arm_remove_point (char type
, CORE_ADDR addr
, int len
)
595 struct process_info
*proc
= current_process ();
596 struct arm_linux_hw_breakpoint p
, *pts
;
599 watch
= arm_linux_hw_point_initialize (type
, addr
, len
, &p
);
608 count
= arm_linux_get_hw_watchpoint_count ();
609 pts
= proc
->private->arch_private
->wpts
;
613 count
= arm_linux_get_hw_breakpoint_count ();
614 pts
= proc
->private->arch_private
->bpts
;
617 for (i
= 0; i
< count
; i
++)
618 if (arm_linux_hw_breakpoint_equal (&p
, pts
+ i
))
620 struct update_registers_data data
= { watch
, i
};
621 pts
[i
].control
= arm_hwbp_control_disable (pts
[i
].control
);
622 find_inferior (&all_lwps
, update_registers_callback
, &data
);
626 /* No watchpoint matched. */
630 /* Return whether current thread is stopped due to a watchpoint. */
632 arm_stopped_by_watchpoint (void)
634 struct lwp_info
*lwp
= get_thread_lwp (current_inferior
);
635 struct siginfo siginfo
;
637 /* We must be able to set hardware watchpoints. */
638 if (arm_linux_get_hw_watchpoint_count () == 0)
641 /* Retrieve siginfo. */
643 ptrace (PTRACE_GETSIGINFO
, lwpid_of (lwp
), 0, &siginfo
);
647 /* This must be a hardware breakpoint. */
648 if (siginfo
.si_signo
!= SIGTRAP
649 || (siginfo
.si_code
& 0xffff) != 0x0004 /* TRAP_HWBKPT */)
652 /* If we are in a positive slot then we're looking at a breakpoint and not
654 if (siginfo
.si_errno
>= 0)
657 /* Cache stopped data address for use by arm_stopped_data_address. */
658 lwp
->arch_private
->stopped_data_address
659 = (CORE_ADDR
) (uintptr_t) siginfo
.si_addr
;
664 /* Return data address that triggered watchpoint. Called only if
665 arm_stopped_by_watchpoint returned true. */
667 arm_stopped_data_address (void)
669 struct lwp_info
*lwp
= get_thread_lwp (current_inferior
);
670 return lwp
->arch_private
->stopped_data_address
;
673 /* Called when a new process is created. */
674 static struct arch_process_info
*
675 arm_new_process (void)
677 struct arch_process_info
*info
= xcalloc (1, sizeof (*info
));
681 /* Called when a new thread is detected. */
682 static struct arch_lwp_info
*
683 arm_new_thread (void)
685 struct arch_lwp_info
*info
= xcalloc (1, sizeof (*info
));
688 for (i
= 0; i
< MAX_BPTS
; i
++)
689 info
->bpts_changed
[i
] = 1;
690 for (i
= 0; i
< MAX_WPTS
; i
++)
691 info
->wpts_changed
[i
] = 1;
696 /* Called when resuming a thread.
697 If the debug regs have changed, update the thread's copies. */
699 arm_prepare_to_resume (struct lwp_info
*lwp
)
701 int pid
= lwpid_of (lwp
);
702 struct process_info
*proc
= find_process_pid (pid_of (lwp
));
703 struct arch_process_info
*proc_info
= proc
->private->arch_private
;
704 struct arch_lwp_info
*lwp_info
= lwp
->arch_private
;
707 for (i
= 0; i
< arm_linux_get_hw_breakpoint_count (); i
++)
708 if (lwp_info
->bpts_changed
[i
])
712 if (arm_hwbp_control_is_enabled (proc_info
->bpts
[i
].control
))
713 if (ptrace (PTRACE_SETHBPREGS
, pid
, ((i
<< 1) + 1),
714 &proc_info
->bpts
[i
].address
) < 0)
715 perror_with_name ("Unexpected error setting breakpoint address");
717 if (arm_hwbp_control_is_initialized (proc_info
->bpts
[i
].control
))
718 if (ptrace (PTRACE_SETHBPREGS
, pid
, ((i
<< 1) + 2),
719 &proc_info
->bpts
[i
].control
) < 0)
720 perror_with_name ("Unexpected error setting breakpoint");
722 lwp_info
->bpts_changed
[i
] = 0;
725 for (i
= 0; i
< arm_linux_get_hw_watchpoint_count (); i
++)
726 if (lwp_info
->wpts_changed
[i
])
730 if (arm_hwbp_control_is_enabled (proc_info
->wpts
[i
].control
))
731 if (ptrace (PTRACE_SETHBPREGS
, pid
, -((i
<< 1) + 1),
732 &proc_info
->wpts
[i
].address
) < 0)
733 perror_with_name ("Unexpected error setting watchpoint address");
735 if (arm_hwbp_control_is_initialized (proc_info
->wpts
[i
].control
))
736 if (ptrace (PTRACE_SETHBPREGS
, pid
, -((i
<< 1) + 2),
737 &proc_info
->wpts
[i
].control
) < 0)
738 perror_with_name ("Unexpected error setting watchpoint");
740 lwp_info
->wpts_changed
[i
] = 0;
746 arm_get_hwcap (unsigned long *valp
)
748 unsigned char *data
= alloca (8);
751 while ((*the_target
->read_auxv
) (offset
, data
, 8) == 8)
753 unsigned int *data_p
= (unsigned int *)data
;
754 if (data_p
[0] == AT_HWCAP
)
768 arm_arch_setup (void)
770 int pid
= lwpid_of (get_thread_lwp (current_inferior
));
772 /* Query hardware watchpoint/breakpoint capabilities. */
773 arm_linux_init_hwbp_cap (pid
);
776 if (arm_get_hwcap (&arm_hwcap
) == 0)
778 init_registers_arm ();
782 if (arm_hwcap
& HWCAP_IWMMXT
)
784 init_registers_arm_with_iwmmxt ();
788 if (arm_hwcap
& HWCAP_VFP
)
792 /* NEON implies either no VFP, or VFPv3-D32. We only support
794 if (arm_hwcap
& HWCAP_NEON
)
795 init_registers_arm_with_neon ();
796 else if ((arm_hwcap
& (HWCAP_VFPv3
| HWCAP_VFPv3D16
)) == HWCAP_VFPv3
)
797 init_registers_arm_with_vfpv3 ();
799 init_registers_arm_with_vfpv2 ();
801 /* Now make sure that the kernel supports reading these
802 registers. Support was added in 2.6.30. */
804 buf
= xmalloc (32 * 8 + 4);
805 if (ptrace (PTRACE_GETVFPREGS
, pid
, 0, buf
) < 0
809 init_registers_arm ();
816 /* The default configuration uses legacy FPA registers, probably
818 init_registers_arm ();
821 struct regset_info target_regsets
[] = {
822 { PTRACE_GETREGS
, PTRACE_SETREGS
, 0, 18 * 4,
824 arm_fill_gregset
, arm_store_gregset
},
825 { PTRACE_GETWMMXREGS
, PTRACE_SETWMMXREGS
, 0, 16 * 8 + 6 * 4,
827 arm_fill_wmmxregset
, arm_store_wmmxregset
},
828 { PTRACE_GETVFPREGS
, PTRACE_SETVFPREGS
, 0, 32 * 8 + 4,
830 arm_fill_vfpregset
, arm_store_vfpregset
},
831 { 0, 0, 0, -1, -1, NULL
, NULL
}
834 struct linux_target_ops the_low_target
= {
838 arm_cannot_fetch_register
,
839 arm_cannot_store_register
,
843 /* Define an ARM-mode breakpoint; we only set breakpoints in the C
844 library, which is most likely to be ARM. If the kernel supports
845 clone events, we will never insert a breakpoint, so even a Thumb
846 C library will work; so will mixing EABI/non-EABI gdbserver and
849 (const unsigned char *) &arm_breakpoint
,
851 (const unsigned char *) &arm_eabi_breakpoint
,
859 arm_stopped_by_watchpoint
,
860 arm_stopped_data_address
,
861 NULL
, /* collect_ptrace_register */
862 NULL
, /* supply_ptrace_register */
863 NULL
, /* siginfo_fixup */
866 arm_prepare_to_resume
,