Added symbol BX_NULL_PREFIX and fixed textconfig log options table.

If log module name not specified, use device log prefix converted to lower
case as the name and simplified setting up some short prefixes.
This commit is contained in:
Volker Ruppert 2013-12-31 09:20:08 +00:00
parent c6dd095321
commit 401321d500
10 changed files with 19 additions and 14 deletions

View File

@ -80,7 +80,7 @@ bx_keymap_c bx_keymap;
bx_keymap_c::bx_keymap_c(void)
{
put("keymap", "KEYMAP");
put("KEYMAP");
keymapCount = 0;
keymapTable = (BXKeyEntry *)NULL;

View File

@ -173,6 +173,8 @@ typedef enum {
N_ACT
} bx_log_actions;
#define BX_NULL_PREFIX "[ ]"
// normally all action choices are available for all event types. The exclude
// expression allows some choices to be eliminated if they don't make any
// sense. For example, it would be stupid to ignore a panic.

View File

@ -542,7 +542,7 @@ static void bx_print_log_action_table()
fprintf(stderr, "---- --------- --------- --------- ---------- ----------\n");
int i, j, imax=SIM->get_n_log_modules();
for (i=0; i<imax; i++) {
if (strcmp(SIM->get_prefix(i), "[ ]")) {
if (strcmp(SIM->get_prefix(i), BX_NULL_PREFIX)) {
fprintf(stderr, "%3d. %s ", i, SIM->get_prefix(i));
for (j=0; j<SIM->get_max_log_level(); j++) {
fprintf(stderr, "%10s ", SIM->get_action_name(SIM->get_log_action(i, j)));

View File

@ -255,7 +255,7 @@ bx_svga_cirrus_c::~bx_svga_cirrus_c()
void bx_svga_cirrus_c::init_vga_extension(void)
{
if (!strcmp(SIM->get_param_string(BXPN_VGA_EXTENSION)->getptr(), "cirrus")) {
BX_CIRRUS_THIS put("cirrus", "CIRRUS");
BX_CIRRUS_THIS put("CIRRUS");
// initialize SVGA stuffs.
BX_CIRRUS_THIS bx_vgacore_c::init_iohandlers(svga_read_handler, svga_write_handler);
BX_CIRRUS_THIS bx_vgacore_c::init_systemtimer(svga_timer_handler, svga_param_handler);

View File

@ -153,7 +153,7 @@ void libvoodoo_LTX_plugin_fini(void)
bx_voodoo_c::bx_voodoo_c()
{
put("voodoo", "VOODOO");
put("VOODOO");
s.mode_change_timer_id = BX_NULL_TIMER_HANDLE;
s.update_timer_id = BX_NULL_TIMER_HANDLE;
v = NULL;

View File

@ -127,7 +127,7 @@ void libfloppy_LTX_plugin_fini(void)
bx_floppy_ctrl_c::bx_floppy_ctrl_c()
{
put("floppy", "FLOPPY");
put("FLOPPY");
memset(&s, 0, sizeof(s));
s.floppy_timer_index = BX_NULL_TIMER_HANDLE;
}

View File

@ -2,7 +2,7 @@
// $Id$
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002-2012 The Bochs Project
// Copyright (C) 2002-2013 The Bochs Project
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@ -122,7 +122,7 @@ void bx_io_redirect_entry_t::register_state(bx_param_c *parent)
bx_ioapic_c::bx_ioapic_c(): enabled(0), base_addr(BX_IOAPIC_BASE_ADDR)
{
set_id(BX_IOAPIC_DEFAULT_ID);
put("ioapic", "IOAPIC");
put("IOAPIC");
}
bx_ioapic_c::~bx_ioapic_c()

View File

@ -137,7 +137,7 @@ void libpcidev_LTX_plugin_fini(void)
bx_pcidev_c::bx_pcidev_c()
{
put("pcidev", "PCIDEV");
put("PCIDEV");
}
bx_pcidev_c::~bx_pcidev_c()

View File

@ -182,7 +182,7 @@ void libes1370_LTX_plugin_fini(void)
bx_es1370_c::bx_es1370_c()
{
put("es1370", "ES1370");
put("ES1370");
memset(&s, 0, sizeof(bx_es1370_t));
s.dac1_timer_index = BX_NULL_TIMER_HANDLE;
s.dac2_timer_index = BX_NULL_TIMER_HANDLE;

View File

@ -322,15 +322,18 @@ void logfunctions::setio(iofunc_t *i)
void logfunctions::put(const char *p)
{
const char *n = p;
put(n, p);
char *n = strdup(p);
for (unsigned i=0; i<strlen(p); i++)
n[i] = tolower(p[i]);
put((const char*)n, p);
}
void logfunctions::put(const char *n, const char *p)
{
char *tmpbuf=strdup("[ ]"); // if we ever have more than 32 chars,
// we need to rethink this
char *tmpbuf=strdup(BX_NULL_PREFIX); // if we ever have more than 32 chars,
// we need to rethink this
if (tmpbuf == NULL)
return; // allocation not successful