Changed bx_bool to bool type in some more device and the developer doc.
This commit is contained in:
parent
45e03f9572
commit
093b274b53
@ -751,11 +751,11 @@ Here are the timer-related definitions and members in <filename>pc_system.h</fil
|
||||
typedef void (*bx_timer_handler_t)(void *);
|
||||
|
||||
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 cpu ticks.
|
||||
Bit64u timeToFire; // Time to fire next (in absolute ticks).
|
||||
bx_bool active; // 0=inactive, 1=active.
|
||||
bx_bool continuous; // 0=one-shot timer, 1=continuous periodicity.
|
||||
bool active; // 0=inactive, 1=active.
|
||||
bool continuous; // 0=one-shot timer, 1=continuous periodicity.
|
||||
bx_timer_handler_t funct; // A callback function for when the
|
||||
// timer fires.
|
||||
void *this_ptr; // The this-> pointer for C++ callbacks
|
||||
@ -788,11 +788,11 @@ class:
|
||||
<screen>
|
||||
void initialize(Bit32u ips);
|
||||
int register_timer(void *this_ptr, bx_timer_handler_t, Bit32u useconds,
|
||||
bx_bool continuous, bx_bool active, const char *id);
|
||||
bx_bool unregisterTimer(unsigned timerID);
|
||||
bool continuous, bool active, const char *id);
|
||||
bool unregisterTimer(unsigned timerID);
|
||||
void setTimerParam(unsigned timerID, Bit32u param);
|
||||
void start_timers(void);
|
||||
void activate_timer(unsigned timer_index, Bit32u useconds, bx_bool continuous);
|
||||
void activate_timer(unsigned timer_index, Bit32u useconds, bool continuous);
|
||||
void deactivate_timer(unsigned timer_index);
|
||||
unsigned triggeredTimerID(void) {
|
||||
return triggeredTimer;
|
||||
@ -818,9 +818,9 @@ class:
|
||||
}
|
||||
|
||||
int register_timer_ticks(void* this_ptr, bx_timer_handler_t, Bit64u ticks,
|
||||
bx_bool continuous, bx_bool active, const char *id);
|
||||
bool continuous, bool active, const char *id);
|
||||
void activate_timer_ticks(unsigned index, Bit64u instructions,
|
||||
bx_bool continuous);
|
||||
bool continuous);
|
||||
Bit64u time_usec();
|
||||
Bit64u time_usec_sequential();
|
||||
static BX_CPP_INLINE Bit64u time_ticks() {
|
||||
@ -1315,7 +1315,7 @@ public:
|
||||
virtual int register_wave_callback(void *, get_wave_cb_t wd_cb);
|
||||
virtual void unregister_wave_callback(int callback_id);
|
||||
|
||||
virtual bx_bool mixer_common(Bit8u *buffer, int len);
|
||||
virtual bool mixer_common(Bit8u *buffer, int len);
|
||||
protected:
|
||||
void convert_pcm_data(Bit8u *src, int srcsize, Bit8u *dst, int dstsize, bx_pcm_param_t *param);
|
||||
void start_mixer_thread(void);
|
||||
@ -1683,7 +1683,7 @@ Parameter:
|
||||
</itemizedlist>
|
||||
</section>
|
||||
|
||||
<section><title>bx_bool mixer_common(Bit8u *buffer, int len)</title>
|
||||
<section><title>bool mixer_common(Bit8u *buffer, int len)</title>
|
||||
<para>
|
||||
This is the main wave output mixing function. It is called from the mixer
|
||||
thread, it polls the wave data from all registered sources and it mixes the
|
||||
@ -2456,7 +2456,7 @@ returns the value of the "timestamp" field in the header (only used by the
|
||||
"undoable" mode).
|
||||
</para>
|
||||
<para>
|
||||
<emphasis>bx_bool set_timestamp(Bit32u timestamp);</emphasis>
|
||||
<emphasis>bool set_timestamp(Bit32u timestamp);</emphasis>
|
||||
writes the <emphasis>timestamp</emphasis> to the header. This is done
|
||||
by the "undoable" mode init code if <emphasis>get_timestamp()</emphasis> returns
|
||||
0 or the redolog is newly created.
|
||||
@ -2469,7 +2469,7 @@ matches the requested one. This is used for for the image mode autodetection
|
||||
feature.
|
||||
</para>
|
||||
<para>
|
||||
<emphasis>bx_bool save_state(const char *backup_fname);</emphasis>
|
||||
<emphasis>bool save_state(const char *backup_fname);</emphasis>
|
||||
copies the redolog file to a new file <emphasis>backup_fname</emphasis>. This is
|
||||
used by the hdimage save/restore feature.
|
||||
</para>
|
||||
@ -2583,7 +2583,7 @@ Data will always be written to the redolog.
|
||||
|
||||
<para>
|
||||
<emphasis>
|
||||
bx_bool save_state(const char *backup_fname);
|
||||
bool save_state(const char *backup_fname);
|
||||
</emphasis>
|
||||
calls the related redolog_t method to save the image state.
|
||||
</para>
|
||||
@ -2667,7 +2667,7 @@ Data will always be written to the redolog.
|
||||
|
||||
<para>
|
||||
<emphasis>
|
||||
bx_bool save_state(const char *backup_fname);
|
||||
bool save_state(const char *backup_fname);
|
||||
</emphasis>
|
||||
calls the related redolog_t method to save the image state.
|
||||
</para>
|
||||
|
@ -947,7 +947,7 @@ void bx_e1000_c::write(Bit32u address, Bit32u value, unsigned io_len)
|
||||
BX_ERROR(("register write to offset 0x%02x ignored - value = 0x%08x", offset, value));
|
||||
}
|
||||
|
||||
void bx_e1000_c::set_irq_level(bx_bool level)
|
||||
void bx_e1000_c::set_irq_level(bool level)
|
||||
{
|
||||
DEV_pci_set_irq(BX_E1000_THIS s.devfunc, BX_E1000_THIS pci_conf[0x3d], level);
|
||||
}
|
||||
@ -1099,22 +1099,22 @@ void bx_e1000_c::putsum(Bit8u *data, Bit32u n, Bit32u sloc, Bit32u css, Bit32u c
|
||||
}
|
||||
}
|
||||
|
||||
bx_bool bx_e1000_c::vlan_enabled()
|
||||
bool bx_e1000_c::vlan_enabled()
|
||||
{
|
||||
return ((BX_E1000_THIS s.mac_reg[CTRL] & E1000_CTRL_VME) != 0);
|
||||
}
|
||||
|
||||
bx_bool bx_e1000_c::vlan_rx_filter_enabled()
|
||||
bool bx_e1000_c::vlan_rx_filter_enabled()
|
||||
{
|
||||
return ((BX_E1000_THIS s.mac_reg[RCTL] & E1000_RCTL_VFE) != 0);
|
||||
}
|
||||
|
||||
bx_bool bx_e1000_c::is_vlan_packet(const Bit8u *buf)
|
||||
bool bx_e1000_c::is_vlan_packet(const Bit8u *buf)
|
||||
{
|
||||
return (get_net2(buf + 12) == (Bit16u)BX_E1000_THIS s.mac_reg[VET]);
|
||||
}
|
||||
|
||||
bx_bool bx_e1000_c::is_vlan_txd(Bit32u txd_lower)
|
||||
bool bx_e1000_c::is_vlan_txd(Bit32u txd_lower)
|
||||
{
|
||||
return ((txd_lower & E1000_TXD_CMD_VLE) != 0);
|
||||
}
|
||||
@ -1387,7 +1387,7 @@ int bx_e1000_c::receive_filter(const Bit8u *buf, int size)
|
||||
return 0;
|
||||
}
|
||||
|
||||
bx_bool bx_e1000_c::e1000_has_rxbufs(size_t total_size)
|
||||
bool bx_e1000_c::e1000_has_rxbufs(size_t total_size)
|
||||
{
|
||||
int bufs;
|
||||
// Fast-path short packets
|
||||
|
@ -64,7 +64,7 @@ typedef struct {
|
||||
Bit8u *data;
|
||||
Bit16u size;
|
||||
Bit8u sum_needed;
|
||||
bx_bool vlan_needed;
|
||||
bool vlan_needed;
|
||||
Bit8u ipcss;
|
||||
Bit8u ipcso;
|
||||
Bit16u ipcse;
|
||||
@ -75,10 +75,10 @@ typedef struct {
|
||||
Bit16u mss;
|
||||
Bit32u paylen;
|
||||
Bit16u tso_frames;
|
||||
bx_bool tse;
|
||||
bx_bool ip;
|
||||
bx_bool tcp;
|
||||
bx_bool cptse; // current packet tse bit
|
||||
bool tse;
|
||||
bool ip;
|
||||
bool tcp;
|
||||
bool cptse; // current packet tse bit
|
||||
Bit32u int_cause;
|
||||
} e1000_tx;
|
||||
|
||||
@ -89,7 +89,7 @@ typedef struct {
|
||||
|
||||
Bit32u rxbuf_size;
|
||||
Bit32u rxbuf_min_shift;
|
||||
bx_bool check_rxov;
|
||||
bool check_rxov;
|
||||
|
||||
e1000_tx tx;
|
||||
|
||||
@ -97,7 +97,7 @@ typedef struct {
|
||||
Bit32u val_in; // shifted in from guest driver
|
||||
Bit16u bitnum_in;
|
||||
Bit16u bitnum_out;
|
||||
bx_bool reading;
|
||||
bool reading;
|
||||
Bit32u old_eecd;
|
||||
} eecd_state;
|
||||
|
||||
@ -126,7 +126,7 @@ private:
|
||||
|
||||
eth_pktmover_c *ethdev;
|
||||
|
||||
void set_irq_level(bx_bool level);
|
||||
void set_irq_level(bool level);
|
||||
void set_interrupt_cause(Bit32u val);
|
||||
void set_ics(Bit32u value);
|
||||
int rxbufsize(Bit32u v);
|
||||
@ -136,10 +136,10 @@ private:
|
||||
void set_eecd(Bit32u value);
|
||||
Bit32u flash_eerd_read(void);
|
||||
void putsum(Bit8u *data, Bit32u n, Bit32u sloc, Bit32u css, Bit32u cse);
|
||||
bx_bool vlan_enabled(void);
|
||||
bx_bool vlan_rx_filter_enabled(void);
|
||||
bx_bool is_vlan_packet(const Bit8u *buf);
|
||||
bx_bool is_vlan_txd(Bit32u txd_lower);
|
||||
bool vlan_enabled(void);
|
||||
bool vlan_rx_filter_enabled(void);
|
||||
bool is_vlan_packet(const Bit8u *buf);
|
||||
bool is_vlan_txd(Bit32u txd_lower);
|
||||
int fcs_len(void);
|
||||
void xmit_seg(void);
|
||||
void process_tx_desc(struct e1000_tx_desc *dp);
|
||||
@ -151,7 +151,7 @@ private:
|
||||
void tx_timer(void);
|
||||
|
||||
int receive_filter(const Bit8u *buf, int size);
|
||||
bx_bool e1000_has_rxbufs(size_t total_size);
|
||||
bool e1000_has_rxbufs(size_t total_size);
|
||||
Bit64u rx_desc_base(void);
|
||||
|
||||
static Bit32u rx_status_handler(void *arg);
|
||||
|
@ -86,9 +86,9 @@ private:
|
||||
#endif
|
||||
char *pktlog_fn;
|
||||
FILE *pktlog_txt;
|
||||
bx_bool slirp_logging;
|
||||
bool slirp_logging;
|
||||
|
||||
bx_bool parse_slirp_conf(const char *conf);
|
||||
bool parse_slirp_conf(const char *conf);
|
||||
static void rx_timer_handler(void *);
|
||||
};
|
||||
|
||||
@ -139,12 +139,12 @@ bx_slirp_pktmover_c::~bx_slirp_pktmover_c()
|
||||
}
|
||||
}
|
||||
|
||||
bx_bool bx_slirp_pktmover_c::parse_slirp_conf(const char *conf)
|
||||
bool bx_slirp_pktmover_c::parse_slirp_conf(const char *conf)
|
||||
{
|
||||
FILE *fd = NULL;
|
||||
char line[512];
|
||||
char *ret, *param, *val, *tmp;
|
||||
bx_bool format_checked = 0;
|
||||
bool format_checked = 0;
|
||||
size_t len1 = 0, len2;
|
||||
unsigned i, count;
|
||||
|
||||
|
@ -85,7 +85,7 @@ public:
|
||||
virtual ~bx_vnet_pktmover_c();
|
||||
void sendpkt(void *buf, unsigned io_len);
|
||||
private:
|
||||
bx_bool parse_vnet_conf(const char *conf);
|
||||
bool parse_vnet_conf(const char *conf);
|
||||
void guest_to_host(const Bit8u *buf, unsigned io_len);
|
||||
void host_to_guest(void);
|
||||
|
||||
@ -98,11 +98,11 @@ private:
|
||||
void rx_timer(void);
|
||||
|
||||
int rx_timer_index;
|
||||
bx_bool rx_timer_pending;
|
||||
bool rx_timer_pending;
|
||||
unsigned netdev_speed;
|
||||
unsigned tx_time;
|
||||
|
||||
bx_bool vnet_logging;
|
||||
bool vnet_logging;
|
||||
char *pktlog_fn;
|
||||
FILE *pktlog_txt;
|
||||
#if BX_ETH_VNET_PCAP_LOGGING
|
||||
@ -124,7 +124,7 @@ protected:
|
||||
} bx_vnet_match;
|
||||
|
||||
|
||||
bx_bool get_ipv4_address(char *value, Bit8u *addr)
|
||||
bool get_ipv4_address(char *value, Bit8u *addr)
|
||||
{
|
||||
unsigned tmp[4];
|
||||
|
||||
@ -140,12 +140,12 @@ bx_bool get_ipv4_address(char *value, Bit8u *addr)
|
||||
return 0;
|
||||
}
|
||||
|
||||
bx_bool bx_vnet_pktmover_c::parse_vnet_conf(const char *conf)
|
||||
bool bx_vnet_pktmover_c::parse_vnet_conf(const char *conf)
|
||||
{
|
||||
FILE *fd = NULL;
|
||||
char line[512];
|
||||
char *ret, *param, *val;
|
||||
bx_bool format_checked = 0;
|
||||
bool format_checked = 0;
|
||||
size_t len1 = 0, len2;
|
||||
Bit8u tmp_ipv4addr[4];
|
||||
|
||||
|
@ -116,7 +116,7 @@ eth_locator_c::~eth_locator_c()
|
||||
}
|
||||
}
|
||||
|
||||
bx_bool eth_locator_c::module_present(const char *type)
|
||||
bool eth_locator_c::module_present(const char *type)
|
||||
{
|
||||
eth_locator_c *ptr = 0;
|
||||
|
||||
@ -194,7 +194,7 @@ int execute_script(bx_devmodel_c *netdev, const char* scriptname, char* arg1)
|
||||
|
||||
#endif
|
||||
|
||||
void write_pktlog_txt(FILE *pktlog_txt, const Bit8u *buf, unsigned len, bx_bool host_to_guest)
|
||||
void write_pktlog_txt(FILE *pktlog_txt, const Bit8u *buf, unsigned len, bool host_to_guest)
|
||||
{
|
||||
Bit8u *charbuf = (Bit8u *)buf;
|
||||
Bit8u rawbuf[18];
|
||||
|
@ -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
|
||||
@ -87,7 +87,7 @@ typedef void (*eth_rx_handler_t)(void *arg, const void *buf, unsigned len);
|
||||
typedef Bit32u (*eth_rx_status_t)(void *arg);
|
||||
|
||||
int execute_script(bx_devmodel_c *netdev, const char *name, char* arg1);
|
||||
void BOCHSAPI_MSVCONLY write_pktlog_txt(FILE *pktlog_txt, const Bit8u *buf, unsigned len, bx_bool host_to_guest);
|
||||
void BOCHSAPI_MSVCONLY write_pktlog_txt(FILE *pktlog_txt, const Bit8u *buf, unsigned len, bool host_to_guest);
|
||||
size_t BOCHSAPI_MSVCONLY strip_whitespace(char *s);
|
||||
|
||||
//
|
||||
@ -116,7 +116,7 @@ protected:
|
||||
//
|
||||
class BOCHSAPI_MSVCONLY eth_locator_c {
|
||||
public:
|
||||
static bx_bool module_present(const char *type);
|
||||
static bool module_present(const char *type);
|
||||
static void cleanup();
|
||||
static eth_pktmover_c *create(const char *type, const char *netif,
|
||||
const char *macaddr,
|
||||
|
@ -2,7 +2,7 @@
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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
|
||||
@ -45,13 +45,13 @@
|
||||
#endif
|
||||
|
||||
typedef struct ftp_session {
|
||||
Bit8u state;
|
||||
bx_bool anonymous;
|
||||
Bit8u state;
|
||||
bool anonymous;
|
||||
Bit16u pasv_port;
|
||||
Bit16u client_cmd_port;
|
||||
Bit16u client_data_port;
|
||||
bx_bool ascii_mode;
|
||||
int data_xfer_fd;
|
||||
bool ascii_mode;
|
||||
int data_xfer_fd;
|
||||
unsigned data_xfer_size;
|
||||
unsigned data_xfer_pos;
|
||||
unsigned cmdcode;
|
||||
@ -270,7 +270,7 @@ void vnet_server_c::bx_printf(const char *fmt, ...)
|
||||
}
|
||||
#endif
|
||||
|
||||
bx_bool vnet_server_c::find_client(const Bit8u *mac_addr, Bit8u *clientid)
|
||||
bool vnet_server_c::find_client(const Bit8u *mac_addr, Bit8u *clientid)
|
||||
{
|
||||
for (Bit8u c = 0; c < VNET_MAX_CLIENTS; c++) {
|
||||
if (client[c].init) {
|
||||
@ -585,7 +585,7 @@ tcp_handler_t vnet_server_c::get_tcp_handler(unsigned port)
|
||||
return (tcp_handler_t)NULL;
|
||||
}
|
||||
|
||||
bx_bool vnet_server_c::register_tcp_handler(unsigned port, tcp_handler_t func)
|
||||
bool vnet_server_c::register_tcp_handler(unsigned port, tcp_handler_t func)
|
||||
{
|
||||
if (get_tcp_handler(port) != (tcp_handler_t)NULL) {
|
||||
BX_ERROR(("TCP port %u is already in use", port));
|
||||
@ -614,7 +614,7 @@ bx_bool vnet_server_c::register_tcp_handler(unsigned port, tcp_handler_t func)
|
||||
return 1;
|
||||
}
|
||||
|
||||
bx_bool vnet_server_c::unregister_tcp_handler(unsigned port)
|
||||
bool vnet_server_c::unregister_tcp_handler(unsigned port)
|
||||
{
|
||||
unsigned n;
|
||||
|
||||
@ -689,7 +689,7 @@ void vnet_server_c::process_tcpipv4(Bit8u clientid, Bit8u srv_id,
|
||||
const Bit8u *tcp_data;
|
||||
tcp_handler_t func;
|
||||
tcp_conn_t *tcp_conn;
|
||||
bx_bool tcp_error = 1;
|
||||
bool tcp_error = 1;
|
||||
Bit8u option, optlen;
|
||||
Bit16u value16;
|
||||
|
||||
@ -854,7 +854,7 @@ void vnet_server_c::host_to_guest_tcpipv4(Bit8u clientid, Bit8u srv_id,
|
||||
}
|
||||
|
||||
unsigned vnet_server_c::tcpipv4_send_data(tcp_conn_t *tcp_conn, const Bit8u *data,
|
||||
unsigned data_len, bx_bool push)
|
||||
unsigned data_len, bool push)
|
||||
{
|
||||
Bit8u sendbuf[BX_PACKET_BUFSIZE];
|
||||
tcp_header_t *tcphdr = (tcp_header_t *)&sendbuf[34];
|
||||
@ -911,7 +911,7 @@ void vnet_server_c::tcpipv4_send_ack(tcp_conn_t *tcp_conn, unsigned data_len)
|
||||
tcp_conn->src_port, replybuf, 0, tcphdr_len);
|
||||
}
|
||||
|
||||
void vnet_server_c::tcpipv4_send_fin(tcp_conn_t *tcp_conn, bx_bool host_fin)
|
||||
void vnet_server_c::tcpipv4_send_fin(tcp_conn_t *tcp_conn, bool host_fin)
|
||||
{
|
||||
Bit8u replybuf[MIN_RX_PACKET_LEN];
|
||||
tcp_header_t *tcphdr = (tcp_header_t *)&replybuf[34];
|
||||
@ -995,7 +995,7 @@ void ftp_remove_session(ftp_session_t *fs)
|
||||
|
||||
// FTP directory helper functions
|
||||
|
||||
bx_bool ftp_mkdir(const char *path)
|
||||
bool ftp_mkdir(const char *path)
|
||||
{
|
||||
#ifndef WIN32
|
||||
return (mkdir(path, 0755) == 0);
|
||||
@ -1004,7 +1004,7 @@ bx_bool ftp_mkdir(const char *path)
|
||||
#endif
|
||||
}
|
||||
|
||||
bx_bool ftp_rmdir(const char *path)
|
||||
bool ftp_rmdir(const char *path)
|
||||
{
|
||||
#ifndef WIN32
|
||||
return (rmdir(path) == 0);
|
||||
@ -1051,7 +1051,7 @@ enum {
|
||||
typedef struct {
|
||||
char name[8];
|
||||
unsigned code;
|
||||
bx_bool rw;
|
||||
bool rw;
|
||||
} ftp_cmd_t;
|
||||
|
||||
#define FTP_N_CMDS 28
|
||||
@ -1069,7 +1069,7 @@ const ftp_cmd_t ftpCmd[FTP_N_CMDS] = {
|
||||
{"USER", FTPCMD_USER, 0}
|
||||
};
|
||||
|
||||
unsigned ftp_get_command(const char *cmdstr, bx_bool anonuser)
|
||||
unsigned ftp_get_command(const char *cmdstr, bool anonuser)
|
||||
{
|
||||
unsigned n, cmdcode = FTPCMD_UNKNOWN;
|
||||
|
||||
@ -1099,7 +1099,7 @@ void vnet_server_c::tcpipv4_ftp_handler_ns(tcp_conn_t *tcp_conn, const Bit8u *da
|
||||
char reply[256];
|
||||
ftp_session_t *fs;
|
||||
const Bit8u *hostip;
|
||||
bx_bool pasv_port_ok, path_ok;
|
||||
bool pasv_port_ok, path_ok;
|
||||
tcp_conn_t *tcpc_cmd = NULL, *tcpc_data =NULL;
|
||||
char tmp_path[BX_PATHNAME_LEN];
|
||||
unsigned len;
|
||||
@ -1402,11 +1402,11 @@ void vnet_server_c::tcpipv4_ftp_handler_ns(tcp_conn_t *tcp_conn, const Bit8u *da
|
||||
}
|
||||
}
|
||||
|
||||
bx_bool vnet_server_c::ftp_file_exists(tcp_conn_t *tcpc_cmd, const char *arg,
|
||||
bool vnet_server_c::ftp_file_exists(tcp_conn_t *tcpc_cmd, const char *arg,
|
||||
char *path, unsigned *size)
|
||||
{
|
||||
ftp_session_t *fs = (ftp_session_t*)tcpc_cmd->data;
|
||||
bx_bool exists = 0, notfile = 1;
|
||||
bool exists = 0, notfile = 1;
|
||||
#ifndef WIN32
|
||||
struct stat stat_buf;
|
||||
#endif
|
||||
@ -1469,13 +1469,13 @@ bx_bool vnet_server_c::ftp_file_exists(tcp_conn_t *tcpc_cmd, const char *arg,
|
||||
return (exists && !notfile);
|
||||
}
|
||||
|
||||
bx_bool vnet_server_c::ftp_subdir_exists(tcp_conn_t *tcpc_cmd, const char *arg,
|
||||
bool vnet_server_c::ftp_subdir_exists(tcp_conn_t *tcpc_cmd, const char *arg,
|
||||
char *path)
|
||||
{
|
||||
ftp_session_t *fs = (ftp_session_t*)tcpc_cmd->data;
|
||||
char abspath[BX_PATHNAME_LEN];
|
||||
char relpath[BX_PATHNAME_LEN];
|
||||
bx_bool exists = 0, notdir = 1;
|
||||
bool exists = 0, notdir = 1;
|
||||
#ifndef WIN32
|
||||
DIR *dir;
|
||||
#endif
|
||||
@ -1617,7 +1617,7 @@ void vnet_server_c::ftp_list_directory(tcp_conn_t *tcpc_cmd, tcp_conn_t *tcpc_da
|
||||
char linebuf[BX_PATHNAME_LEN], tmptime[20];
|
||||
unsigned size = 0;
|
||||
int fd = -1;
|
||||
bx_bool nlst, hidden = 0;
|
||||
bool nlst, hidden = 0;
|
||||
#ifndef WIN32
|
||||
DIR *dir;
|
||||
struct dirent *dent;
|
||||
@ -1747,7 +1747,7 @@ void vnet_server_c::ftp_recv_file(tcp_conn_t *tcpc_cmd, tcp_conn_t *tcpc_data,
|
||||
char path[BX_PATHNAME_LEN], tmp_path[BX_PATHNAME_LEN+4], *cptr, reply[80];
|
||||
ftp_session_t *fs = (ftp_session_t*)tcpc_cmd->data;
|
||||
int fd = -1;
|
||||
bx_bool exists;
|
||||
bool exists;
|
||||
Bit8u n = 1;
|
||||
|
||||
exists = ftp_file_exists(tcpc_cmd, fname, path, NULL);
|
||||
@ -1820,7 +1820,7 @@ layer4_handler_t vnet_server_c::get_layer4_handler(
|
||||
return (layer4_handler_t)NULL;
|
||||
}
|
||||
|
||||
bx_bool vnet_server_c::register_layer4_handler(
|
||||
bool vnet_server_c::register_layer4_handler(
|
||||
unsigned ipprotocol, unsigned port,layer4_handler_t func)
|
||||
{
|
||||
if (get_layer4_handler(ipprotocol,port) != (layer4_handler_t)NULL) {
|
||||
@ -1852,7 +1852,7 @@ bx_bool vnet_server_c::register_layer4_handler(
|
||||
return true;
|
||||
}
|
||||
|
||||
bx_bool vnet_server_c::unregister_layer4_handler(
|
||||
bool vnet_server_c::unregister_layer4_handler(
|
||||
unsigned ipprotocol, unsigned port)
|
||||
{
|
||||
unsigned n;
|
||||
@ -1950,8 +1950,8 @@ int vnet_server_c::udpipv4_dhcp_handler_ns(const Bit8u *ipheader,
|
||||
unsigned extlen;
|
||||
const Bit8u *extdata;
|
||||
unsigned dhcpmsgtype = 0;
|
||||
bx_bool found_serverid = 0;
|
||||
bx_bool found_guest_ipaddr = 0;
|
||||
bool found_serverid = 0;
|
||||
bool found_guest_ipaddr = 0;
|
||||
Bit32u leasetime = BX_MAX_BIT32U;
|
||||
const Bit8u *dhcpreqparams = NULL;
|
||||
unsigned dhcpreqparams_len = 0;
|
||||
@ -2230,7 +2230,7 @@ int vnet_server_c::udpipv4_dhcp_handler_ns(const Bit8u *ipheader,
|
||||
|
||||
tftp_session_t *tftp_sessions = NULL;
|
||||
|
||||
tftp_session_t *tftp_new_session(Bit16u req_tid, bx_bool mode, const char *tpath, const char *tname)
|
||||
tftp_session_t *tftp_new_session(Bit16u req_tid, bool mode, const char *tpath, const char *tname)
|
||||
{
|
||||
tftp_session_t *s = new tftp_session_t;
|
||||
s->tid = req_tid;
|
||||
@ -2606,7 +2606,7 @@ int vnet_server_c::udpipv4_dns_handler_ns(const Bit8u *ipheader,
|
||||
Bit8u len1, p1, p2;
|
||||
Bit8u ipaddr[4];
|
||||
Bit16u val16[6], qtype, qclass;
|
||||
bx_bool host_found = 0;
|
||||
bool host_found = 0;
|
||||
int i, n, rlen = 0, tmpval[4];
|
||||
|
||||
for (i = 0; i < 6; i++) {
|
||||
|
@ -2,7 +2,7 @@
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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
|
||||
@ -178,7 +178,7 @@ Bit16u ip_checksum(const Bit8u *buf, unsigned buf_len);
|
||||
typedef struct tftp_session {
|
||||
char filename[BX_PATHNAME_LEN];
|
||||
Bit16u tid;
|
||||
bx_bool iswrite;
|
||||
bool iswrite;
|
||||
unsigned options;
|
||||
size_t tsize_val;
|
||||
unsigned blksize_val;
|
||||
@ -221,7 +221,7 @@ typedef struct tcp_conn {
|
||||
Bit32u guest_seq_num;
|
||||
Bit16u window;
|
||||
Bit8u state;
|
||||
bx_bool host_port_fin;
|
||||
bool host_port_fin;
|
||||
void *data;
|
||||
struct tcp_conn *next;
|
||||
} tcp_conn_t;
|
||||
@ -248,19 +248,19 @@ public:
|
||||
#endif
|
||||
|
||||
layer4_handler_t get_layer4_handler(unsigned ipprotocol, unsigned port);
|
||||
bx_bool register_layer4_handler(unsigned ipprotocol, unsigned port,
|
||||
layer4_handler_t func);
|
||||
bx_bool unregister_layer4_handler(unsigned ipprotocol, unsigned port);
|
||||
bool register_layer4_handler(unsigned ipprotocol, unsigned port,
|
||||
layer4_handler_t func);
|
||||
bool unregister_layer4_handler(unsigned ipprotocol, unsigned port);
|
||||
|
||||
tcp_handler_t get_tcp_handler(unsigned port);
|
||||
bx_bool register_tcp_handler(unsigned port, tcp_handler_t func);
|
||||
bx_bool unregister_tcp_handler(unsigned port);
|
||||
bool register_tcp_handler(unsigned port, tcp_handler_t func);
|
||||
bool unregister_tcp_handler(unsigned port);
|
||||
|
||||
private:
|
||||
#ifdef BXHUB
|
||||
void bx_printf(const char *fmt, ...);
|
||||
#endif
|
||||
bx_bool find_client(const Bit8u *mac_addr, Bit8u *clientid);
|
||||
bool find_client(const Bit8u *mac_addr, Bit8u *clientid);
|
||||
|
||||
void host_to_guest(Bit8u clientid, Bit8u *buf, unsigned len, unsigned l3type);
|
||||
|
||||
@ -280,17 +280,17 @@ private:
|
||||
Bit16u dst_port, Bit8u *data, unsigned data_len,
|
||||
unsigned hdr_len);
|
||||
unsigned tcpipv4_send_data(tcp_conn_t *tcp_conn, const Bit8u *data,
|
||||
unsigned data_len, bx_bool push);
|
||||
unsigned data_len, bool push);
|
||||
void tcpipv4_send_ack(tcp_conn_t *tcp_conn, unsigned data_len);
|
||||
void tcpipv4_send_fin(tcp_conn_t *tcp_conn, bx_bool host_fin);
|
||||
void tcpipv4_send_fin(tcp_conn_t *tcp_conn, bool host_fin);
|
||||
|
||||
static void tcpipv4_ftp_handler(void *this_ptr, tcp_conn_t *tcp_conn,
|
||||
const Bit8u *data, unsigned data_len);
|
||||
void tcpipv4_ftp_handler_ns(tcp_conn_t *tcp_conn, const Bit8u *data,
|
||||
unsigned data_len);
|
||||
bx_bool ftp_file_exists(tcp_conn_t *tcpc_cmd, const char *arg, char *path,
|
||||
unsigned *size);
|
||||
bx_bool ftp_subdir_exists(tcp_conn_t *tcpc_cmd, const char *arg, char *path);
|
||||
bool ftp_file_exists(tcp_conn_t *tcpc_cmd, const char *arg, char *path,
|
||||
unsigned *size);
|
||||
bool ftp_subdir_exists(tcp_conn_t *tcpc_cmd, const char *arg, char *path);
|
||||
void ftp_send_reply(tcp_conn_t *tcp_conn, const char *msg);
|
||||
void ftp_send_status(tcp_conn_t *tcp_conn);
|
||||
void ftp_send_data_prep(tcp_conn_t *tcpc_cmd, tcp_conn_t *tcpc_data,
|
||||
@ -335,7 +335,7 @@ private:
|
||||
const char *tftp_root;
|
||||
|
||||
struct {
|
||||
bx_bool init;
|
||||
bool init;
|
||||
const Bit8u *macaddr;
|
||||
Bit8u default_ipv4addr[4];
|
||||
Bit8u ipv4addr[4];
|
||||
|
@ -236,12 +236,12 @@ void bx_pcipnic_c::after_restore_state(void)
|
||||
bx_pci_device_c::after_restore_pci_state(mem_read_handler);
|
||||
}
|
||||
|
||||
void bx_pcipnic_c::set_irq_level(bx_bool level)
|
||||
void bx_pcipnic_c::set_irq_level(bool level)
|
||||
{
|
||||
DEV_pci_set_irq(BX_PNIC_THIS s.devfunc, BX_PNIC_THIS pci_conf[0x3d], level);
|
||||
}
|
||||
|
||||
bx_bool bx_pcipnic_c::mem_read_handler(bx_phy_address addr, unsigned len,
|
||||
bool bx_pcipnic_c::mem_read_handler(bx_phy_address addr, unsigned len,
|
||||
void *data, void *param)
|
||||
{
|
||||
Bit8u *data_ptr;
|
||||
|
@ -4,7 +4,7 @@
|
||||
//
|
||||
// Copyright (C) 2003 Fen Systems Ltd.
|
||||
// http://www.fensystems.co.uk/
|
||||
// Copyright (C) 2003-2017 The Bochs Project
|
||||
// Copyright (C) 2003-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
|
||||
@ -74,12 +74,12 @@ public:
|
||||
private:
|
||||
bx_pnic_t s;
|
||||
|
||||
static void set_irq_level(bx_bool level);
|
||||
static void set_irq_level(bool level);
|
||||
|
||||
static void pnic_timer_handler(void *);
|
||||
void pnic_timer(void);
|
||||
|
||||
BX_PNIC_SMF bx_bool mem_read_handler(bx_phy_address addr, unsigned len, void *data, void *param);
|
||||
BX_PNIC_SMF bool mem_read_handler(bx_phy_address addr, unsigned len, void *data, void *param);
|
||||
|
||||
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);
|
||||
|
@ -36,7 +36,7 @@
|
||||
|
||||
typedef struct {
|
||||
int msg_type;
|
||||
bx_bool found_srv_id;
|
||||
bool found_srv_id;
|
||||
struct in_addr req_addr;
|
||||
uint8_t *params;
|
||||
uint8_t params_len;
|
||||
|
@ -37,7 +37,7 @@ struct tftp_session {
|
||||
struct in_addr client_ip;
|
||||
uint16_t client_port;
|
||||
uint32_t block_nr;
|
||||
bx_bool write;
|
||||
bool write;
|
||||
unsigned options;
|
||||
size_t tsize_val;
|
||||
unsigned blksize_val;
|
||||
|
@ -9,7 +9,7 @@
|
||||
//
|
||||
// Written by Paul Brook
|
||||
//
|
||||
// Copyright (C) 2007-2020 The Bochs Project
|
||||
// Copyright (C) 2007-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
|
||||
@ -224,7 +224,7 @@ SCSIRequest* scsi_device_t::scsi_find_request(Bit32u tag)
|
||||
return r;
|
||||
}
|
||||
|
||||
bx_bool scsi_device_t::save_requests(const char *path)
|
||||
bool scsi_device_t::save_requests(const char *path)
|
||||
{
|
||||
char tmppath[BX_PATHNAME_LEN];
|
||||
FILE *fp, *fp2;
|
||||
@ -275,7 +275,7 @@ void scsi_device_t::restore_requests(const char *path)
|
||||
Bit64s value;
|
||||
Bit32u tag = 0;
|
||||
SCSIRequest *r = NULL;
|
||||
bx_bool rrq_error = 0;
|
||||
bool rrq_error = 0;
|
||||
|
||||
fp = fopen(path, "r");
|
||||
if (fp != NULL) {
|
||||
@ -336,9 +336,9 @@ void scsi_device_t::restore_requests(const char *path)
|
||||
} else if (!strcmp(pname, "status")) {
|
||||
r->status = (Bit32u)value;
|
||||
} else if (!strcmp(pname, "write_cmd")) {
|
||||
r->write_cmd = (bx_bool)value;
|
||||
r->write_cmd = (bool)value;
|
||||
} else if (!strcmp(pname, "async_mode")) {
|
||||
r->async_mode = (bx_bool)value;
|
||||
r->async_mode = (bool)value;
|
||||
} else if (!strcmp(pname, "seek_pending")) {
|
||||
r->seek_pending = (Bit8u)value;
|
||||
} else {
|
||||
@ -485,7 +485,7 @@ Bit8u* scsi_device_t::scsi_get_buf(Bit32u tag)
|
||||
return r->dma_buf;
|
||||
}
|
||||
|
||||
Bit32s scsi_device_t::scsi_send_command(Bit32u tag, Bit8u *buf, int lun, bx_bool async)
|
||||
Bit32s scsi_device_t::scsi_send_command(Bit32u tag, Bit8u *buf, int lun, bool async)
|
||||
{
|
||||
Bit64u nb_sectors;
|
||||
Bit64u lba;
|
||||
@ -964,7 +964,7 @@ Bit32s scsi_device_t::scsi_send_command(Bit32u tag, Bit8u *buf, int lun, bx_bool
|
||||
}
|
||||
}
|
||||
|
||||
void scsi_device_t::set_inserted(bx_bool value)
|
||||
void scsi_device_t::set_inserted(bool value)
|
||||
{
|
||||
inserted = value;
|
||||
if (inserted) {
|
||||
|
@ -9,7 +9,7 @@
|
||||
//
|
||||
// Written by Paul Brook
|
||||
//
|
||||
// Copyright (C) 2007-2018 The Bochs Project
|
||||
// Copyright (C) 2007-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
|
||||
@ -61,8 +61,8 @@ typedef struct SCSIRequest {
|
||||
int buf_len;
|
||||
Bit8u *dma_buf;
|
||||
Bit32u status;
|
||||
bx_bool write_cmd;
|
||||
bx_bool async_mode;
|
||||
bool write_cmd;
|
||||
bool async_mode;
|
||||
Bit8u seek_pending;
|
||||
struct SCSIRequest *next;
|
||||
} SCSIRequest;
|
||||
@ -77,7 +77,7 @@ public:
|
||||
virtual ~scsi_device_t(void);
|
||||
|
||||
void register_state(bx_list_c *parent, const char *name);
|
||||
Bit32s scsi_send_command(Bit32u tag, Bit8u *buf, int lun, bx_bool async);
|
||||
Bit32s scsi_send_command(Bit32u tag, Bit8u *buf, int lun, bool async);
|
||||
void scsi_command_complete(SCSIRequest *r, int status, int sense);
|
||||
void scsi_cancel_io(Bit32u tag);
|
||||
void scsi_read_complete(void *req, int ret);
|
||||
@ -86,11 +86,11 @@ public:
|
||||
void scsi_write_data(Bit32u tag);
|
||||
Bit8u* scsi_get_buf(Bit32u tag);
|
||||
const char *get_serial_number() {return drive_serial_str;}
|
||||
void set_inserted(bx_bool value);
|
||||
bx_bool get_inserted() {return inserted;}
|
||||
bx_bool get_locked() {return locked;}
|
||||
void set_inserted(bool value);
|
||||
bool get_inserted() {return inserted;}
|
||||
bool get_locked() {return locked;}
|
||||
static void seek_timer_handler(void *);
|
||||
bx_bool save_requests(const char *path);
|
||||
bool save_requests(const char *path);
|
||||
void restore_requests(const char *path);
|
||||
void set_debug_mode();
|
||||
|
||||
@ -117,11 +117,11 @@ private:
|
||||
int statusbar_id;
|
||||
// members set in constructor / runtime config
|
||||
Bit64u max_lba;
|
||||
bx_bool inserted;
|
||||
bool inserted;
|
||||
// members handled by save/restore
|
||||
Bit64u curr_lba;
|
||||
int sense;
|
||||
bx_bool locked;
|
||||
bool locked;
|
||||
SCSIRequest *requests;
|
||||
};
|
||||
|
||||
|
@ -422,7 +422,7 @@ usb_cbi_device_c::~usb_cbi_device_c(void)
|
||||
bx_pc_system.unregisterTimer(s.floppy_timer_index);
|
||||
}
|
||||
|
||||
bx_bool usb_cbi_device_c::set_option(const char *option)
|
||||
bool usb_cbi_device_c::set_option(const char *option)
|
||||
{
|
||||
if (!strncmp(option, "write_protected:", 16)) {
|
||||
SIM->get_param_bool("readonly", s.config)->set(atol(&option[16]));
|
||||
@ -438,7 +438,7 @@ bx_bool usb_cbi_device_c::set_option(const char *option)
|
||||
return 0;
|
||||
}
|
||||
|
||||
bx_bool usb_cbi_device_c::init()
|
||||
bool usb_cbi_device_c::init()
|
||||
{
|
||||
if (set_inserted(1)) {
|
||||
sprintf(s.info_txt, "USB CBI: path='%s', mode='%s'", s.fname, s.image_mode);
|
||||
@ -588,11 +588,11 @@ int usb_cbi_device_c::handle_control(int request, int value, int index, int leng
|
||||
return ret;
|
||||
}
|
||||
|
||||
bx_bool usb_cbi_device_c::handle_command(Bit8u *command)
|
||||
bool usb_cbi_device_c::handle_command(Bit8u *command)
|
||||
{
|
||||
Bit32u lba, count;
|
||||
int pc, pagecode;
|
||||
bx_bool ret = 1; // assume valid return
|
||||
bool ret = 1; // assume valid return
|
||||
|
||||
s.cur_command = command[0];
|
||||
s.usb_buf = s.dev_buffer;
|
||||
@ -1203,7 +1203,7 @@ void usb_cbi_device_c::cancel_packet(USBPacket *p)
|
||||
s.packet = NULL;
|
||||
}
|
||||
|
||||
bx_bool usb_cbi_device_c::set_inserted(bx_bool value)
|
||||
bool usb_cbi_device_c::set_inserted(bool value)
|
||||
{
|
||||
s.inserted = value;
|
||||
if (value) {
|
||||
|
@ -52,8 +52,8 @@ public:
|
||||
usb_cbi_device_c(const char *filename);
|
||||
virtual ~usb_cbi_device_c(void);
|
||||
|
||||
virtual bx_bool init();
|
||||
virtual bx_bool set_option(const char *option);
|
||||
virtual bool init();
|
||||
virtual bool set_option(const char *option);
|
||||
virtual const char* get_info();
|
||||
virtual void runtime_config(void);
|
||||
void restore_handler(bx_list_c *conf);
|
||||
@ -71,16 +71,16 @@ private:
|
||||
// members set in constructor / init
|
||||
bx_list_c *config;
|
||||
char info_txt[BX_PATHNAME_LEN];
|
||||
bx_bool model; // 0 = bochs, 1 = teac
|
||||
bool model; // 0 = bochs, 1 = teac
|
||||
int statusbar_id;
|
||||
int floppy_timer_index;
|
||||
// members handled by runtime config
|
||||
device_image_t *hdimage;
|
||||
const char *fname;
|
||||
char *image_mode;
|
||||
bx_bool inserted; // 0 = media not present
|
||||
bx_bool wp; // 0 = not write_protected, 1 = write_protected
|
||||
bx_bool status_changed;
|
||||
bool inserted; // 0 = media not present
|
||||
bool wp; // 0 = not write_protected, 1 = write_protected
|
||||
bool status_changed;
|
||||
// members handled by save/restore
|
||||
Bit32u usb_len;
|
||||
Bit32u data_len;
|
||||
@ -91,21 +91,21 @@ private:
|
||||
int sense;
|
||||
int asc;
|
||||
int fail_count;
|
||||
bx_bool did_inquiry_fail;
|
||||
bx_bool seek_pending;
|
||||
bool did_inquiry_fail;
|
||||
bool seek_pending;
|
||||
Bit8u *usb_buf;
|
||||
Bit8u *dev_buffer;
|
||||
// members not handled by save/restore
|
||||
USBPacket *packet;
|
||||
} s;
|
||||
|
||||
bx_bool handle_command(Bit8u *command);
|
||||
bool handle_command(Bit8u *command);
|
||||
void start_timer(Bit8u mode);
|
||||
void floppy_timer(void);
|
||||
int floppy_read_sector(void);
|
||||
int floppy_write_sector(void);
|
||||
void copy_data(USBPacket *p);
|
||||
bx_bool set_inserted(bx_bool value);
|
||||
bool set_inserted(bool value);
|
||||
|
||||
static const char *floppy_path_handler(bx_param_string_c *param, int set,
|
||||
const char *oldval, const char *val, int maxlen);
|
||||
|
@ -231,7 +231,7 @@ usbdev_locator_c::~usbdev_locator_c()
|
||||
}
|
||||
}
|
||||
|
||||
bx_bool usbdev_locator_c::module_present(const char *type)
|
||||
bool usbdev_locator_c::module_present(const char *type)
|
||||
{
|
||||
usbdev_locator_c *ptr = 0;
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
//
|
||||
// Copyright (c) 2005 Fabrice Bellard
|
||||
// Copyright (C) 2009-2016 Benjamin D Lunt (fys [at] fysnet [dot] net)
|
||||
// 2009-2020 The Bochs Project
|
||||
// 2009-2021 The Bochs Project
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
@ -141,7 +141,7 @@ struct USBPacket {
|
||||
typedef struct USBAsync {
|
||||
USBPacket packet;
|
||||
Bit64u td_addr;
|
||||
bx_bool done;
|
||||
bool done;
|
||||
Bit16u slot_ep;
|
||||
struct USBAsync *next;
|
||||
} USBAsync;
|
||||
@ -186,7 +186,7 @@ public:
|
||||
usb_device_c(void);
|
||||
virtual ~usb_device_c() {}
|
||||
|
||||
virtual bx_bool init() {return d.connected;}
|
||||
virtual bool init() {return d.connected;}
|
||||
virtual const char* get_info() {return NULL;}
|
||||
virtual usb_device_c* find_device(Bit8u addr);
|
||||
|
||||
@ -198,13 +198,13 @@ public:
|
||||
virtual void register_state_specific(bx_list_c *parent) {}
|
||||
virtual void after_restore_state() {}
|
||||
virtual void cancel_packet(USBPacket *p) {}
|
||||
virtual bx_bool set_option(const char *option) {return 0;}
|
||||
virtual bool set_option(const char *option) {return 0;}
|
||||
virtual void runtime_config() {}
|
||||
|
||||
bx_bool get_connected() {return d.connected;}
|
||||
bool get_connected() {return d.connected;}
|
||||
usbdev_type get_type() {return d.type;}
|
||||
int get_speed() {return d.speed;}
|
||||
bx_bool set_speed(int speed)
|
||||
bool set_speed(int speed)
|
||||
{
|
||||
if ((speed >= d.minspeed) && (speed <= d.maxspeed)) {
|
||||
d.speed = speed;
|
||||
@ -215,7 +215,7 @@ public:
|
||||
}
|
||||
|
||||
Bit8u get_address() {return d.addr;}
|
||||
void set_async_mode(bx_bool async) {d.async_mode = async;}
|
||||
void set_async_mode(bool async) {d.async_mode = async;}
|
||||
void set_event_handler(void *dev, USBCallback *cb, int port)
|
||||
{
|
||||
d.event.dev = dev;
|
||||
@ -229,7 +229,7 @@ public:
|
||||
protected:
|
||||
struct {
|
||||
enum usbdev_type type;
|
||||
bx_bool connected;
|
||||
bool connected;
|
||||
int minspeed;
|
||||
int maxspeed;
|
||||
int speed;
|
||||
@ -253,8 +253,8 @@ protected:
|
||||
int setup_state;
|
||||
int setup_len;
|
||||
int setup_index;
|
||||
bx_bool stall;
|
||||
bx_bool async_mode;
|
||||
bool stall;
|
||||
bool async_mode;
|
||||
struct {
|
||||
USBCallback *cb;
|
||||
void *dev;
|
||||
@ -384,7 +384,7 @@ static BX_CPP_INLINE void put_dwords(bx_phy_address addr, Bit32u *buf, int num)
|
||||
//
|
||||
class BOCHSAPI_MSVCONLY usbdev_locator_c {
|
||||
public:
|
||||
static bx_bool module_present(const char *type);
|
||||
static bool module_present(const char *type);
|
||||
static void cleanup();
|
||||
static usb_device_c *create(const char *type, usbdev_type devtype, const char *args);
|
||||
protected:
|
||||
|
@ -93,7 +93,7 @@ protected:
|
||||
|
||||
struct USBKBD {
|
||||
Bit8u code;
|
||||
bx_bool modkey;
|
||||
bool modkey;
|
||||
};
|
||||
|
||||
static const Bit8u bx_mouse_dev_descriptor[] = {
|
||||
@ -975,7 +975,7 @@ int usb_hid_device_c::handle_data(USBPacket *p)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int usb_hid_device_c::mouse_poll(Bit8u *buf, int len, bx_bool force)
|
||||
int usb_hid_device_c::mouse_poll(Bit8u *buf, int len, bool force)
|
||||
{
|
||||
int l = USB_RET_NAK;
|
||||
|
||||
@ -1144,7 +1144,7 @@ void usb_hid_device_c::mouse_enq(int delta_x, int delta_y, int delta_z, unsigned
|
||||
}
|
||||
}
|
||||
|
||||
int usb_hid_device_c::keyboard_poll(Bit8u *buf, int len, bx_bool force)
|
||||
int usb_hid_device_c::keyboard_poll(Bit8u *buf, int len, bool force)
|
||||
{
|
||||
int l = USB_RET_NAK;
|
||||
|
||||
@ -1174,7 +1174,7 @@ bool usb_hid_device_c::gen_scancode_static(void *dev, Bit32u key)
|
||||
|
||||
bool usb_hid_device_c::gen_scancode(Bit32u key)
|
||||
{
|
||||
bx_bool modkey, released = (key & BX_KEY_RELEASED) != 0;
|
||||
bool modkey, released = (key & BX_KEY_RELEASED) != 0;
|
||||
Bit8u code;
|
||||
|
||||
code = usbkbd_conv[key & ~BX_KEY_RELEASED].code;
|
||||
|
@ -45,7 +45,7 @@ public:
|
||||
|
||||
private:
|
||||
struct {
|
||||
bx_bool has_events;
|
||||
bool has_events;
|
||||
Bit8u idle;
|
||||
int mouse_delayed_dx;
|
||||
int mouse_delayed_dy;
|
||||
@ -70,10 +70,10 @@ private:
|
||||
static void mouse_enabled_changed(void *dev, bool enabled);
|
||||
static void mouse_enq_static(void *dev, int delta_x, int delta_y, int delta_z, unsigned button_state, bool absxy);
|
||||
void mouse_enq(int delta_x, int delta_y, int delta_z, unsigned button_state, bool absxy);
|
||||
int mouse_poll(Bit8u *buf, int len, bx_bool force);
|
||||
int mouse_poll(Bit8u *buf, int len, bool force);
|
||||
int create_mouse_packet(Bit8u *buf, int len);
|
||||
int get_mouse_packet(Bit8u *buf, int len);
|
||||
int keyboard_poll(Bit8u *buf, int len, bx_bool force);
|
||||
int keyboard_poll(Bit8u *buf, int len, bool force);
|
||||
|
||||
static void hid_timer_handler(void *);
|
||||
void start_idle_timer(void);
|
||||
|
@ -591,7 +591,7 @@ void usb_hub_device_c::event_handler(int event, USBPacket *packet, int port)
|
||||
}
|
||||
}
|
||||
|
||||
void usb_hub_device_c::usb_set_connect_status(Bit8u port, int type, bx_bool connected)
|
||||
void usb_hub_device_c::usb_set_connect_status(Bit8u port, int type, bool connected)
|
||||
{
|
||||
usb_device_c *device = hub.usb_port[port].device;
|
||||
if (device != NULL) {
|
||||
@ -687,7 +687,7 @@ const char *usb_hub_device_c::hub_param_handler(bx_param_string_c *param, int se
|
||||
if (hub != NULL) {
|
||||
hubnum = atoi(port->get_parent()->get_name()+6);
|
||||
portnum = atoi(port->get_name()+4) - 1;
|
||||
bx_bool empty = ((strlen(val) == 0) || (!strcmp(val, "none")));
|
||||
bool empty = ((strlen(val) == 0) || (!strcmp(val, "none")));
|
||||
if ((portnum >= 0) && (portnum < hub->hub.n_ports)) {
|
||||
if (empty && (hub->hub.usb_port[portnum].PortStatus & PORT_STAT_CONNECTION)) {
|
||||
BX_INFO(("USB hub #%d, port #%d: device disconnect", hubnum, portnum+1));
|
||||
|
@ -5,7 +5,7 @@
|
||||
// USB hub emulation support (ported from QEMU)
|
||||
//
|
||||
// Copyright (C) 2005 Fabrice Bellard
|
||||
// Copyright (C) 2009-2016 The Bochs Project
|
||||
// Copyright (C) 2009-2021 The Bochs Project
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
@ -67,7 +67,7 @@ private:
|
||||
int broadcast_packet(USBPacket *p);
|
||||
void init_device(Bit8u port, bx_list_c *portconf);
|
||||
void remove_device(Bit8u port);
|
||||
void usb_set_connect_status(Bit8u port, int type, bx_bool connected);
|
||||
void usb_set_connect_status(Bit8u port, int type, bool connected);
|
||||
|
||||
static const char *hub_param_handler(bx_param_string_c *param, int set,
|
||||
const char *oldval, const char *val, int maxlen);
|
||||
|
@ -412,7 +412,7 @@ usb_msd_device_c::~usb_msd_device_c(void)
|
||||
}
|
||||
}
|
||||
|
||||
bx_bool usb_msd_device_c::set_option(const char *option)
|
||||
bool usb_msd_device_c::set_option(const char *option)
|
||||
{
|
||||
char *suffix;
|
||||
|
||||
@ -460,7 +460,7 @@ bx_bool usb_msd_device_c::set_option(const char *option)
|
||||
return 0;
|
||||
}
|
||||
|
||||
bx_bool usb_msd_device_c::init()
|
||||
bool usb_msd_device_c::init()
|
||||
{
|
||||
if (d.type == USB_DEV_TYPE_DISK) {
|
||||
s.hdimage = DEV_hdimage_init_image(s.image_mode, 0, s.journal);
|
||||
@ -906,7 +906,7 @@ void usb_msd_device_c::cancel_packet(USBPacket *p)
|
||||
s.scsi_len = 0;
|
||||
}
|
||||
|
||||
bx_bool usb_msd_device_c::set_inserted(bx_bool value)
|
||||
bool usb_msd_device_c::set_inserted(bool value)
|
||||
{
|
||||
const char *path;
|
||||
|
||||
@ -930,12 +930,12 @@ bx_bool usb_msd_device_c::set_inserted(bx_bool value)
|
||||
return value;
|
||||
}
|
||||
|
||||
bx_bool usb_msd_device_c::get_inserted()
|
||||
bool usb_msd_device_c::get_inserted()
|
||||
{
|
||||
return s.scsi_dev->get_inserted();
|
||||
}
|
||||
|
||||
bx_bool usb_msd_device_c::get_locked()
|
||||
bool usb_msd_device_c::get_locked()
|
||||
{
|
||||
return s.scsi_dev->get_locked();
|
||||
}
|
||||
|
@ -35,8 +35,8 @@ public:
|
||||
usb_msd_device_c(usbdev_type type, const char *filename);
|
||||
virtual ~usb_msd_device_c(void);
|
||||
|
||||
virtual bx_bool init();
|
||||
virtual bx_bool set_option(const char *option);
|
||||
virtual bool init();
|
||||
virtual bool set_option(const char *option);
|
||||
virtual const char* get_info();
|
||||
virtual void runtime_config(void);
|
||||
void restore_handler(bx_list_c *conf);
|
||||
@ -46,9 +46,9 @@ public:
|
||||
virtual int handle_data(USBPacket *p);
|
||||
virtual void register_state_specific(bx_list_c *parent);
|
||||
virtual void cancel_packet(USBPacket *p);
|
||||
bx_bool set_inserted(bx_bool value);
|
||||
bx_bool get_inserted();
|
||||
bx_bool get_locked();
|
||||
bool set_inserted(bool value);
|
||||
bool get_inserted();
|
||||
bool get_locked();
|
||||
|
||||
protected:
|
||||
void copy_data();
|
||||
@ -71,7 +71,7 @@ private:
|
||||
int size; // VVFAT disk only
|
||||
unsigned sect_size; // sector size for disks only (default = 512 bytes)
|
||||
// members handled by runtime config
|
||||
bx_bool status_changed;
|
||||
bool status_changed;
|
||||
// members handled by save/restore
|
||||
Bit8u mode;
|
||||
Bit32u scsi_len;
|
||||
|
@ -182,7 +182,7 @@ usb_printer_device_c::~usb_printer_device_c(void)
|
||||
usb_rt->remove(s.config->get_name());
|
||||
}
|
||||
|
||||
bx_bool usb_printer_device_c::init()
|
||||
bool usb_printer_device_c::init()
|
||||
{
|
||||
s.fp = fopen(s.fname, "w+b");
|
||||
if (s.fp == NULL) {
|
||||
|
@ -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
|
||||
@ -28,7 +28,7 @@ public:
|
||||
usb_printer_device_c(usbdev_type type, const char *filename);
|
||||
virtual ~usb_printer_device_c(void);
|
||||
|
||||
virtual bx_bool init();
|
||||
virtual bool init();
|
||||
virtual const char* get_info();
|
||||
|
||||
virtual void handle_reset();
|
||||
|
Loading…
Reference in New Issue
Block a user