• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright (C) 2007-2008 The Android Open Source Project
2 **
3 ** This software is licensed under the terms of the GNU General Public
4 ** License version 2, as published by the Free Software Foundation, and
5 ** may be copied, distributed, and modified under those terms.
6 **
7 ** This program is distributed in the hope that it will be useful,
8 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
9 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10 ** GNU General Public License for more details.
11 */
12 #ifndef _CHARPIPE_H
13 #define _CHARPIPE_H
14 
15 #include "qemu-common.h"
16 
17 /* open two connected character drivers that can be used to communicate by internal
18  * QEMU components. For Android, this is used to connect an emulated serial port
19  * with the android modem
20  */
21 extern int  qemu_chr_open_charpipe( CharDriverState* *pfirst, CharDriverState* *psecond );
22 
23 /* create a buffering character driver for a given endpoint. The result will buffer
24  * anything that is sent to it but cannot be sent to the endpoint immediately.
25  * On the other hand, if the endpoint calls can_read() or read(), these calls
26  * are passed immediately to the can_read() or read() handlers of the result.
27  */
28 extern CharDriverState*  qemu_chr_open_buffer( CharDriverState*  endpoint );
29 
30 /* must be called from the main event loop to poll all charpipes */
31 extern void charpipe_poll( void );
32 
33 #endif /* _CHARPIPE_H */
34