Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KvyzD-0007m5-5E for qemu-devel@nongnu.org; Fri, 31 Oct 2008 14:44:43 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KvyzC-0007lY-6V for qemu-devel@nongnu.org; Fri, 31 Oct 2008 14:44:42 -0400 Received: from [199.232.76.173] (port=46910 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KvyzB-0007lT-Tl for qemu-devel@nongnu.org; Fri, 31 Oct 2008 14:44:42 -0400 Received: from savannah.gnu.org ([199.232.41.3]:49409 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KvyzB-0007by-Oq for qemu-devel@nongnu.org; Fri, 31 Oct 2008 14:44:41 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KvyzA-0007jD-Ug for qemu-devel@nongnu.org; Fri, 31 Oct 2008 18:44:41 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KvyzA-0007j8-Fg for qemu-devel@nongnu.org; Fri, 31 Oct 2008 18:44:40 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Fri, 31 Oct 2008 18:44:40 +0000 Subject: [Qemu-devel] [5579] Move some declarations around in the QEMU CharDriver code Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 5579 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5579 Author: aliguori Date: 2008-10-31 18:44:40 +0000 (Fri, 31 Oct 2008) Log Message: ----------- Move some declarations around in the QEMU CharDriver code The goal of this series is to move the CharDriverState code out of vl.c and into its own file, qemu-char.c. This patch moves around some declarations so the next patch can be pure code motion. Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/qemu-char.h trunk/qemu_socket.h trunk/sysemu.h trunk/vl.c Modified: trunk/qemu-char.h =================================================================== --- trunk/qemu-char.h 2008-10-31 18:40:25 UTC (rev 5578) +++ trunk/qemu-char.h 2008-10-31 18:44:40 UTC (rev 5579) @@ -78,6 +78,8 @@ void qemu_chr_accept_input(CharDriverState *s); void qemu_chr_info(void); +extern int term_escape_char; + /* async I/O support */ int qemu_set_fd_handler2(int fd, Modified: trunk/qemu_socket.h =================================================================== --- trunk/qemu_socket.h 2008-10-31 18:40:25 UTC (rev 5578) +++ trunk/qemu_socket.h 2008-10-31 18:44:40 UTC (rev 5579) @@ -28,9 +28,15 @@ #define socket_error() errno #define closesocket(s) close(s) +int parse_unix_path(struct sockaddr_un *uaddr, const char *str); + #endif /* !_WIN32 */ void socket_set_nonblock(int fd); int parse_host_port(struct sockaddr_in *saddr, const char *str); +int parse_host_src_port(struct sockaddr_in *haddr, + struct sockaddr_in *saddr, + const char *str); +int send_all(int fd, const uint8_t *buf, int len1); #endif /* QEMU_SOCKET_H */ Modified: trunk/sysemu.h =================================================================== --- trunk/sysemu.h 2008-10-31 18:40:25 UTC (rev 5578) +++ trunk/sysemu.h 2008-10-31 18:44:40 UTC (rev 5579) @@ -98,8 +98,8 @@ extern int semihosting_enabled; extern int old_param; extern const char *bootp_filename; +extern DisplayState display_state; - #ifdef USE_KQEMU extern int kqemu_allowed; #endif @@ -155,6 +155,8 @@ extern CharDriverState *parallel_hds[MAX_PARALLEL_PORTS]; +#define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR) + #ifdef NEED_CPU_H /* loader.c */ int get_image_size(const char *filename); Modified: trunk/vl.c =================================================================== --- trunk/vl.c 2008-10-31 18:40:25 UTC (rev 5578) +++ trunk/vl.c 2008-10-31 18:44:40 UTC (rev 5579) @@ -179,7 +179,7 @@ static BlockDriverState *bs_snapshots; static int vga_ram_size; enum vga_retrace_method vga_retrace_method = VGA_RETRACE_DUMB; -static DisplayState display_state; +DisplayState display_state; int nographic; static int curses; const char* keyboard_layout = NULL; @@ -252,8 +252,6 @@ uint8_t qemu_uuid[16]; -#define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR) - /***********************************************************/ /* x86 ISA bus support */ @@ -1877,7 +1875,7 @@ int64_t ti; int secs; - ti = get_clock(); + ti = qemu_get_clock(rt_clock); if (term_timestamps_start == -1) term_timestamps_start = ti; ti -= term_timestamps_start; @@ -1906,7 +1904,7 @@ NULL }; -static int term_escape_char = 0x01; /* ctrl-a is used for escape */ +int term_escape_char = 0x01; /* ctrl-a is used for escape */ static void mux_print_help(CharDriverState *chr) { int i, j; @@ -2105,7 +2103,7 @@ return 0; } -static int send_all(int fd, const uint8_t *buf, int len1) +int send_all(int fd, const uint8_t *buf, int len1) { int ret, len; @@ -2150,7 +2148,7 @@ return len1 - len; } -static inline int send_all(int fd, const uint8_t *buf, int len1) +inline int send_all(int fd, const uint8_t *buf, int len1) { return unix_write(fd, buf, len1); } @@ -2169,7 +2167,7 @@ static int fd_chr_write(CharDriverState *chr, const uint8_t *buf, int len) { FDCharDriver *s = chr->opaque; - return unix_write(s->fd_out, buf, len); + return send_all(s->fd_out, buf, len); } static int fd_chr_read_poll(void *opaque) @@ -2476,7 +2474,7 @@ pty_chr_update_read_handler(chr); return 0; } - return unix_write(s->fd, buf, len); + return send_all(s->fd, buf, len); } static int pty_chr_read_poll(void *opaque) @@ -3368,13 +3366,6 @@ } } -#ifndef _WIN32 -static int parse_unix_path(struct sockaddr_un *uaddr, const char *str); -#endif -int parse_host_src_port(struct sockaddr_in *haddr, - struct sockaddr_in *saddr, - const char *str); - static CharDriverState *qemu_chr_open_udp(const char *def) { CharDriverState *chr = NULL; @@ -4034,7 +4025,7 @@ } #ifndef _WIN32 -static int parse_unix_path(struct sockaddr_un *uaddr, const char *str) +int parse_unix_path(struct sockaddr_un *uaddr, const char *str) { const char *p; int len;