view gen.c @ 563:c8fefa140c80

Moved some generic stuff from backend.h gen_arm.h and gen_arm.c into gen.h and gen.c. Added a couple fields to cpu_options so that gen_mem_fun can be made guest CPU generic
author Michael Pavone <pavone@retrodev.com>
date Mon, 24 Feb 2014 09:55:24 -0800
parents
children 724bbec47f86
line wrap: on
line source

#include <stdio.h>
#include <stdlib.h>
#include "gen.h"
#include "mem.h"

void init_code_info(code_info *code)
{
	size_t size = CODE_ALLOC_SIZE;
	code->cur = alloc_code(&size);
	if (!code->cur) {
		fputs("Failed to allocate memory for generated code\n", stderr);
		exit(1);
	}
	code->last = code->cur + size/sizeof(code_word) - RESERVE_WORDS;
}