From owner-p4-projects@FreeBSD.ORG Fri Jan 6 18:44:36 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 91B8316A422; Fri, 6 Jan 2006 18:44:35 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 35ED116A41F for ; Fri, 6 Jan 2006 18:44:35 +0000 (GMT) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id EC7FA43D45 for ; Fri, 6 Jan 2006 18:44:34 +0000 (GMT) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k06IiYVj036888 for ; Fri, 6 Jan 2006 18:44:34 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k06IiYvP036885 for perforce@freebsd.org; Fri, 6 Jan 2006 18:44:34 GMT (envelope-from kmacy@freebsd.org) Date: Fri, 6 Jan 2006 18:44:34 GMT Message-Id: <200601061844.k06IiYvP036885@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to kmacy@freebsd.org using -f From: Kip Macy To: Perforce Change Reviews Cc: Subject: PERFORCE change 89280 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2006 18:44:36 -0000 http://perforce.freebsd.org/chv.cgi?CH=89280 Change 89280 by kmacy@kmacy:freebsd7_xen3 on 2006/01/06 18:43:53 cleanups: style cleanup for console.c and add in missed SIF_INITDOMAIN case remove unnecessary xen-ism in segments.h Affected files ... .. //depot/projects/xen3/src/sys/dev/xen/console/console.c#3 edit .. //depot/projects/xen3/src/sys/i386/include/segments.h#3 edit Differences ... ==== //depot/projects/xen3/src/sys/dev/xen/console/console.c#3 (text+ko) ==== @@ -137,7 +137,7 @@ tsleep(&cn_mtx, PWAIT | PCATCH, "console sleep", XC_POLLTIME); } - } while( c == -1 ); + } while(c == -1); return c; } @@ -147,7 +147,7 @@ int ret = (xc_mute ? 0 : -1); int flags; CN_LOCK(cn_mtx, flags); - if ( (rp - rc) ){ + if ((rp - rc)) { /* we need to return only one char */ ret = (int)rbuf[RBUF_MASK(rc)]; rc++; @@ -182,8 +182,8 @@ * flush */ - if ( (wp-wc) < (WBUF_SIZE-1) ){ - if ( (wbuf[WBUF_MASK(wp++)] = c) == '\n' ) { + if ((wp-wc) < (WBUF_SIZE-1)) { + if ((wbuf[WBUF_MASK(wp++)] = c) == '\n') { wbuf[WBUF_MASK(wp++)] = '\r'; #ifdef notyet if (force_flush) @@ -286,7 +286,7 @@ CN_LOCK(cn_mtx, flags); for (i = 0; i < len; i++) { - if ( xen_console_up) + if (xen_console_up) (*linesw[tp->t_line]->l_rint)(buf[i], tp); else rbuf[RBUF_MASK(rp++)] = buf[i]; @@ -298,31 +298,25 @@ __xencons_tx_flush(void) { int sz, work_done = 0; - TRACE_ENTER; -#ifdef notyet - while (x_char) { - if (xencons_ring_send(&x_char, 1) == 1) { - x_char = 0; - work_done = 1; - } - } -#endif - while ( wc != wp ) { + while (wc != wp) { int sent; sz = wp - wc; - if ( sz > (WBUF_SIZE - WBUF_MASK(wc)) ) + if (sz > (WBUF_SIZE - WBUF_MASK(wc))) sz = WBUF_SIZE - WBUF_MASK(wc); - sent = xencons_ring_send(&wbuf[WBUF_MASK(wc)], sz); - if (sent == 0) - break; - wc += sent; + if (xen_start_info->flags & SIF_INITDOMAIN) { + HYPERVISOR_console_io(CONSOLEIO_write, sz, &wbuf[WBUF_MASK(wc)]); + wc += sz; + } else { + sent = xencons_ring_send(&wbuf[WBUF_MASK(wc)], sz); + if (sent == 0) + break; + wc += sent; + } work_done = 1; - } - if ( work_done && xen_console_up ) + if (work_done && xen_console_up) ttwakeup(xccons); - TRACE_EXIT; } void @@ -425,7 +419,7 @@ __xencons_put_char(int ch) { char _ch = (char)ch; - if ( (wp - wc) == WBUF_SIZE ) + if ((wp - wc) == WBUF_SIZE) return 0; wbuf[WBUF_MASK(wp++)] = _ch; return 1; ==== //depot/projects/xen3/src/sys/i386/include/segments.h#3 (text+ko) ==== @@ -210,13 +210,8 @@ #define GPRIV_SEL 1 /* SMP Per-Processor Private Data */ #define GUFS_SEL 2 /* User %fs Descriptor (order critical: 1) */ #define GUGS_SEL 3 /* User %gs Descriptor (order critical: 2) */ -#ifdef XEN -#define GCODE_SEL (__KERNEL_CS >> 3) /* Kernel Code Descriptor (order critical: 1) */ -#define GDATA_SEL (__KERNEL_DS >> 3) /* Kernel Data Descriptor (order critical: 2) */ -#else #define GCODE_SEL 4 /* Kernel Code Descriptor (order critical: 1) */ #define GDATA_SEL 5 /* Kernel Data Descriptor (order critical: 2) */ -#endif #define GUCODE_SEL 6 /* User Code Descriptor (order critical: 3) */ #define GUDATA_SEL 7 /* User Data Descriptor (order critical: 4) */ #define GBIOSLOWMEM_SEL 8 /* BIOS low memory access (must be entry 8) */