forked from PicoPET/thumbulator-stm32f0x
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrsp-server.h
75 lines (59 loc) · 2.45 KB
/
rsp-server.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/* rsp-server.c -- Remote Serial Protocol server for GDB
Copyright (C) 2008 Embecosm Limited
Contributor Jeremy Bennett <[email protected]>
This file is part of Or1ksim, the OpenRISC 1000 Architectural Simulator.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your option)
any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>. */
/* This program is commented throughout in a fashion suitable for processing
with Doxygen. */
#ifndef RSP_SERVER__H
#define RSP_SERVER__H
/*! Size of the matchpoint hash table. Largest prime < 2^10 */
#define MP_HASH_SIZE 1021
/* Function prototypes for external use */
void rsp_init ();
void handle_rsp ();
void rsp_exception (unsigned long int except);
void rsp_trap();
void rsp_check_stall();
void rsp_check_watch(unsigned int addr);
/*! Enumeration of different types of matchpoint. These have explicit values
matching the second digit of 'z' and 'Z' packets. */
enum mp_type {
BP_MEMORY = 0,
BP_HARDWARE = 1,
WP_WRITE = 2,
WP_READ = 3,
WP_ACCESS = 4
};
/*! Data structure for a matchpoint hash table entry */
struct mp_entry
{
enum mp_type type; /*!< Type of matchpoint */
unsigned long int addr; /*!< Address with the matchpoint */
unsigned long int instr; /*!< Substituted instruction */
struct mp_entry *next; /*!< Next entry with this hash */
};
/*! Central data for the RSP connection */
struct RSP
{
int client_waiting; /*!< Is client waiting a response? */
int proto_num; /*!< Number of the protocol used */
int client_fd; /*!< FD for talking to GDB */
int sigval; /*!< GDB signal for any exception */
unsigned long int start_addr; /*!< Start of last run */
struct mp_entry *mp_hash[MP_HASH_SIZE]; /*!< Matchpoint hash table */
unsigned int port;
int stalled;
int stepping;
};
extern struct RSP rsp;
#endif /* RSP_SERVER__H */