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