+static struct arm_prologue_cache *
+arm_make_prologue_cache (struct frame_info *next_frame)
+{
+ struct arm_prologue_cache *cache;
+
+ cache = frame_obstack_zalloc (sizeof (struct arm_prologue_cache)
+ + sizeof (CORE_ADDR) * (NUM_REGS + NUM_PSEUDO_REGS - 1));
+
+ cache->unwound_pc = frame_pc_unwind (next_frame);
+ if (frame_relative_level (next_frame) < 0)
+ cache->unwound_sp = deprecated_read_fp ();
+ else
+ cache->unwound_sp = arm_minimal_frame_chain (next_frame, cache);
+ arm_minimal_frame_info (next_frame, cache);
+
+ return cache;
+}
+
+static CORE_ADDR
+arm_frame_chain (struct frame_info *next_frame)
+{
+ struct arm_prologue_cache *cache;
+
+ cache = arm_make_prologue_cache (next_frame);
+ return cache->unwound_sp;
+}
+
+static void
+arm_init_extra_frame_info (int fromleaf, struct frame_info *fi)
+{
+ struct arm_prologue_cache *cache;
+
+ cache = arm_make_prologue_cache (deprecated_get_next_frame_hack (fi));
+
+ if (get_frame_saved_regs (fi) == NULL)
+ frame_saved_regs_zalloc (fi);
+
+ frame_extra_info_zalloc (fi, (sizeof (struct arm_prologue_cache)
+ + ((NUM_REGS + NUM_PSEUDO_REGS - 1)
+ * sizeof (CORE_ADDR))));
+
+ memcpy (get_frame_extra_info (fi), cache, (sizeof (struct arm_prologue_cache)
+ + ((NUM_REGS + NUM_PSEUDO_REGS - 1)
+ * sizeof (CORE_ADDR))));
+ memcpy (get_frame_saved_regs (fi), cache->saved_regs,
+ (NUM_REGS + NUM_PSEUDO_REGS - 1) * sizeof (CORE_ADDR));
+}