rename USE_RAW_SERIAL -> BX_USE_RAW_SERIAL (#70)

This commit is contained in:
Stanislav Shwartsman 2023-09-04 20:21:37 +03:00 committed by GitHub
parent 46f435e3f5
commit fe53752ddf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 26 additions and 26 deletions

View File

@ -232,7 +232,7 @@
#error You must use SMF to have plugins
#endif
#define USE_RAW_SERIAL 0
#define BX_USE_RAW_SERIAL 0
// This option enables RAM file backing for large guest memory with a smaller
// amount host memory, without causing a panic when host memory is exhausted.

6
bochs/configure vendored
View File

@ -24911,19 +24911,19 @@ then :
enableval=$enable_raw_serial; if test "$enableval" = yes; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
printf "%s\n" "#define USE_RAW_SERIAL 1" >>confdefs.h
printf "%s\n" "#define BX_USE_RAW_SERIAL 1" >>confdefs.h
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
printf "%s\n" "#define USE_RAW_SERIAL 0" >>confdefs.h
printf "%s\n" "#define BX_USE_RAW_SERIAL 0" >>confdefs.h
fi
else $as_nop
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
printf "%s\n" "#define USE_RAW_SERIAL 0" >>confdefs.h
printf "%s\n" "#define BX_USE_RAW_SERIAL 0" >>confdefs.h

View File

@ -1784,14 +1784,14 @@ AC_ARG_ENABLE(raw-serial,
AS_HELP_STRING([--enable-raw-serial], [use raw serial port access (no - incomplete)]),
[if test "$enableval" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(USE_RAW_SERIAL, 1)
AC_DEFINE(BX_USE_RAW_SERIAL, 1)
else
AC_MSG_RESULT(no)
AC_DEFINE(USE_RAW_SERIAL, 0)
AC_DEFINE(BX_USE_RAW_SERIAL, 0)
fi],
[
AC_MSG_RESULT(no)
AC_DEFINE(USE_RAW_SERIAL, 0)
AC_DEFINE(BX_USE_RAW_SERIAL, 0)
]
)

View File

@ -50,7 +50,7 @@ typedef int SOCKET;
#define FILE_FLAG_FIRST_PIPE_INSTANCE 0
#endif
#if USE_RAW_SERIAL
#if BX_USE_RAW_SERIAL
#include "serial_raw.h"
#endif
@ -216,7 +216,7 @@ bx_serial_c::~bx_serial_c(void)
#endif
break;
case BX_SER_MODE_RAW:
#if USE_RAW_SERIAL
#if BX_USE_RAW_SERIAL
delete [] BX_SER_THIS s[i].raw;
#endif
break;
@ -438,7 +438,7 @@ bx_serial_c::init(void)
BX_PANIC(("serial terminal support not available"));
#endif /* def SERIAL_ENABLE */
} else if (mode == BX_SER_MODE_RAW) {
#if USE_RAW_SERIAL
#if BX_USE_RAW_SERIAL
BX_SER_THIS s[i].raw = new serial_raw(dev);
BX_SER_THIS s[i].io_mode = BX_SER_MODE_RAW;
#else
@ -899,7 +899,7 @@ Bit32u bx_serial_c::read(Bit32u address, unsigned io_len)
break;
case BX_SER_MSR: /* MODEM status register */
#if USE_RAW_SERIAL
#if BX_USE_RAW_SERIAL
if (BX_SER_THIS s[port].io_mode == BX_SER_MODE_RAW) {
bool prev_cts = BX_SER_THIS s[port].modem_status.cts;
bool prev_dsr = BX_SER_THIS s[port].modem_status.dsr;
@ -974,7 +974,7 @@ void bx_serial_c::write(Bit32u address, Bit32u value, unsigned io_len)
#endif // !BX_USE_SER_SMF
bool gen_int = 0;
Bit8u offset, new_wordlen;
#if USE_RAW_SERIAL
#if BX_USE_RAW_SERIAL
bool mcr_changed = 0;
Bit8u p_mode;
#endif
@ -1156,7 +1156,7 @@ void bx_serial_c::write(Bit32u address, Bit32u value, unsigned io_len)
case BX_SER_LCR: /* Line control register */
new_wordlen = value & 0x03;
#if USE_RAW_SERIAL
#if BX_USE_RAW_SERIAL
if (BX_SER_THIS s[port].io_mode == BX_SER_MODE_RAW) {
if (BX_SER_THIS s[port].line_cntl.wordlen_sel != new_wordlen) {
BX_SER_THIS s[port].raw->set_data_bits(new_wordlen + 5);
@ -1179,7 +1179,7 @@ void bx_serial_c::write(Bit32u address, Bit32u value, unsigned io_len)
BX_SER_THIS s[port].raw->set_break(new_b6);
}
}
#endif // USE_RAW_SERIAL
#endif // BX_USE_RAW_SERIAL
/* These are ignored, but set them up so they can be read back */
BX_SER_THIS s[port].line_cntl.stopbits = new_b2;
BX_SER_THIS s[port].line_cntl.parity_enable = new_b3;
@ -1201,7 +1201,7 @@ void bx_serial_c::write(Bit32u address, Bit32u value, unsigned io_len)
BX_SER_THIS s[port].baudrate = new_baudrate;
restart_timer = 1;
BX_DEBUG(("com%d: baud rate set to %d", port+1, BX_SER_THIS s[port].baudrate));
#if USE_RAW_SERIAL
#if BX_USE_RAW_SERIAL
if (BX_SER_THIS s[port].io_mode == BX_SER_MODE_RAW) {
BX_SER_THIS s[port].raw->set_baudrate(BX_SER_THIS s[port].baudrate);
}
@ -1238,7 +1238,7 @@ void bx_serial_c::write(Bit32u address, Bit32u value, unsigned io_len)
BX_SER_THIS detect_mouse = 2;
}
}
#if USE_RAW_SERIAL
#if BX_USE_RAW_SERIAL
if (BX_SER_THIS s[port].io_mode == BX_SER_MODE_RAW) {
mcr_changed = (BX_SER_THIS s[port].modem_cntl.dtr != new_b0) |
(BX_SER_THIS s[port].modem_cntl.rts != new_b1);
@ -1253,7 +1253,7 @@ void bx_serial_c::write(Bit32u address, Bit32u value, unsigned io_len)
BX_SER_THIS s[port].modem_cntl.local_loopback = new_b4;
if (BX_SER_THIS s[port].modem_cntl.local_loopback) {
/* transition to loopback mode */
#if USE_RAW_SERIAL
#if BX_USE_RAW_SERIAL
if (BX_SER_THIS s[port].io_mode == BX_SER_MODE_RAW) {
if (BX_SER_THIS s[port].modem_cntl.dtr ||
BX_SER_THIS s[port].modem_cntl.rts) {
@ -1262,7 +1262,7 @@ void bx_serial_c::write(Bit32u address, Bit32u value, unsigned io_len)
}
#endif
if (BX_SER_THIS s[port].line_cntl.break_cntl) {
#if USE_RAW_SERIAL
#if BX_USE_RAW_SERIAL
if (BX_SER_THIS s[port].io_mode == BX_SER_MODE_RAW) {
BX_SER_THIS s[port].raw->set_break(0);
}
@ -1273,7 +1273,7 @@ void bx_serial_c::write(Bit32u address, Bit32u value, unsigned io_len)
}
} else {
/* transition to normal mode */
#if USE_RAW_SERIAL
#if BX_USE_RAW_SERIAL
if (BX_SER_THIS s[port].io_mode == BX_SER_MODE_RAW) {
mcr_changed = 1;
if (BX_SER_THIS s[port].line_cntl.break_cntl) {
@ -1337,7 +1337,7 @@ void bx_serial_c::write(Bit32u address, Bit32u value, unsigned io_len)
}
if (BX_SER_THIS s[port].io_mode == BX_SER_MODE_RAW) {
#if USE_RAW_SERIAL
#if BX_USE_RAW_SERIAL
if (mcr_changed) {
BX_SER_THIS s[port].raw->set_modem_control(value & 0x03);
}
@ -1456,7 +1456,7 @@ void bx_serial_c::tx_timer(void)
#endif
break;
case BX_SER_MODE_RAW:
#if USE_RAW_SERIAL
#if BX_USE_RAW_SERIAL
if (!BX_SER_THIS s[port].raw->ready_transmit())
BX_PANIC(("com%d: not ready to transmit", port+1));
BX_SER_THIS s[port].raw->transmit(BX_SER_THIS s[port].tsrbuffer);
@ -1564,7 +1564,7 @@ void bx_serial_c::rx_timer(void)
#endif
break;
case BX_SER_MODE_RAW:
#if USE_RAW_SERIAL
#if BX_USE_RAW_SERIAL
int data;
if ((data_ready = BX_SER_THIS s[port].raw->ready_receive())) {
data = BX_SER_THIS s[port].raw->receive();

View File

@ -82,7 +82,7 @@ enum {
BX_SER_INT_FIFO
};
#if USE_RAW_SERIAL
#if BX_USE_RAW_SERIAL
class serial_raw;
#endif
@ -121,7 +121,7 @@ typedef struct {
HANDLE pipe;
#endif
#if USE_RAW_SERIAL
#if BX_USE_RAW_SERIAL
serial_raw* raw;
#endif
#if defined(SERIAL_ENABLE) && !defined(BX_SER_WIN32)

View File

@ -26,7 +26,7 @@
#include "iodev.h"
#if USE_RAW_SERIAL
#if BX_USE_RAW_SERIAL
#include "serial_raw.h"

View File

@ -18,7 +18,7 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#if USE_RAW_SERIAL
#if BX_USE_RAW_SERIAL
#ifdef __linux__
#include <linux/serial.h>