+m68hc11_frame_this_id (struct frame_info *this_frame,
+ void **this_prologue_cache,
+ struct frame_id *this_id)
+{
+ struct m68hc11_unwind_cache *info
+ = m68hc11_frame_unwind_cache (this_frame, this_prologue_cache);
+ CORE_ADDR base;
+ CORE_ADDR func;
+ struct frame_id id;
+
+ /* The FUNC is easy. */
+ func = get_frame_func (this_frame);
+
+ /* Hopefully the prologue analysis either correctly determined the
+ frame's base (which is the SP from the previous frame), or set
+ that base to "NULL". */
+ base = info->prev_sp;
+ if (base == 0)
+ return;
+
+ id = frame_id_build (base, func);
+ (*this_id) = id;
+}
+
+static struct value *
+m68hc11_frame_prev_register (struct frame_info *this_frame,
+ void **this_prologue_cache, int regnum)
+{
+ struct value *value;
+ struct m68hc11_unwind_cache *info
+ = m68hc11_frame_unwind_cache (this_frame, this_prologue_cache);
+
+ value = trad_frame_get_prev_register (this_frame, info->saved_regs, regnum);
+
+ /* Take into account the 68HC12 specific call (PC + page). */
+ if (regnum == HARD_PC_REGNUM
+ && info->return_kind == RETURN_RTC
+ && USE_PAGE_REGISTER (get_frame_arch (this_frame)))
+ {
+ CORE_ADDR pc = value_as_long (value);
+ if (pc >= 0x08000 && pc < 0x0c000)
+ {
+ CORE_ADDR page;
+
+ release_value (value);
+ value_free (value);
+
+ value = trad_frame_get_prev_register (this_frame, info->saved_regs,
+ HARD_PAGE_REGNUM);
+ page = value_as_long (value);
+ release_value (value);
+ value_free (value);
+
+ pc -= 0x08000;
+ pc += ((page & 0x0ff) << 14);
+ pc += 0x1000000;
+
+ return frame_unwind_got_constant (this_frame, regnum, pc);
+ }
+ }
+
+ return value;
+}
+
+static const struct frame_unwind m68hc11_frame_unwind = {
+ NORMAL_FRAME,
+ default_frame_unwind_stop_reason,
+ m68hc11_frame_this_id,
+ m68hc11_frame_prev_register,
+ NULL,
+ default_frame_sniffer
+};
+
+static CORE_ADDR
+m68hc11_frame_base_address (struct frame_info *this_frame, void **this_cache)
+{
+ struct m68hc11_unwind_cache *info
+ = m68hc11_frame_unwind_cache (this_frame, this_cache);
+
+ return info->base;
+}
+
+static CORE_ADDR
+m68hc11_frame_args_address (struct frame_info *this_frame, void **this_cache)