From 89522c30d8cc3a661ed7bb0460fb3e3c81c1f16f Mon Sep 17 00:00:00 2001 From: Volker Ruppert Date: Sat, 30 Jan 2021 23:55:24 +0000 Subject: [PATCH] Some more bx_bool to bool type changes. - bx_shadow_bool_c: removed unused bitnum feature and changed data type. - Changed return type of memory handlers to bool. - Modified virtual timer, PIC and PIT code. --- bochs/bochs.h | 2 +- bochs/gui/paramtree.cc | 22 ++++++----------- bochs/gui/paramtree.h | 13 ++++------ bochs/iodev/display/banshee.cc | 8 +++---- bochs/iodev/display/svga_cirrus.cc | 4 ++-- bochs/iodev/display/svga_cirrus.h | 6 ++--- bochs/iodev/display/vga.cc | 4 ++-- bochs/iodev/display/vga.h | 6 ++--- bochs/iodev/display/vgacore.cc | 4 ++-- bochs/iodev/display/vgacore.h | 6 ++--- bochs/iodev/display/voodoo.cc | 8 +++---- bochs/iodev/display/voodoo.h | 10 ++++---- bochs/iodev/hpet.cc | 4 ++-- bochs/iodev/ioapic.cc | 4 ++-- bochs/iodev/iodev.h | 6 ++--- bochs/iodev/network/e1000.cc | 12 +++++----- bochs/iodev/network/e1000.h | 10 ++++---- bochs/iodev/network/ne2k.cc | 6 ++--- bochs/iodev/network/ne2k.h | 6 ++--- bochs/iodev/pci.cc | 8 +++---- bochs/iodev/pci.h | 6 ++--- bochs/iodev/pic.cc | 2 +- bochs/iodev/pic.h | 16 ++++++------- bochs/iodev/pit.cc | 12 +++++----- bochs/iodev/pit.h | 20 ++++++++-------- bochs/iodev/pit82c54.cc | 10 ++++---- bochs/iodev/pit82c54.h | 38 +++++++++++++++--------------- bochs/iodev/usb/usb_ehci.cc | 4 ++-- bochs/iodev/usb/usb_ehci.h | 10 ++++---- bochs/iodev/usb/usb_ohci.cc | 4 ++-- bochs/iodev/usb/usb_ohci.h | 10 ++++---- bochs/iodev/usb/usb_xhci.cc | 4 ++-- bochs/iodev/usb/usb_xhci.h | 10 ++++---- bochs/iodev/virt_timer.cc | 24 +++++++++---------- bochs/iodev/virt_timer.h | 34 +++++++++++++------------- bochs/memory/memory-bochs.h | 8 +++---- 36 files changed, 174 insertions(+), 187 deletions(-) diff --git a/bochs/bochs.h b/bochs/bochs.h index 6cbc777a6..e78418399 100644 --- a/bochs/bochs.h +++ b/bochs/bochs.h @@ -183,7 +183,7 @@ void print_statistics_tree(bx_param_c *node, int level = 0); new bx_shadow_num_c(parent, #name, &(field), BASE_DEC) #define BXRS_PARAM_BOOL(parent, name, field) \ - new bx_shadow_bool_c(parent, #name, (bx_bool*)(&(field))) + new bx_shadow_bool_c(parent, #name, (bool*)&(field)) // =-=-=-=-=-=-=- Normal optimized use -=-=-=-=-=-=-=-=-=-=-=-=-=-= #define BX_INP(addr, len) bx_devices.inp(addr, len) diff --git a/bochs/gui/paramtree.cc b/bochs/gui/paramtree.cc index 38d37b0b6..7f7bacd08 100644 --- a/bochs/gui/paramtree.cc +++ b/bochs/gui/paramtree.cc @@ -632,45 +632,37 @@ int bx_param_bool_c::dump_param(char *buf, int len, bool dquotes) bx_shadow_bool_c::bx_shadow_bool_c(bx_param_c *parent, const char *name, const char *label, - bx_bool *ptr_to_real_val, - Bit8u bitnum) + bool *ptr_to_real_val) : bx_param_bool_c(parent, name, label, NULL, (Bit64s) *ptr_to_real_val, 1) { val.pbool = ptr_to_real_val; - this->bitnum = bitnum; } bx_shadow_bool_c::bx_shadow_bool_c(bx_param_c *parent, const char *name, - bx_bool *ptr_to_real_val, - Bit8u bitnum) + bool *ptr_to_real_val) : bx_param_bool_c(parent, name, NULL, NULL, (Bit64s) *ptr_to_real_val, 1) { val.pbool = ptr_to_real_val; - this->bitnum = bitnum; } Bit64s bx_shadow_bool_c::get64() { if (handler) { // the handler can decide what value to return and/or do some side effect - Bit64s ret = (*handler)(this, 0, (Bit64s) *(val.pbool)); - return (ret>>bitnum) & 1; + return (*handler)(this, 0, (Bit64s) *(val.pbool)); } else { // just return the value - return (*(val.pbool)) & 1; + return (Bit64s)*(val.pbool); } } -void bx_shadow_bool_c::set(Bit64s newval) +void bx_shadow_bool_c::set(bool newval) { - // only change the bitnum bit - Bit64s mask = BX_CONST64(1) << bitnum; - *(val.pbool) &= ~mask; - *(val.pbool) |= ((newval & 1) << bitnum); + *(val.pbool) = newval; if (handler) { // the handler can override the new value and/or perform some side effect - (*handler)(this, 1, newval&1); + (*handler)(this, 1, (Bit64s)newval); } } diff --git a/bochs/gui/paramtree.h b/bochs/gui/paramtree.h index 43da42fed..77c5dba18 100644 --- a/bochs/gui/paramtree.h +++ b/bochs/gui/paramtree.h @@ -195,7 +195,7 @@ protected: Bit8s *p8bit; // used by bx_shadow_num_c float *pfloat; // used by bx_shadow_num_c double *pdouble; // used by bx_shadow_num_c - bx_bool *pbool; // used by bx_shadow_bool_c + bool *pbool; // used by bx_shadow_bool_c } val; param_event_handler handler; void *sr_devptr; @@ -333,21 +333,16 @@ public: // a bx_shadow_bool_c is a shadow param based on bx_param_bool_c. class BOCHSAPI bx_shadow_bool_c : public bx_param_bool_c { - // each bit of a bitfield can be a separate value. bitnum tells which - // bit is used. get/set will only modify that bit. - Bit8u bitnum; public: bx_shadow_bool_c(bx_param_c *parent, const char *name, const char *label, - bx_bool *ptr_to_real_val, - Bit8u bitnum = 0); + bool *ptr_to_real_val); bx_shadow_bool_c(bx_param_c *parent, const char *name, - bx_bool *ptr_to_real_val, - Bit8u bitnum = 0); + bool *ptr_to_real_val); virtual Bit64s get64(); - virtual void set(Bit64s val); + virtual void set(bool val); }; diff --git a/bochs/iodev/display/banshee.cc b/bochs/iodev/display/banshee.cc index 744d37ce7..bc1054759 100644 --- a/bochs/iodev/display/banshee.cc +++ b/bochs/iodev/display/banshee.cc @@ -752,16 +752,16 @@ void bx_banshee_c::write(Bit32u address, Bit32u value, unsigned io_len) } } -bx_bool bx_banshee_c::mem_read_handler(bx_phy_address addr, unsigned len, - void *data, void *param) +bool bx_banshee_c::mem_read_handler(bx_phy_address addr, unsigned len, + void *data, void *param) { bx_banshee_c *class_ptr = (bx_banshee_c*)param; class_ptr->mem_read(addr, len, data); return 1; } -bx_bool bx_banshee_c::mem_write_handler(bx_phy_address addr, unsigned len, - void *data, void *param) +bool bx_banshee_c::mem_write_handler(bx_phy_address addr, unsigned len, + void *data, void *param) { bx_banshee_c *class_ptr = (bx_banshee_c*)param; class_ptr->mem_write(addr, len, data); diff --git a/bochs/iodev/display/svga_cirrus.cc b/bochs/iodev/display/svga_cirrus.cc index 6ebdbeffd..62c646856 100644 --- a/bochs/iodev/display/svga_cirrus.cc +++ b/bochs/iodev/display/svga_cirrus.cc @@ -488,7 +488,7 @@ void bx_svga_cirrus_c::mem_write_mode4and5_16bpp(Bit8u mode, Bit32u offset, Bit8 } #if BX_SUPPORT_PCI -bx_bool bx_svga_cirrus_c::cirrus_mem_read_handler(bx_phy_address addr, unsigned len, +bool bx_svga_cirrus_c::cirrus_mem_read_handler(bx_phy_address addr, unsigned len, void *data, void *param) { Bit8u *data_ptr; @@ -627,7 +627,7 @@ Bit8u bx_svga_cirrus_c::mem_read(bx_phy_address addr) } #if BX_SUPPORT_PCI -bx_bool bx_svga_cirrus_c::cirrus_mem_write_handler(bx_phy_address addr, unsigned len, +bool bx_svga_cirrus_c::cirrus_mem_write_handler(bx_phy_address addr, unsigned len, void *data, void *param) { Bit8u *data_ptr; diff --git a/bochs/iodev/display/svga_cirrus.h b/bochs/iodev/display/svga_cirrus.h index f23d25e81..4add5c0f6 100644 --- a/bochs/iodev/display/svga_cirrus.h +++ b/bochs/iodev/display/svga_cirrus.h @@ -5,7 +5,7 @@ // Copyright (c) 2004 Makoto Suzuki (suzu) // Volker Ruppert (vruppert) // Robin Kay (komadori) -// Copyright (C) 2004-2020 The Bochs Project +// Copyright (C) 2004-2021 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 @@ -254,8 +254,8 @@ private: #if BX_SUPPORT_PCI BX_CIRRUS_SMF void svga_init_pcihandlers(void); - BX_CIRRUS_SMF bx_bool cirrus_mem_read_handler(bx_phy_address addr, unsigned len, void *data, void *param); - BX_CIRRUS_SMF bx_bool cirrus_mem_write_handler(bx_phy_address addr, unsigned len, void *data, void *param); + BX_CIRRUS_SMF bool cirrus_mem_read_handler(bx_phy_address addr, unsigned len, void *data, void *param); + BX_CIRRUS_SMF bool cirrus_mem_write_handler(bx_phy_address addr, unsigned len, void *data, void *param); #endif }; diff --git a/bochs/iodev/display/vga.cc b/bochs/iodev/display/vga.cc index fc2a0e50c..deff25d09 100644 --- a/bochs/iodev/display/vga.cc +++ b/bochs/iodev/display/vga.cc @@ -612,7 +612,7 @@ void bx_vga_c::update(void) } } -bx_bool bx_vga_c::mem_read_handler(bx_phy_address addr, unsigned len, void *data, void *param) +bool bx_vga_c::mem_read_handler(bx_phy_address addr, unsigned len, void *data, void *param) { Bit8u *data_ptr; #ifdef BX_LITTLE_ENDIAN @@ -656,7 +656,7 @@ Bit8u bx_vga_c::mem_read(bx_phy_address addr) return bx_vgacore_c::mem_read(addr); } -bx_bool bx_vga_c::mem_write_handler(bx_phy_address addr, unsigned len, void *data, void *param) +bool bx_vga_c::mem_write_handler(bx_phy_address addr, unsigned len, void *data, void *param) { Bit8u *data_ptr; #ifdef BX_LITTLE_ENDIAN diff --git a/bochs/iodev/display/vga.h b/bochs/iodev/display/vga.h index 4497e0116..053c9e16a 100644 --- a/bochs/iodev/display/vga.h +++ b/bochs/iodev/display/vga.h @@ -2,7 +2,7 @@ // $Id$ ///////////////////////////////////////////////////////////////////////// // -// Copyright (C) 2002-2020 The Bochs Project +// Copyright (C) 2002-2021 The Bochs Project // PCI VGA dummy adapter Copyright (C) 2002,2003 Mike Nordell // // This library is free software; you can redistribute it and/or @@ -95,8 +95,8 @@ public: bx_vga_c(); virtual ~bx_vga_c(); virtual void reset(unsigned type); - BX_VGA_SMF bx_bool mem_read_handler(bx_phy_address addr, unsigned len, void *data, void *param); - BX_VGA_SMF bx_bool mem_write_handler(bx_phy_address addr, unsigned len, void *data, void *param); + BX_VGA_SMF bool mem_read_handler(bx_phy_address addr, unsigned len, void *data, void *param); + BX_VGA_SMF bool mem_write_handler(bx_phy_address addr, unsigned len, void *data, void *param); virtual Bit8u mem_read(bx_phy_address addr); virtual void mem_write(bx_phy_address addr, Bit8u value); virtual void register_state(void); diff --git a/bochs/iodev/display/vgacore.cc b/bochs/iodev/display/vgacore.cc index a9a8c195f..1fde1b3cb 100644 --- a/bochs/iodev/display/vgacore.cc +++ b/bochs/iodev/display/vgacore.cc @@ -1706,7 +1706,7 @@ void bx_vgacore_c::update(void) } } -bx_bool bx_vgacore_c::mem_read_handler(bx_phy_address addr, unsigned len, void *data, void *param) +bool bx_vgacore_c::mem_read_handler(bx_phy_address addr, unsigned len, void *data, void *param) { bx_vgacore_c *class_ptr = (bx_vgacore_c *) param; Bit8u *data_ptr; @@ -1799,7 +1799,7 @@ Bit8u bx_vgacore_c::mem_read(bx_phy_address addr) } } -bx_bool bx_vgacore_c::mem_write_handler(bx_phy_address addr, unsigned len, void *data, void *param) +bool bx_vgacore_c::mem_write_handler(bx_phy_address addr, unsigned len, void *data, void *param) { bx_vgacore_c *class_ptr = (bx_vgacore_c *) param; Bit8u *data_ptr; diff --git a/bochs/iodev/display/vgacore.h b/bochs/iodev/display/vgacore.h index 558b41eef..5cf6a09f7 100644 --- a/bochs/iodev/display/vgacore.h +++ b/bochs/iodev/display/vgacore.h @@ -2,7 +2,7 @@ // $Id$ ///////////////////////////////////////////////////////////////////////// // -// Copyright (C) 2001-2020 The Bochs Project +// Copyright (C) 2001-2021 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 @@ -82,8 +82,8 @@ public: virtual ~bx_vgacore_c(); virtual void init(void); virtual void reset(unsigned type) {} - static bx_bool mem_read_handler(bx_phy_address addr, unsigned len, void *data, void *param); - static bx_bool mem_write_handler(bx_phy_address addr, unsigned len, void *data, void *param); + static bool mem_read_handler(bx_phy_address addr, unsigned len, void *data, void *param); + static bool mem_write_handler(bx_phy_address addr, unsigned len, void *data, void *param); virtual Bit8u mem_read(bx_phy_address addr); virtual void mem_write(bx_phy_address addr, Bit8u value); virtual void set_override(bx_bool enabled, void *dev); diff --git a/bochs/iodev/display/voodoo.cc b/bochs/iodev/display/voodoo.cc index 7ed1571bc..dd3c347a8 100644 --- a/bochs/iodev/display/voodoo.cc +++ b/bochs/iodev/display/voodoo.cc @@ -957,8 +957,8 @@ void bx_voodoo_1_2_c::after_restore_state(void) start_fifo_thread(); } -bx_bool bx_voodoo_1_2_c::mem_read_handler(bx_phy_address addr, unsigned len, - void *data, void *param) +bool bx_voodoo_1_2_c::mem_read_handler(bx_phy_address addr, unsigned len, + void *data, void *param) { Bit32u *data_ptr = (Bit32u*)data; @@ -966,8 +966,8 @@ bx_bool bx_voodoo_1_2_c::mem_read_handler(bx_phy_address addr, unsigned len, return 1; } -bx_bool bx_voodoo_1_2_c::mem_write_handler(bx_phy_address addr, unsigned len, - void *data, void *param) +bool bx_voodoo_1_2_c::mem_write_handler(bx_phy_address addr, unsigned len, + void *data, void *param) { Bit32u val = *(Bit32u*)data; diff --git a/bochs/iodev/display/voodoo.h b/bochs/iodev/display/voodoo.h index 6eff7ac2e..8a4148995 100644 --- a/bochs/iodev/display/voodoo.h +++ b/bochs/iodev/display/voodoo.h @@ -2,7 +2,7 @@ // $Id$ ///////////////////////////////////////////////////////////////////////// // -// Copyright (C) 2012-2020 The Bochs Project +// Copyright (C) 2012-2021 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 @@ -107,8 +107,8 @@ public: virtual void pci_write_handler(Bit8u address, Bit32u value, unsigned io_len); private: - static bx_bool mem_read_handler(bx_phy_address addr, unsigned len, void *data, void *param); - static bx_bool mem_write_handler(bx_phy_address addr, unsigned len, void *data, void *param); + static bool mem_read_handler(bx_phy_address addr, unsigned len, void *data, void *param); + static bool mem_write_handler(bx_phy_address addr, unsigned len, void *data, void *param); static void mode_change_timer_handler(void *); void mode_change_timer(void); @@ -140,8 +140,8 @@ public: #endif private: - static bx_bool mem_read_handler(bx_phy_address addr, unsigned len, void *data, void *param); - static bx_bool mem_write_handler(bx_phy_address addr, unsigned len, void *data, void *param); + static bool mem_read_handler(bx_phy_address addr, unsigned len, void *data, void *param); + static bool mem_write_handler(bx_phy_address addr, unsigned len, void *data, void *param); void mem_read(bx_phy_address addr, unsigned len, void *data); void mem_write(bx_phy_address addr, unsigned len, void *data); diff --git a/bochs/iodev/hpet.cc b/bochs/iodev/hpet.cc index 8209c0d4d..e79a38563 100644 --- a/bochs/iodev/hpet.cc +++ b/bochs/iodev/hpet.cc @@ -109,7 +109,7 @@ static int deactivating_bit(Bit64u old, Bit64u _new, Bit64u mask) // static memory read/write functions -static bx_bool hpet_read(bx_phy_address a20addr, unsigned len, void *data, void *param) +static bool hpet_read(bx_phy_address a20addr, unsigned len, void *data, void *param) { Bit32u value1; Bit64u value2; @@ -137,7 +137,7 @@ static bx_bool hpet_read(bx_phy_address a20addr, unsigned len, void *data, void return 1; } -static bx_bool hpet_write(bx_phy_address a20addr, unsigned len, void *data, void *param) +static bool hpet_write(bx_phy_address a20addr, unsigned len, void *data, void *param) { if (len == 4) { // must be 32-bit aligned if ((a20addr & 0x3) != 0) { diff --git a/bochs/iodev/ioapic.cc b/bochs/iodev/ioapic.cc index 51a22682d..cd7e9d49e 100644 --- a/bochs/iodev/ioapic.cc +++ b/bochs/iodev/ioapic.cc @@ -47,7 +47,7 @@ PLUGIN_ENTRY_FOR_MODULE(ioapic) return(0); // Success } -static bx_bool ioapic_read(bx_phy_address a20addr, unsigned len, void *data, void *param) +static bool ioapic_read(bx_phy_address a20addr, unsigned len, void *data, void *param) { if((a20addr & ~0x3) != ((a20addr+len-1) & ~0x3)) { BX_PANIC(("I/O APIC read at address 0x" FMT_PHY_ADDRX " spans 32-bit boundary !", a20addr)); @@ -70,7 +70,7 @@ static bx_bool ioapic_read(bx_phy_address a20addr, unsigned len, void *data, voi return 1; } -static bx_bool ioapic_write(bx_phy_address a20addr, unsigned len, void *data, void *param) +static bool ioapic_write(bx_phy_address a20addr, unsigned len, void *data, void *param) { if(a20addr & 0xf) { BX_PANIC(("I/O apic write at unaligned address 0x" FMT_PHY_ADDRX, a20addr)); diff --git a/bochs/iodev/iodev.h b/bochs/iodev/iodev.h index b4c1c1884..fe4998774 100644 --- a/bochs/iodev/iodev.h +++ b/bochs/iodev/iodev.h @@ -2,7 +2,7 @@ // $Id$ ///////////////////////////////////////////////////////////////////////// // -// Copyright (C) 2001-2020 The Bochs Project +// Copyright (C) 2001-2021 The Bochs Project // // I/O port handlers API Copyright (C) 2003 by Frank Cornelis // @@ -224,7 +224,7 @@ public: class BOCHSAPI bx_pit_stub_c : public bx_devmodel_c { public: - virtual void enable_irq(bx_bool enabled) { + virtual void enable_irq(bool enabled) { STUBFUNC(pit, enable_irq); } }; @@ -269,7 +269,7 @@ public: virtual void lower_irq(unsigned irq_no) { STUBFUNC(pic, lower_irq); } - virtual void set_mode(bx_bool ma_sl, Bit8u mode) { + virtual void set_mode(bool ma_sl, Bit8u mode) { STUBFUNC(pic, set_mode); } virtual Bit8u IAC(void) { diff --git a/bochs/iodev/network/e1000.cc b/bochs/iodev/network/e1000.cc index 03ce35466..2ad8f2aee 100644 --- a/bochs/iodev/network/e1000.cc +++ b/bochs/iodev/network/e1000.cc @@ -695,15 +695,15 @@ void bx_e1000_c::after_restore_state(void) bx_pci_device_c::after_restore_pci_state(mem_read_handler); } -bx_bool bx_e1000_c::mem_read_handler(bx_phy_address addr, unsigned len, - void *data, void *param) +bool bx_e1000_c::mem_read_handler(bx_phy_address addr, unsigned len, + void *data, void *param) { bx_e1000_c *class_ptr = (bx_e1000_c *) param; return class_ptr->mem_read(addr, len, data); } -bx_bool bx_e1000_c::mem_read(bx_phy_address addr, unsigned len, void *data) +bool bx_e1000_c::mem_read(bx_phy_address addr, unsigned len, void *data) { Bit32u *data_ptr = (Bit32u*) data; Bit8u *data8_ptr = (Bit8u*) data; @@ -815,15 +815,15 @@ bx_bool bx_e1000_c::mem_read(bx_phy_address addr, unsigned len, void *data) return 1; } -bx_bool bx_e1000_c::mem_write_handler(bx_phy_address addr, unsigned len, - void *data, void *param) +bool bx_e1000_c::mem_write_handler(bx_phy_address addr, unsigned len, + void *data, void *param) { bx_e1000_c *class_ptr = (bx_e1000_c *) param; return class_ptr->mem_write(addr, len, data); } -bx_bool bx_e1000_c::mem_write(bx_phy_address addr, unsigned len, void *data) +bool bx_e1000_c::mem_write(bx_phy_address addr, unsigned len, void *data) { Bit32u value = *(Bit32u*) data; Bit32u offset; diff --git a/bochs/iodev/network/e1000.h b/bochs/iodev/network/e1000.h index ce0abf63a..1ccb449e9 100644 --- a/bochs/iodev/network/e1000.h +++ b/bochs/iodev/network/e1000.h @@ -12,7 +12,7 @@ // Copyright (c) 2007 Dan Aloni // Copyright (c) 2004 Antony T Curtis // -// Copyright (C) 2011-2020 The Bochs Project +// Copyright (C) 2011-2021 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 @@ -159,10 +159,10 @@ private: static void rx_handler(void *arg, const void *buf, unsigned len); void rx_frame(const void *buf, unsigned io_len); - static bx_bool mem_read_handler(bx_phy_address addr, unsigned len, void *data, void *param); - static bx_bool mem_write_handler(bx_phy_address addr, unsigned len, void *data, void *param); - bx_bool mem_read(bx_phy_address addr, unsigned len, void *data); - bx_bool mem_write(bx_phy_address addr, unsigned len, void *data); + static bool mem_read_handler(bx_phy_address addr, unsigned len, void *data, void *param); + static bool mem_write_handler(bx_phy_address addr, unsigned len, void *data, void *param); + bool mem_read(bx_phy_address addr, unsigned len, void *data); + bool mem_write(bx_phy_address addr, unsigned len, void *data); static Bit32u read_handler(void *this_ptr, Bit32u address, unsigned io_len); static void write_handler(void *this_ptr, Bit32u address, Bit32u value, unsigned io_len); diff --git a/bochs/iodev/network/ne2k.cc b/bochs/iodev/network/ne2k.cc index ea983a54e..1b0fc7566 100644 --- a/bochs/iodev/network/ne2k.cc +++ b/bochs/iodev/network/ne2k.cc @@ -1475,15 +1475,15 @@ void bx_ne2k_c::tx_timer(void) #if BX_SUPPORT_PCI -bx_bool bx_ne2k_c::mem_read_handler(bx_phy_address addr, unsigned len, - void *data, void *param) +bool bx_ne2k_c::mem_read_handler(bx_phy_address addr, unsigned len, + void *data, void *param) { bx_ne2k_c *class_ptr = (bx_ne2k_c *) param; return class_ptr->mem_read(addr, len, data); } -bx_bool bx_ne2k_c::mem_read(bx_phy_address addr, unsigned len, void *data) +bool bx_ne2k_c::mem_read(bx_phy_address addr, unsigned len, void *data) { Bit8u *data_ptr; diff --git a/bochs/iodev/network/ne2k.h b/bochs/iodev/network/ne2k.h index 2ac02aef1..74e420b7b 100644 --- a/bochs/iodev/network/ne2k.h +++ b/bochs/iodev/network/ne2k.h @@ -2,7 +2,7 @@ // $Id$ ///////////////////////////////////////////////////////////////////////// // -// Copyright (C) 2001-2020 The Bochs Project +// Copyright (C) 2001-2021 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 @@ -253,8 +253,8 @@ private: void rx_frame(const void *buf, unsigned io_len); #if BX_SUPPORT_PCI - static bx_bool mem_read_handler(bx_phy_address addr, unsigned len, void *data, void *param); - bx_bool mem_read(bx_phy_address addr, unsigned len, void *data); + static bool mem_read_handler(bx_phy_address addr, unsigned len, void *data, void *param); + bool mem_read(bx_phy_address addr, unsigned len, void *data); #endif static Bit32u read_handler(void *this_ptr, Bit32u address, unsigned io_len); diff --git a/bochs/iodev/pci.cc b/bochs/iodev/pci.cc index 382d9f7d3..6e14b2b39 100644 --- a/bochs/iodev/pci.cc +++ b/bochs/iodev/pci.cc @@ -422,8 +422,8 @@ void bx_pci_bridge_c::pci_write_handler(Bit8u address, Bit32u value, unsigned io } } -bx_bool bx_pci_bridge_c::agp_ap_read_handler(bx_phy_address addr, unsigned len, - void *data, void *param) +bool bx_pci_bridge_c::agp_ap_read_handler(bx_phy_address addr, unsigned len, + void *data, void *param) { bx_pci_bridge_c *class_ptr = (bx_pci_bridge_c*)param; Bit32u value = class_ptr->agp_aperture_read(addr, len, 0); @@ -460,8 +460,8 @@ Bit32u bx_pci_bridge_c::agp_aperture_read(bx_phy_address addr, unsigned len, return 0; } -bx_bool bx_pci_bridge_c::agp_ap_write_handler(bx_phy_address addr, unsigned len, - void *data, void *param) +bool bx_pci_bridge_c::agp_ap_write_handler(bx_phy_address addr, unsigned len, + void *data, void *param) { bx_pci_bridge_c *class_ptr = (bx_pci_bridge_c*)param; Bit32u value = *(Bit32u*)data; diff --git a/bochs/iodev/pci.h b/bochs/iodev/pci.h index b415fd427..ec055bbf9 100644 --- a/bochs/iodev/pci.h +++ b/bochs/iodev/pci.h @@ -2,7 +2,7 @@ // $Id$ ///////////////////////////////////////////////////////////////////////// // -// Copyright (C) 2002-2018 The Bochs Project +// Copyright (C) 2002-2021 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 @@ -47,8 +47,8 @@ public: virtual void register_state(void); virtual void after_restore_state(void); - static bx_bool agp_ap_read_handler(bx_phy_address addr, unsigned len, void *data, void *param); - static bx_bool agp_ap_write_handler(bx_phy_address addr, unsigned len, void *data, void *param); + static bool agp_ap_read_handler(bx_phy_address addr, unsigned len, void *data, void *param); + static bool agp_ap_write_handler(bx_phy_address addr, unsigned len, void *data, void *param); Bit32u agp_aperture_read(bx_phy_address addr, unsigned len, bx_bool agp); void agp_aperture_write(bx_phy_address addr, Bit32u value, unsigned len, bx_bool agp); diff --git a/bochs/iodev/pic.cc b/bochs/iodev/pic.cc index 5e4ab50bd..3fb73bf68 100644 --- a/bochs/iodev/pic.cc +++ b/bochs/iodev/pic.cc @@ -661,7 +661,7 @@ void bx_pic_c::raise_irq(unsigned irq_no) } } -void bx_pic_c::set_mode(bx_bool ma_sl, Bit8u mode) +void bx_pic_c::set_mode(bool ma_sl, Bit8u mode) { if (ma_sl) { BX_PIC_THIS s.master_pic.edge_level = mode; diff --git a/bochs/iodev/pic.h b/bochs/iodev/pic.h index 22a7d9767..25e9a26ea 100644 --- a/bochs/iodev/pic.h +++ b/bochs/iodev/pic.h @@ -2,7 +2,7 @@ // $Id$ ///////////////////////////////////////////////////////////////////////// // -// Copyright (C) 2002-2009 The Bochs Project +// Copyright (C) 2002-2021 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 @@ -47,16 +47,16 @@ typedef struct { Bit8u read_reg_select; /* 0=IRR, 1=ISR */ Bit8u irq; /* current IRQ number */ Bit8u lowest_priority; /* current lowest priority irq */ - bx_bool INT; /* INT request pin of PIC */ + bool INT; /* INT request pin of PIC */ Bit8u IRQ_in; /* IRQ pins of PIC */ struct { - bx_bool in_init; - bx_bool requires_4; + bool in_init; + bool requires_4; Bit8u byte_expected; } init; - bx_bool special_mask; - bx_bool polled; /* Set when poll command is issued. */ - bx_bool rotate_on_autoeoi; /* Set when should rotate in auto-eoi mode. */ + bool special_mask; + bool polled; /* Set when poll command is issued. */ + bool rotate_on_autoeoi; /* Set when should rotate in auto-eoi mode. */ Bit8u edge_level; /* bitmap for irq mode (0=edge, 1=level) */ } bx_pic_t; @@ -69,7 +69,7 @@ public: virtual void reset(unsigned type); virtual void lower_irq(unsigned irq_no); virtual void raise_irq(unsigned irq_no); - virtual void set_mode(bx_bool ma_sl, Bit8u mode); + virtual void set_mode(bool ma_sl, Bit8u mode); virtual Bit8u IAC(void); #if BX_DEBUGGER virtual void debug_dump(int argc, char **argv); diff --git a/bochs/iodev/pit.cc b/bochs/iodev/pit.cc index 5ee13ab78..de9c14165 100644 --- a/bochs/iodev/pit.cc +++ b/bochs/iodev/pit.cc @@ -241,7 +241,7 @@ Bit32u bx_pit_c::read(Bit32u address, unsigned io_len) #else UNUSED(this_ptr); #endif // !BX_USE_PIT_SMF - bx_bool refresh_clock_div2; + bool refresh_clock_div2; Bit8u value = 0; handle_timer(); @@ -263,7 +263,7 @@ Bit32u bx_pit_c::read(Bit32u address, unsigned io_len) case 0x61: /* AT, port 61h */ - refresh_clock_div2 = (bx_bool)((bx_virt_timer.time_usec(BX_PIT_THIS is_realtime) / 15) & 1); + refresh_clock_div2 = (bool)((bx_virt_timer.time_usec(BX_PIT_THIS is_realtime) / 15) & 1); value = (BX_PIT_THIS s.timer.read_OUT(2) << 5) | (refresh_clock_div2 << 4) | (BX_PIT_THIS s.speaker_data_on << 1) | @@ -297,7 +297,7 @@ void bx_pit_c::write(Bit32u address, Bit32u dvalue, unsigned io_len) Bit64u my_time_usec = bx_virt_timer.time_usec(BX_PIT_THIS is_realtime); Bit64u time_passed = my_time_usec-BX_PIT_THIS s.last_usec; Bit32u value32, time_passed32 = (Bit32u)time_passed; - bx_bool new_speaker_active, new_speaker_level; + bool new_speaker_active, new_speaker_level; if (time_passed32) { periodic(time_passed32); @@ -378,7 +378,7 @@ void bx_pit_c::write(Bit32u address, Bit32u dvalue, unsigned io_len) } -bx_bool bx_pit_c::periodic(Bit32u usec_delta) +bool bx_pit_c::periodic(Bit32u usec_delta) { Bit32u ticks_delta = 0; @@ -404,7 +404,7 @@ bx_bool bx_pit_c::periodic(Bit32u usec_delta) return 0; } -void bx_pit_c::irq_handler(bx_bool value) +void bx_pit_c::irq_handler(bool value) { if (BX_PIT_THIS s.irq_enabled) { if (value == 1) { @@ -415,7 +415,7 @@ void bx_pit_c::irq_handler(bx_bool value) } } -void bx_pit_c::speaker_handler(bx_bool value) +void bx_pit_c::speaker_handler(bool value) { if (BX_PIT_THIS s.timer.get_mode(2) != 3) { DEV_speaker_set_line(value & BX_PIT_THIS s.speaker_data_on); diff --git a/bochs/iodev/pit.h b/bochs/iodev/pit.h index aa35e3043..4e1d2684a 100644 --- a/bochs/iodev/pit.h +++ b/bochs/iodev/pit.h @@ -2,7 +2,7 @@ // $Id$ ///////////////////////////////////////////////////////////////////////// // -// Copyright (C) 2001-2018 The Bochs Project +// Copyright (C) 2001-2021 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 @@ -40,7 +40,7 @@ public: virtual void reset(unsigned type); virtual void register_state(void); virtual void after_restore_state(void); - virtual void enable_irq(bx_bool enabled) { + virtual void enable_irq(bool enabled) { s.irq_enabled = enabled; } #if BX_DEBUGGER @@ -57,25 +57,25 @@ private: struct s_type { pit_82C54 timer; - bx_bool speaker_data_on; - bx_bool speaker_active; - bx_bool speaker_level; + bool speaker_data_on; + bool speaker_active; + bool speaker_level; Bit64u last_usec; Bit32u last_next_event_time; Bit64u total_ticks; Bit64u total_usec; int timer_handle[3]; - bx_bool irq_enabled; + bool irq_enabled; } s; - bx_bool is_realtime; + bool is_realtime; static void timer_handler(void *this_ptr); BX_PIT_SMF void handle_timer(); - BX_PIT_SMF bx_bool periodic(Bit32u usec_delta); + BX_PIT_SMF bool periodic(Bit32u usec_delta); - BX_PIT_SMF void irq_handler(bx_bool value); - BX_PIT_SMF void speaker_handler(bx_bool value); + BX_PIT_SMF void irq_handler(bool value); + BX_PIT_SMF void speaker_handler(bool value); BX_PIT_SMF Bit16u get_timer(int Timer); BX_PIT_SMF Bit16u new_timer_count(int Timer); diff --git a/bochs/iodev/pit82c54.cc b/bochs/iodev/pit82c54.cc index 109902c55..d42641774 100644 --- a/bochs/iodev/pit82c54.cc +++ b/bochs/iodev/pit82c54.cc @@ -111,7 +111,7 @@ void pit_82C54::latch_counter(counter_type &thisctr) } } -void pit_82C54::set_OUT(counter_type &thisctr, bx_bool data) +void pit_82C54::set_OUT(counter_type &thisctr, bool data) { if (thisctr.OUTpin != data) { thisctr.OUTpin = data; @@ -815,7 +815,7 @@ void pit_82C54::write(Bit8u address, Bit8u data) } } -void pit_82C54::set_GATE(Bit8u cnum, bx_bool data) +void pit_82C54::set_GATE(Bit8u cnum, bool data) { if (cnum>MAX_COUNTER) { BX_ERROR(("Counter number incorrect in 82C54 set_GATE")); @@ -914,7 +914,7 @@ void pit_82C54::set_GATE(Bit8u cnum, bx_bool data) } } -bx_bool pit_82C54::read_OUT(Bit8u cnum) +bool pit_82C54::read_OUT(Bit8u cnum) { if (cnum>MAX_COUNTER) { BX_ERROR(("Counter number incorrect in 82C54 read_OUT")); @@ -924,7 +924,7 @@ bx_bool pit_82C54::read_OUT(Bit8u cnum) return counter[cnum].OUTpin; } -bx_bool pit_82C54::read_GATE(Bit8u cnum) +bool pit_82C54::read_GATE(Bit8u cnum) { if (cnum>MAX_COUNTER) { BX_ERROR(("Counter number incorrect in 82C54 read_GATE")); @@ -963,7 +963,7 @@ Bit16u pit_82C54::get_inlatch(int counternum) return counter[counternum].inlatch; } -bx_bool pit_82C54::new_count_ready(int countnum) +bool pit_82C54::new_count_ready(int countnum) { return (counter[countnum].write_state != MSByte_multiple); } diff --git a/bochs/iodev/pit82c54.h b/bochs/iodev/pit82c54.h index 14c506f09..13c8aefea 100644 --- a/bochs/iodev/pit82c54.h +++ b/bochs/iodev/pit82c54.h @@ -2,7 +2,7 @@ // $Id$ ///////////////////////////////////////////////////////////////////////// // -// Copyright (C) 2001-2018 The Bochs Project +// Copyright (C) 2001-2021 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 @@ -26,7 +26,7 @@ #ifndef _PIT_82C54_H_ #define _PIT_82C54_H_ 1 -typedef void (*out_handler_t)(bx_bool value); +typedef void (*out_handler_t)(bool value); class pit_82C54 : public logfunctions { public: @@ -62,8 +62,8 @@ private: struct counter_type { //Chip IOs; - bx_bool GATE; //GATE Input value at end of cycle - bx_bool OUTpin; //OUT output this cycle + bool GATE; //GATE Input value at end of cycle + bool OUTpin; //OUT output this cycle //Architected state; Bit32u count; //Counter value this cycle @@ -74,23 +74,23 @@ private: //Status Register data; Bit8u rw_mode; //2-bit R/W mode from command word register. Bit8u mode; //3-bit mode from command word register. - bx_bool bcd_mode; //1-bit BCD vs. Binary setting. - bx_bool null_count; //Null count bit of status register. + bool bcd_mode; //1-bit BCD vs. Binary setting. + bool null_count; //Null count bit of status register. //Latch status data; - bx_bool count_LSB_latched; - bx_bool count_MSB_latched; - bx_bool status_latched; + bool count_LSB_latched; + bool count_MSB_latched; + bool status_latched; //Miscelaneous State; Bit32u count_binary; //Value of the count in binary. - bx_bool triggerGATE; //Whether we saw GATE rise this cycle. + bool triggerGATE; //Whether we saw GATE rise this cycle. rw_status write_state; //Read state this cycle rw_status read_state; //Read state this cycle - bx_bool count_written; //Whether a count written since programmed - bx_bool first_pass; //Whether or not this is the first loaded count. - bx_bool state_bit_1; //Miscelaneous state bits. - bx_bool state_bit_2; + bool count_written; //Whether a count written since programmed + bool first_pass; //Whether or not this is the first loaded count. + bool state_bit_1; //Miscelaneous state bits. + bool state_bit_2; Bit32u next_change_time; //Next time something besides count changes. //0 means never. out_handler_t out_handler; // OUT pin callback (for IRQ0) @@ -104,7 +104,7 @@ private: void latch_counter(counter_type & thisctr); - void set_OUT (counter_type & thisctr, bx_bool data); + void set_OUT (counter_type & thisctr, bool data); void set_count (counter_type & thisctr, Bit32u data) BX_CPP_AttrRegparmN(2); @@ -132,16 +132,16 @@ public: Bit8u read(Bit8u address); void write(Bit8u address, Bit8u data); - void set_GATE(Bit8u cnum, bx_bool data); - bx_bool read_GATE(Bit8u cnum); + void set_GATE(Bit8u cnum, bool data); + bool read_GATE(Bit8u cnum); - bx_bool read_OUT(Bit8u cnum); + bool read_OUT(Bit8u cnum); void set_OUT_handler(Bit8u cnum, out_handler_t outh); Bit32u get_clock_event_time(Bit8u cnum); Bit32u get_next_event_time(void); Bit16u get_inlatch(int countnum); - bx_bool new_count_ready(int countnum); + bool new_count_ready(int countnum); Bit8u get_mode(int countnum); void print_cnum(Bit8u cnum); diff --git a/bochs/iodev/usb/usb_ehci.cc b/bochs/iodev/usb/usb_ehci.cc index cc29cfe06..677fe0060 100644 --- a/bochs/iodev/usb/usb_ehci.cc +++ b/bochs/iodev/usb/usb_ehci.cc @@ -639,7 +639,7 @@ void bx_usb_ehci_c::change_port_owner(int port) } } -bx_bool bx_usb_ehci_c::read_handler(bx_phy_address addr, unsigned len, void *data, void *param) +bool bx_usb_ehci_c::read_handler(bx_phy_address addr, unsigned len, void *data, void *param) { Bit32u val = 0, val_hi = 0; int port; @@ -752,7 +752,7 @@ bx_bool bx_usb_ehci_c::read_handler(bx_phy_address addr, unsigned len, void *dat return 1; } -bx_bool bx_usb_ehci_c::write_handler(bx_phy_address addr, unsigned len, void *data, void *param) +bool bx_usb_ehci_c::write_handler(bx_phy_address addr, unsigned len, void *data, void *param) { Bit32u value = *((Bit32u *) data); Bit32u value_hi = *((Bit32u *) ((Bit8u *) data + 4)); diff --git a/bochs/iodev/usb/usb_ehci.h b/bochs/iodev/usb/usb_ehci.h index 93e626bae..347899946 100644 --- a/bochs/iodev/usb/usb_ehci.h +++ b/bochs/iodev/usb/usb_ehci.h @@ -4,7 +4,7 @@ // // Experimental USB EHCI adapter (partly ported from Qemu) // -// Copyright (C) 2015-2017 The Bochs Project +// Copyright (C) 2015-2021 The Bochs Project // // Copyright(c) 2008 Emutex Ltd. (address@hidden) // Copyright(c) 2011-2012 Red Hat, Inc. @@ -411,11 +411,11 @@ private: void ehci_frame_timer(void); #if BX_USE_USB_EHCI_SMF - static bx_bool read_handler(bx_phy_address addr, unsigned len, void *data, void *param); - static bx_bool write_handler(bx_phy_address addr, unsigned len, void *data, void *param); + static bool read_handler(bx_phy_address addr, unsigned len, void *data, void *param); + static bool write_handler(bx_phy_address addr, unsigned len, void *data, void *param); #else - bx_bool read_handler(bx_phy_address addr, unsigned len, void *data, void *param); - bx_bool write_handler(bx_phy_address addr, unsigned len, void *data, void *param); + bool read_handler(bx_phy_address addr, unsigned len, void *data, void *param); + bool write_handler(bx_phy_address addr, unsigned len, void *data, void *param); #endif static void runtime_config_handler(void *); diff --git a/bochs/iodev/usb/usb_ohci.cc b/bochs/iodev/usb/usb_ohci.cc index 7e12bfe71..e4c169e54 100644 --- a/bochs/iodev/usb/usb_ohci.cc +++ b/bochs/iodev/usb/usb_ohci.cc @@ -530,7 +530,7 @@ void bx_usb_ohci_c::set_interrupt(Bit32u value) update_irq(); } -bx_bool bx_usb_ohci_c::read_handler(bx_phy_address addr, unsigned len, void *data, void *param) +bool bx_usb_ohci_c::read_handler(bx_phy_address addr, unsigned len, void *data, void *param) { Bit32u val = 0x0; int p = 0; @@ -711,7 +711,7 @@ bx_bool bx_usb_ohci_c::read_handler(bx_phy_address addr, unsigned len, void *dat return 1; } -bx_bool bx_usb_ohci_c::write_handler(bx_phy_address addr, unsigned len, void *data, void *param) +bool bx_usb_ohci_c::write_handler(bx_phy_address addr, unsigned len, void *data, void *param) { Bit32u value = *((Bit32u *) data); Bit32u offset = (Bit32u)addr - BX_OHCI_THIS pci_bar[0].addr; diff --git a/bochs/iodev/usb/usb_ohci.h b/bochs/iodev/usb/usb_ohci.h index cfdb1f20f..7f7d63373 100644 --- a/bochs/iodev/usb/usb_ohci.h +++ b/bochs/iodev/usb/usb_ohci.h @@ -3,7 +3,7 @@ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2009-2016 Benjamin D Lunt (fys [at] fysnet [dot] net) -// 2009-2017 The Bochs Project +// 2009-2021 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 @@ -290,11 +290,11 @@ private: bx_bool process_td(struct OHCI_TD *, struct OHCI_ED *); #if BX_USE_USB_OHCI_SMF - static bx_bool read_handler(bx_phy_address addr, unsigned len, void *data, void *param); - static bx_bool write_handler(bx_phy_address addr, unsigned len, void *data, void *param); + static bool read_handler(bx_phy_address addr, unsigned len, void *data, void *param); + static bool write_handler(bx_phy_address addr, unsigned len, void *data, void *param); #else - bx_bool read_handler(bx_phy_address addr, unsigned len, void *data, void *param); - bx_bool write_handler(bx_phy_address addr, unsigned len, void *data, void *param); + bool read_handler(bx_phy_address addr, unsigned len, void *data, void *param); + bool write_handler(bx_phy_address addr, unsigned len, void *data, void *param); #endif static void runtime_config_handler(void *); diff --git a/bochs/iodev/usb/usb_xhci.cc b/bochs/iodev/usb/usb_xhci.cc index bb865fe09..d2af2ed3c 100644 --- a/bochs/iodev/usb/usb_xhci.cc +++ b/bochs/iodev/usb/usb_xhci.cc @@ -1017,7 +1017,7 @@ void bx_usb_xhci_c::update_irq(unsigned interrupter) DEV_pci_set_irq(BX_XHCI_THIS devfunc, BX_XHCI_THIS pci_conf[0x3d], level); } -bx_bool bx_usb_xhci_c::read_handler(bx_phy_address addr, unsigned len, void *data, void *param) +bool bx_usb_xhci_c::read_handler(bx_phy_address addr, unsigned len, void *data, void *param) { Bit32u val = 0, val_hi = 0; int i, speed = 0; @@ -1375,7 +1375,7 @@ bx_bool bx_usb_xhci_c::read_handler(bx_phy_address addr, unsigned len, void *dat return 1; } -bx_bool bx_usb_xhci_c::write_handler(bx_phy_address addr, unsigned len, void *data, void *param) +bool bx_usb_xhci_c::write_handler(bx_phy_address addr, unsigned len, void *data, void *param) { Bit32u value = *((Bit32u *) data); Bit32u value_hi = *((Bit32u *) ((Bit8u *) data + 4)); diff --git a/bochs/iodev/usb/usb_xhci.h b/bochs/iodev/usb/usb_xhci.h index 015441092..6db359ea7 100644 --- a/bochs/iodev/usb/usb_xhci.h +++ b/bochs/iodev/usb/usb_xhci.h @@ -3,7 +3,7 @@ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2010-2017 Benjamin D Lunt (fys [at] fysnet [dot] net) -// 2011-2017 The Bochs Project +// 2011-2021 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 @@ -596,11 +596,11 @@ private: static void dump_xhci_core(const int slots, const int eps); #if BX_USE_USB_XHCI_SMF - static bx_bool read_handler(bx_phy_address addr, unsigned len, void *data, void *param); - static bx_bool write_handler(bx_phy_address addr, unsigned len, void *data, void *param); + static bool read_handler(bx_phy_address addr, unsigned len, void *data, void *param); + static bool write_handler(bx_phy_address addr, unsigned len, void *data, void *param); #else - bx_bool read_handler(bx_phy_address addr, unsigned len, void *data, void *param); - bx_bool write_handler(bx_phy_address addr, unsigned len, void *data, void *param); + bool read_handler(bx_phy_address addr, unsigned len, void *data, void *param); + bool write_handler(bx_phy_address addr, unsigned len, void *data, void *param); #endif static void runtime_config_handler(void *); diff --git a/bochs/iodev/virt_timer.cc b/bochs/iodev/virt_timer.cc index eac7575b6..552647152 100644 --- a/bochs/iodev/virt_timer.cc +++ b/bochs/iodev/virt_timer.cc @@ -2,7 +2,7 @@ // $Id$ ///////////////////////////////////////////////////////////////////////// // -// Copyright (C) 2002-2014 The Bochs Project +// Copyright (C) 2002-2021 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 @@ -128,7 +128,7 @@ void bx_virt_timer_c::nullTimer(void* this_ptr) UNUSED(this_ptr); } -void bx_virt_timer_c::periodic(Bit64u time_passed, bx_bool mode) +void bx_virt_timer_c::periodic(Bit64u time_passed, bool mode) { //Assert that we haven't skipped any events. BX_ASSERT (time_passed <= s[mode].timers_next_event_time); @@ -184,7 +184,7 @@ void bx_virt_timer_c::periodic(Bit64u time_passed, bx_bool mode) //Get the current virtual time. // This may return the same value on subsequent calls. -Bit64u bx_virt_timer_c::time_usec(bx_bool mode) +Bit64u bx_virt_timer_c::time_usec(bool mode) { //Update the time here only if we're not in a timer handler. //If we're in a timer handler we're up-to-date, and otherwise @@ -198,7 +198,7 @@ Bit64u bx_virt_timer_c::time_usec(bx_bool mode) //Get the current virtual time. // This will return a monotonically increasing value. // MUST NOT be called from within a timer interrupt. -Bit64u bx_virt_timer_c::time_usec_sequential(bx_bool mode) +Bit64u bx_virt_timer_c::time_usec_sequential(bool mode) { //Can't prevent call stack loops here, so this // MUST NOT be called from within a timer handler. @@ -216,8 +216,8 @@ Bit64u bx_virt_timer_c::time_usec_sequential(bx_bool mode) //Register a timer handler to go off after a given interval. //Register a timer handler to go off with a periodic interval. int bx_virt_timer_c::register_timer(void *this_ptr, bx_timer_handler_t handler, - Bit32u useconds, bx_bool continuous, - bx_bool active, bx_bool realtime, + Bit32u useconds, bool continuous, + bool active, bool realtime, const char *id) { //We don't like starting with a zero period timer. @@ -259,7 +259,7 @@ int bx_virt_timer_c::register_timer(void *this_ptr, bx_timer_handler_t handler, } //unregister a previously registered timer. -bx_bool bx_virt_timer_c::unregisterTimer(unsigned timerID) +bool bx_virt_timer_c::unregisterTimer(unsigned timerID) { BX_ASSERT(timerID < BX_MAX_VIRTUAL_TIMERS); @@ -281,14 +281,14 @@ void bx_virt_timer_c::start_timers(void) //activate a deactivated but registered timer. void bx_virt_timer_c::activate_timer(unsigned timer_index, Bit32u useconds, - bx_bool continuous) + bool continuous) { BX_ASSERT(timer_index < BX_MAX_VIRTUAL_TIMERS); BX_ASSERT(timer[timer_index].inUse); BX_ASSERT(useconds>0); - bx_bool realtime = timer[timer_index].realtime; + bool realtime = timer[timer_index].realtime; timer[timer_index].period = useconds; timer[timer_index].timeToFire = s[realtime].current_timers_time + (Bit64u)useconds; timer[timer_index].active = 1; @@ -310,7 +310,7 @@ void bx_virt_timer_c::deactivate_timer(unsigned timer_index) timer[timer_index].active = 0; } -void bx_virt_timer_c::advance_virtual_time(Bit64u time_passed, bx_bool mode) +void bx_virt_timer_c::advance_virtual_time(Bit64u time_passed, bool mode) { BX_ASSERT(time_passed <= s[mode].virtual_next_event_time); @@ -323,7 +323,7 @@ void bx_virt_timer_c::advance_virtual_time(Bit64u time_passed, bx_bool mode) } //Called when next_event_time changes. -void bx_virt_timer_c::next_event_time_update(bx_bool mode) +void bx_virt_timer_c::next_event_time_update(bool mode) { s[mode].virtual_next_event_time = s[mode].timers_next_event_time + s[mode].current_timers_time - s[mode].current_virtual_time; if (init_done) { @@ -423,7 +423,7 @@ void bx_virt_timer_c::register_state(void) BXRS_DEC_PARAM_SIMPLE(list, ticks_per_second); } -void bx_virt_timer_c::timer_handler(bx_bool mode) +void bx_virt_timer_c::timer_handler(bool mode) { if (!mode) { Bit64u temp_final_time = bx_pc_system.time_usec(); diff --git a/bochs/iodev/virt_timer.h b/bochs/iodev/virt_timer.h index a257ca4f9..9357a1e60 100644 --- a/bochs/iodev/virt_timer.h +++ b/bochs/iodev/virt_timer.h @@ -2,7 +2,7 @@ // $Id$ ///////////////////////////////////////////////////////////////////////// // -// Copyright (C) 2002-2014 The Bochs Project +// Copyright (C) 2002-2021 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 @@ -33,12 +33,12 @@ class BOCHSAPI bx_virt_timer_c : public logfunctions { private: struct { - bx_bool inUse; // Timer slot is in-use (currently registered). + bool inUse; // Timer slot is in-use (currently registered). Bit64u period; // Timer periodocity in virtual useconds. Bit64u timeToFire; // Time to fire next (in virtual useconds). - bx_bool active; // 0=inactive, 1=active. - bx_bool continuous; // 0=one-shot timer, 1=continuous periodicity. - bx_bool realtime; // 0=standard timer, 1=use realtime mode + bool active; // 0=inactive, 1=active. + bool continuous; // 0=one-shot timer, 1=continuous periodicity. + bool realtime; // 0=standard timer, 1=use realtime mode bx_timer_handler_t funct; // A callback function for when the // timer fires. // This function MUST return. @@ -62,12 +62,12 @@ private: int system_timer_id; } s[2]; - bx_bool in_timer_handler; + bool in_timer_handler; // Local copy of IPS value Bit64u ips; - bx_bool init_done; + bool init_done; //Real time variables: Bit64u last_real_time; @@ -93,14 +93,14 @@ private: static void nullTimer(void* this_ptr); //Step the given number of cycles, optionally calling any timer handlers. - void periodic(Bit64u time_passed, bx_bool mode); + void periodic(Bit64u time_passed, bool mode); //Called when next_event_time changes. - void next_event_time_update(bx_bool mode); + void next_event_time_update(bool mode); //Called to advance the virtual time. // calls periodic as needed. - void advance_virtual_time(Bit64u time_passed, bx_bool mode); + void advance_virtual_time(Bit64u time_passed, bool mode); public: @@ -109,27 +109,27 @@ public: //Get the current virtual time. // This may return the same value on subsequent calls. - Bit64u time_usec(bx_bool mode); + Bit64u time_usec(bool mode); //Get the current virtual time. // This will return a monotonically increasing value. // MUST NOT be called from within a timer handler. - Bit64u time_usec_sequential(bx_bool mode); + Bit64u time_usec_sequential(bool mode); //Register a timer handler to go off after a given interval. //Register a timer handler to go off with a periodic interval. int register_timer(void *this_ptr, bx_timer_handler_t handler, - Bit32u useconds, bx_bool continuous, - bx_bool active, bx_bool realtime, const char *id); + Bit32u useconds, bool continuous, + bool active, bool realtime, const char *id); //unregister a previously registered timer. - bx_bool unregisterTimer(unsigned timerID); + bool unregisterTimer(unsigned timerID); void start_timers(void); //activate a deactivated but registered timer. void activate_timer(unsigned timer_index, Bit32u useconds, - bx_bool continuous); + bool continuous); //deactivate (but don't unregister) a currently registered timer. void deactivate_timer(unsigned timer_index); @@ -140,7 +140,7 @@ public: static void pc_system_timer_handler_1(void* this_ptr); //The real timer handler. - void timer_handler(bx_bool mode); + void timer_handler(bool mode); //Initialization step #1 in constructor and for cleanup void setup(void); diff --git a/bochs/memory/memory-bochs.h b/bochs/memory/memory-bochs.h index 914929ce4..4241a88a4 100644 --- a/bochs/memory/memory-bochs.h +++ b/bochs/memory/memory-bochs.h @@ -2,7 +2,7 @@ // $Id$ ///////////////////////////////////////////////////////////////////////// // -// Copyright (C) 2001-2020 The Bochs Project +// Copyright (C) 2001-2021 The Bochs Project // // I/O memory handlers API Copyright (C) 2003 by Frank Cornelis // @@ -64,7 +64,7 @@ enum memory_area_t { BX_MEM_AREA_F0000 }; -typedef bx_bool (*memory_handler_t)(bx_phy_address addr, unsigned len, void *data, void *param); +typedef bool (*memory_handler_t)(bx_phy_address addr, unsigned len, void *data, void *param); // return a pointer to 4K region containing or NULL if direct access is not allowed // same format as getHostMemAddr method typedef Bit8u* (*memory_direct_access_handler_t)(bx_phy_address addr, unsigned rw, void *param); @@ -98,8 +98,8 @@ private: Bit8u **blocks; Bit8u *rom; // 512k BIOS rom space + 128k expansion rom space Bit8u *bogus; // 4k for unexisting memory - bool rom_present[65]; - bx_bool memory_type[13][2]; + bool rom_present[65]; + bool memory_type[13][2]; Bit32u bios_rom_addr; Bit8u bios_rom_access; Bit8u flash_type;