Mercurial > repos > blastem
comparison backend.h @ 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 | dc9f178085a0 |
children | 8e395210f50f |
comparison
equal
deleted
inserted
replaced
558:dc9f178085a0 | 563:c8fefa140c80 |
---|---|
6 #ifndef BACKEND_H_ | 6 #ifndef BACKEND_H_ |
7 #define BACKEND_H_ | 7 #define BACKEND_H_ |
8 | 8 |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <stdio.h> | 10 #include <stdio.h> |
11 #include "gen.h" | |
11 | 12 |
12 #define INVALID_OFFSET 0xFFFFFFFF | 13 #define INVALID_OFFSET 0xFFFFFFFF |
13 #define EXTENSION_WORD 0xFFFFFFFE | 14 #define EXTENSION_WORD 0xFFFFFFFE |
14 | 15 |
15 typedef struct { | 16 typedef struct { |
17 uint8_t mode; | 18 uint8_t mode; |
18 uint8_t base; | 19 uint8_t base; |
19 uint8_t index; | 20 uint8_t index; |
20 uint8_t cycles; | 21 uint8_t cycles; |
21 } x86_ea; | 22 } x86_ea; |
22 | |
23 #if defined(X86_64) || defined(X86_32) | |
24 typedef uint8_t* code_ptr; | |
25 #else | |
26 typedef uint32_t* code_ptr; | |
27 #endif | |
28 | 23 |
29 typedef struct { | 24 typedef struct { |
30 uint8_t *base; | 25 uint8_t *base; |
31 int32_t *offsets; | 26 int32_t *offsets; |
32 } native_map_slot; | 27 } native_map_slot; |
54 code_ptr save_context; | 49 code_ptr save_context; |
55 code_ptr load_context; | 50 code_ptr load_context; |
56 code_ptr handle_cycle_limit; | 51 code_ptr handle_cycle_limit; |
57 code_ptr handle_cycle_limit_int; | 52 code_ptr handle_cycle_limit_int; |
58 uint8_t context_reg; | 53 uint8_t context_reg; |
54 uint8_t cycles; | |
55 uint8_t limit; | |
59 uint8_t scratch1; | 56 uint8_t scratch1; |
60 uint8_t scratch2; | 57 uint8_t scratch2; |
61 } cpu_options; | 58 } cpu_options; |
62 | 59 |
63 | 60 |