mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
bitkeeper revision 1.597 (3fb26743975c08pGlW-UntXWf-IBnQ)
Merge labyrinth.cl.cam.ac.uk:/auto/groups/xeno/BK/xeno.bk into labyrinth.cl.cam.ac.uk:/auto/anfs/scratch/labyrinth/br260/xeno.bk
This commit is contained in:
commit
8196792c29
9 files changed
+128
-1
No files matched your search
@@ -170,6 +170,7 @@
|
||||
3ec43c5dmQxGDvgJJXbV1yLxT30Y1A tools/internal/xi_helper
|
||||
3f108ad5wQm0ZaQ4GXFoUhH1W1aW9w tools/internal/xi_list.c
|
||||
3f0458aaXhD8BQAggO81gv30RQ-ifA tools/internal/xi_phys_grant.c
|
||||
3fb14ab76b0aJu66S18CVjlemLwk4Q tools/internal/xi_read_console_ring.c
|
||||
3fa9861aBdNV1yCjfY4cLPr4Mtrpuw tools/internal/xi_restore_linux.c
|
||||
3fa98615LWZfagwDBp7XfuC-u9wi3w tools/internal/xi_save_linux.c
|
||||
3f108adb2b5OkKL6-faG3lMiOYDf_w tools/internal/xi_sched_domain.c
|
||||
@@ -239,6 +240,7 @@
|
||||
3e397e66AyyD5fYraAySWuwi9uqSXg xen/common/ac_timer.c
|
||||
3ddb79bddEYJbcURvqqcx99Yl2iAhQ xen/common/block.c
|
||||
3ddb79bdrqnW93GR9gZk1OJe1qK-iQ xen/common/brlock.c
|
||||
3fb10d07GscSWPKxBqpvNfU-dYfa0g xen/common/console.c
|
||||
3fa152581E5KhrAtqZef2Sr5NKTz4w xen/common/debug.c
|
||||
3ddb79bdLX_P6iB7ILiblRLWvebapg xen/common/dom0_ops.c
|
||||
3e6377e4i0c9GtKN65e99OtRbw3AZw xen/common/dom_mem_ops.c
|
||||
|
||||
@@ -6,6 +6,7 @@ akw27@labyrinth.cl.cam.ac.uk
|
||||
akw27@plucky.localdomain
|
||||
bd240@boulderdash.cl.cam.ac.uk
|
||||
bd240@labyrinth.cl.cam.ac.uk
|
||||
br260@labyrinth.cl.cam.ac.uk
|
||||
br260@laudney.cl.cam.ac.uk
|
||||
iap10@freefall.cl.cam.ac.uk
|
||||
iap10@labyrinth.cl.cam.ac.uk
|
||||
|
||||
@@ -11,6 +11,7 @@ TARGETS = xi_create xi_start xi_stop xi_destroy xi_build
|
||||
TARGETS += xi_phys_grant xi_list xi_save_linux xi_restore_linux
|
||||
TARGETS += xi_sched_global xi_sched_domain xi_usage xi_vif_params
|
||||
TARGETS += xi_vbd_create xi_vbd_add xi_vbd_list xi_vbd_info
|
||||
TARGETS += xi_read_console_ring
|
||||
INSTALL = $(TARGETS) xi_vifinit xi_helper
|
||||
|
||||
all: check-for-zlib $(TARGETS)
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Usage: <executable> [-c]
|
||||
*/
|
||||
|
||||
#include "dom0_defs.h"
|
||||
|
||||
#define CONSOLE_RING_SIZE 16392
|
||||
static char *argv0 = "read_console_ring";
|
||||
|
||||
static long read_console_ring(char *str, unsigned count)
|
||||
{
|
||||
int ret;
|
||||
dom0_op_t op;
|
||||
|
||||
op.cmd = DOM0_READCONSOLE;
|
||||
op.u.readconsole.str = str;
|
||||
op.u.readconsole.count = count;
|
||||
|
||||
ret = do_dom0_op(&op);
|
||||
if (ret > 0) {
|
||||
*(str + ret) = '\0';
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char str[CONSOLE_RING_SIZE];
|
||||
|
||||
if ( argv[0] != NULL )
|
||||
argv0 = argv[0];
|
||||
|
||||
if ( argc > 2) {
|
||||
fprintf(stderr, "Usage: %s [-r]\n", argv0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ( read_console_ring(str, CONSOLE_RING_SIZE) < 0 ) {
|
||||
printf("Read console ring error.\n");
|
||||
printf("%s", str);
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf("%s", str);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* console.c
|
||||
*
|
||||
* read domain console output buffer ring in Xen
|
||||
*
|
||||
*/
|
||||
|
||||
#include <xeno/console.h>
|
||||
#include <asm-i386/uaccess.h>
|
||||
|
||||
void init_console_ring()
|
||||
{
|
||||
console_ring.len = 0;
|
||||
}
|
||||
|
||||
long read_console_ring(char *str, unsigned int count)
|
||||
{
|
||||
unsigned int len;
|
||||
|
||||
len = (console_ring.len < count)? console_ring.len : count;
|
||||
|
||||
if ( copy_to_user(str, console_ring.buf, len) )
|
||||
return -EFAULT;
|
||||
|
||||
return len;
|
||||
}
|
||||
@@ -412,6 +412,14 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
|
||||
ret = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case DOM0_READCONSOLE:
|
||||
{
|
||||
extern long read_console_ring(char *, unsigned int);
|
||||
ret = read_console_ring(op.u.readconsole.str,
|
||||
op.u.readconsole.count);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
ret = -ENOSYS;
|
||||
|
||||
@@ -156,6 +156,7 @@ void cmain (unsigned long magic, multiboot_info_t *mbi)
|
||||
}
|
||||
|
||||
init_serial();
|
||||
init_console_ring();
|
||||
init_vga();
|
||||
cls();
|
||||
|
||||
@@ -447,12 +448,27 @@ void putchar_console(int c) {}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_OUTPUT_CONSOLE_RING
|
||||
|
||||
void putchar_console_ring(int c)
|
||||
{
|
||||
if (console_ring.len < CONSOLE_RING_SIZE)
|
||||
console_ring.buf[console_ring.len++] = (char)c;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void putchar_console_ring(int c) {}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
static void putchar(int c)
|
||||
{
|
||||
if ( (c != '\n') && ((c < 32) || (c > 126)) ) return;
|
||||
putchar_serial(c);
|
||||
putchar_console(c);
|
||||
putchar_console_ring(c);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -185,6 +185,17 @@ typedef struct dom0_settime_st
|
||||
u64 system_time;
|
||||
} dom0_settime_t;
|
||||
|
||||
/*
|
||||
* Read console content from Xen buffer ring.
|
||||
*/
|
||||
|
||||
#define DOM0_READCONSOLE 19
|
||||
typedef struct dom0_readconsole_st
|
||||
{
|
||||
char *str;
|
||||
unsigned int count;
|
||||
} dom0_readconsole_t;
|
||||
|
||||
typedef struct dom0_op_st
|
||||
{
|
||||
unsigned long cmd;
|
||||
@@ -205,6 +216,7 @@ typedef struct dom0_op_st
|
||||
dom0_msr_t msr;
|
||||
dom0_debug_t debug;
|
||||
dom0_settime_t settime;
|
||||
dom0_readconsole_t readconsole;
|
||||
} u;
|
||||
} dom0_op_t;
|
||||
|
||||
|
||||
@@ -37,7 +37,21 @@
|
||||
* yet, so this will do for now.
|
||||
*/
|
||||
|
||||
#define CONFIG_OUTPUT_CONSOLE 1
|
||||
#define CONFIG_OUTPUT_SERIAL 1
|
||||
#define CONFIG_OUTPUT_CONSOLE 1
|
||||
#define CONFIG_OUTPUT_CONSOLE_RING 1
|
||||
|
||||
extern int opt_console;
|
||||
|
||||
#define CONSOLE_RING_SIZE 16392
|
||||
|
||||
typedef struct console_ring_st
|
||||
{
|
||||
char buf[CONSOLE_RING_SIZE];
|
||||
unsigned int len;
|
||||
} console_ring_t;
|
||||
|
||||
console_ring_t console_ring;
|
||||
|
||||
void init_console_ring();
|
||||
long read_console_ring(char *str, unsigned int count);
|
||||