1 |
26 |
jlechner |
/* SCARTS (32-bit) target-dependent code for the GNU simulator.
|
2 |
|
|
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
3 |
|
|
Free Software Foundation, Inc.
|
4 |
|
|
Contributed by Martin Walter <mwalter@opencores.org>
|
5 |
|
|
|
6 |
|
|
This file is part of the GNU simulators.
|
7 |
|
|
|
8 |
|
|
This program is free software; you can redistribute it and/or modify
|
9 |
|
|
it under the terms of the GNU General Public License as published by
|
10 |
|
|
the Free Software Foundation; either version 3 of the License, or
|
11 |
|
|
(at your option) any later version.
|
12 |
|
|
|
13 |
|
|
This program is distributed in the hope that it will be useful,
|
14 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16 |
|
|
GNU General Public License for more details.
|
17 |
|
|
|
18 |
|
|
You should have received a copy of the GNU General Public License
|
19 |
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
20 |
|
|
|
21 |
|
|
|
22 |
|
|
#ifndef __SCARTS_32_PLUGINS_H__
|
23 |
|
|
#define __SCARTS_32_PLUGINS_H__
|
24 |
|
|
|
25 |
|
|
#include <inttypes.h>
|
26 |
|
|
#include "scarts_32-codemem.h"
|
27 |
|
|
#include "scarts_32-datamem.h"
|
28 |
|
|
|
29 |
|
|
#define SCARTS_MAX_INTERRUPT_NUM 15
|
30 |
|
|
#define SCARTS_MAX_PLUGINS 20
|
31 |
|
|
#define SCARTS_MAX_PLUGIN_NAME_LEN 256
|
32 |
|
|
#define SCARTS_MAX_PLUGIN_PATH_LEN 1024
|
33 |
|
|
|
34 |
|
|
typedef uint8_t* (*scarts_plugin_get_mem) (void);
|
35 |
|
|
typedef void (*scarts_plugin_get_mem_map) (uint32_t *addr, uint32_t *size);
|
36 |
|
|
typedef uint8_t* (*scarts_plugin_get_status_fptr_t) (void);
|
37 |
|
|
typedef int (*scarts_plugin_mem_read_fptr_t) (uint32_t offset, uint8_t *value);
|
38 |
|
|
typedef int (*scarts_plugin_mem_write_fptr_t) (uint32_t offset, uint8_t value);
|
39 |
|
|
typedef void (*scarts_plugin_reset_fptr_t) (void);
|
40 |
|
|
typedef void (*scarts_plugin_set_codemem_read_fptr_t) (scarts_codemem_read_fptr_t codemem_read_fptr);
|
41 |
|
|
typedef void (*scarts_plugin_set_codemem_write_fptr_t) (scarts_codemem_write_fptr_t codemem_write_fptr);
|
42 |
|
|
typedef void (*scarts_plugin_set_datamem_read_fptr_t) (scarts_datamem_read_fptr_t datamem_read_fptr);
|
43 |
|
|
typedef void (*scarts_plugin_set_datamem_write_fptr_t) (scarts_datamem_write_fptr_t datamem_write_fptr);
|
44 |
|
|
typedef void (*scarts_plugin_tick_fptr_t) (uint32_t pc);
|
45 |
|
|
|
46 |
|
|
typedef struct
|
47 |
|
|
{
|
48 |
|
|
void *handle;
|
49 |
|
|
|
50 |
|
|
/* A name for this plugin or NULL if none. */
|
51 |
|
|
char name[SCARTS_MAX_PLUGIN_NAME_LEN];
|
52 |
|
|
|
53 |
|
|
/* The interrupt number for this plugin or -1 if none. */
|
54 |
|
|
int int_num;
|
55 |
|
|
|
56 |
|
|
scarts_plugin_get_mem get_mem;
|
57 |
|
|
scarts_plugin_get_mem_map get_mem_map;
|
58 |
|
|
scarts_plugin_get_status_fptr_t get_status;
|
59 |
|
|
scarts_plugin_mem_read_fptr_t mem_read;
|
60 |
|
|
scarts_plugin_mem_write_fptr_t mem_write;
|
61 |
|
|
scarts_plugin_reset_fptr_t reset;
|
62 |
|
|
scarts_plugin_set_codemem_read_fptr_t set_codemem_read_fptr;
|
63 |
|
|
scarts_plugin_set_codemem_write_fptr_t set_codemem_write_fptr;
|
64 |
|
|
scarts_plugin_set_datamem_read_fptr_t set_datamem_read_fptr;
|
65 |
|
|
scarts_plugin_set_datamem_write_fptr_t set_datamem_write_fptr;
|
66 |
|
|
scarts_plugin_tick_fptr_t tick;
|
67 |
|
|
} scarts_plugin_t;
|
68 |
|
|
|
69 |
|
|
extern scarts_plugin_t* scarts_get_plugin (uint32_t addr);
|
70 |
|
|
extern int scarts_get_plugin_int_request (void);
|
71 |
|
|
extern void scarts_load_plugins (void);
|
72 |
|
|
extern void scarts_reset_plugins (void);
|
73 |
|
|
extern void scarts_tick_plugins (uint32_t *pc);
|
74 |
|
|
|
75 |
|
|
#endif
|