1 |
1748 |
jeremybenn |
/* dyn-rec.h -- Recompiler specific definitions
|
2 |
|
|
Copyright (C) 2005 György `nog' Jeney, nog@sdf.lonestar.org
|
3 |
|
|
|
4 |
|
|
This file is part of OpenRISC 1000 Architectural Simulator.
|
5 |
|
|
|
6 |
|
|
This program is free software; you can redistribute it and/or modify
|
7 |
|
|
it under the terms of the GNU General Public License as published by
|
8 |
|
|
the Free Software Foundation; either version 2 of the License, or
|
9 |
|
|
(at your option) any later version.
|
10 |
|
|
|
11 |
|
|
This program is distributed in the hope that it will be useful,
|
12 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
|
|
GNU General Public License for more details.
|
15 |
|
|
|
16 |
|
|
You should have received a copy of the GNU General Public License
|
17 |
|
|
along with this program; if not, write to the Free Software
|
18 |
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
19 |
|
|
|
20 |
|
|
|
21 |
|
|
#ifndef DYN_REC_H
|
22 |
|
|
#define DYN_REC_H
|
23 |
|
|
|
24 |
|
|
typedef void (*gen_code_ent)(void);
|
25 |
|
|
|
26 |
|
|
/* Each dynamically recompiled page has one of these */
|
27 |
|
|
struct dyn_page {
|
28 |
|
|
oraddr_t or_page;
|
29 |
|
|
void *host_page;
|
30 |
|
|
unsigned int host_len;
|
31 |
|
|
int dirty; /* Is recompiled page invalid? */
|
32 |
|
|
int delayr; /* delayr of memory backing this page */
|
33 |
|
|
uint16_t ts_bound[2049]; /* What registers the temporaries back (on the
|
34 |
|
|
* begining boundry of the instruction) */
|
35 |
|
|
void **locs; /* Openrisc locations in the recompiled code */
|
36 |
|
|
uint32_t *insns; /* Copy of instructions on this page */
|
37 |
|
|
unsigned int *insn_indexs; /* Decoded instructions on this page */
|
38 |
|
|
};
|
39 |
|
|
|
40 |
|
|
void recompile_page(struct dyn_page *dyn);
|
41 |
|
|
struct dyn_page *new_dp(oraddr_t page);
|
42 |
|
|
void add_to_opq(struct op_queue *opq, int end, int op);
|
43 |
|
|
void add_to_op_params(struct op_queue *opq, int end, unsigned long param);
|
44 |
|
|
void *enough_host_page(struct dyn_page *dp, void *cur, unsigned int *len,
|
45 |
|
|
unsigned int amount);
|
46 |
|
|
void init_dyn_recomp(void);
|
47 |
|
|
void run_sched_out_of_line(void);
|
48 |
|
|
void recheck_immu(int got_en_dis);
|
49 |
|
|
void enter_dyn_code(oraddr_t addr, struct dyn_page *dp);
|
50 |
|
|
void dyn_checkwrite(oraddr_t addr);
|
51 |
|
|
void dyn_main(void);
|
52 |
|
|
|
53 |
|
|
extern void *rec_stack_base;
|
54 |
|
|
|
55 |
|
|
#define IMMU_GOT_ENABLED 1
|
56 |
|
|
#define IMMU_GOT_DISABLED 2
|
57 |
|
|
|
58 |
|
|
#define xglue(x, y) x ## y
|
59 |
|
|
#define glue(x, y) xglue(x, y)
|
60 |
|
|
|
61 |
|
|
#endif
|