PERFORCE change 89280 for review
Kip Macy
kmacy at FreeBSD.org
Fri Jan 6 10:44:36 PST 2006
http://perforce.freebsd.org/chv.cgi?CH=89280
Change 89280 by kmacy at 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) */
More information about the p4-projects
mailing list