gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git] / sim / common / dv-sockser.h
CommitLineData
c906108c 1/* Serial port emulation via sockets.
b811d2c2 2 Copyright (C) 1998-2020 Free Software Foundation, Inc.
c906108c
SS
3
4This file is part of the GNU simulators.
5
6This program is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
4744ac1b
JB
8the Free Software Foundation; either version 3 of the License, or
9(at your option) any later version.
c906108c
SS
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
4744ac1b
JB
16You should have received a copy of the GNU General Public License
17along with this program. If not, see <http://www.gnu.org/licenses/>. */
c906108c
SS
18
19#ifndef DV_SOCKSER_H
20#define DV_SOCKSER_H
21
3649cb06
MF
22#include "sim-inline.h"
23
c906108c 24/* bits in result of dev_sockser_status */
e8a76151
MF
25#define DV_SOCKSER_INPUT_EMPTY 0x1
26#define DV_SOCKSER_OUTPUT_EMPTY 0x2
27#define DV_SOCKSER_DISCONNECTED 0x4
c906108c 28
3649cb06
MF
29#ifdef HAVE_DV_SOCKSER
30
c906108c
SS
31/* FIXME: later add a device ptr arg */
32extern int dv_sockser_status (SIM_DESC);
33int dv_sockser_write (SIM_DESC, unsigned char);
6ab5626b 34int dv_sockser_write_buffer (SIM_DESC, const unsigned char *, unsigned);
c906108c
SS
35int dv_sockser_read (SIM_DESC);
36
8406bb59
MF
37SIM_RC dv_sockser_install (SIM_DESC);
38
3649cb06
MF
39#else
40
41/* If dv-sockser isn't available, provide stub functions. */
42
43STATIC_INLINE int
44dv_sockser_status (SIM_DESC sd)
45{
46 return (DV_SOCKSER_INPUT_EMPTY |
47 DV_SOCKSER_OUTPUT_EMPTY |
48 DV_SOCKSER_DISCONNECTED);
49}
50
51STATIC_INLINE int
52dv_sockser_write (SIM_DESC sd, unsigned char c)
53{
54 return -1;
55}
56
57STATIC_INLINE int
58dv_sockser_write_buffer (SIM_DESC sd, const unsigned char *buffer,
59 unsigned nr_bytes)
60{
61 return -1;
62}
63
64STATIC_INLINE int
65dv_sockser_read (SIM_DESC sd)
66{
67 return -1;
68}
69
70#endif /* HAVE_DV_SOCKSER */
71
c906108c 72#endif /* DV_SOCKSER_H */
This page took 0.941346 seconds and 4 git commands to generate.