+/**
+ * Get the between type for that call.
+ * @param self The callback object.
+ * @return The between type of for that call.
+ */
+static ir_type *TEMPLATE_get_between_type(void *self)
+{
+ static ir_type *between_type = NULL;
+ static ir_entity *old_bp_ent = NULL;
+ (void) self;
+
+ if(!between_type) {
+ ir_entity *ret_addr_ent;
+ ir_type *ret_addr_type = new_type_primitive(new_id_from_str("return_addr"), mode_P);
+ ir_type *old_bp_type = new_type_primitive(new_id_from_str("bp"), mode_P);
+
+ between_type = new_type_class(new_id_from_str("TEMPLATE_between_type"));
+ old_bp_ent = new_entity(between_type, new_id_from_str("old_bp"), old_bp_type);
+ ret_addr_ent = new_entity(between_type, new_id_from_str("old_bp"), ret_addr_type);
+
+ set_entity_offset(old_bp_ent, 0);
+ set_entity_offset(ret_addr_ent, get_type_size_bytes(old_bp_type));
+ set_type_size_bytes(between_type, get_type_size_bytes(old_bp_type) + get_type_size_bytes(ret_addr_type));
+ }
+
+ return between_type;
+}
+
+static void TEMPLATE_abi_dont_save_regs(void *self, pset *s)
+{
+ TEMPLATE_abi_env_t *env = self;
+ if (env->flags.try_omit_fp) {
+ /* insert the BP register into the ignore set */
+ pset_insert_ptr(s, env->arch_env->bp);
+ }
+}
+
+/**
+ * Build the prolog, return the BASE POINTER register
+ */
+static const arch_register_t *TEMPLATE_abi_prologue(void *self, ir_node **mem,
+ pmap *reg_map, int *stack_bias)
+{
+ TEMPLATE_abi_env_t *env = self;
+ (void) reg_map;
+ (void) mem;
+ (void) stack_bias;
+
+ if(env->flags.try_omit_fp)
+ return env->arch_env->sp;
+ return env->arch_env->bp;
+}
+
+/* Build the epilog */
+static void TEMPLATE_abi_epilogue(void *self, ir_node *bl, ir_node **mem,
+ pmap *reg_map)
+{
+ (void) self;
+ (void) bl;
+ (void) mem;
+ (void) reg_map;
+}
+
+static const be_abi_callbacks_t TEMPLATE_abi_callbacks = {
+ TEMPLATE_abi_init,
+ free,
+ TEMPLATE_get_between_type,
+ TEMPLATE_abi_dont_save_regs,
+ TEMPLATE_abi_prologue,
+ TEMPLATE_abi_epilogue,