tries to fix it. The shortcuts to register names such as AX and DL are
#defines in cpu/cpu.h, and they are defined in terms of BX_CPU_THIS_PTR.
When BX_USE_CPU_SMF=1, this works fine. (This is what bochs used for
a long time, and nobody used the SMF=0 mode at all.) To make SMP bochs
work, I had to get SMF=0 mode working for the CPU so that there could
be an array of cpus.
When SMF=0 for the CPU, BX_CPU_THIS_PTR is defined to be "this->" which
only works within methods of BX_CPU_C. Code outside of BX_CPU_C must
reference BX_CPU(num) instead.
- to try to enforce the correct use of AL/AX/DL/etc. shortcuts, they are
now only #defined when "NEED_CPU_REG_SHORTCUTS" is #defined. This is
only done in the cpu/*.cc code.
in BRANCH-smp-bochs revisions.
- The general task was to make multiple CPU's which communicate
through their APICs. So instead of BX_CPU and BX_MEM, we now have
BX_CPU(x) and BX_MEM(y). For an SMP simulation you have several
processors in a shared memory space, so there might be processors
BX_CPU(0..3) but only one memory space BX_MEM(0). For cosimulation,
you could have BX_CPU(0) with BX_MEM(0), then BX_CPU(1) with
BX_MEM(1). WARNING: Cosimulation is almost certainly broken by the
SMP changes.
- to simulate multiple CPUs, you have to give each CPU time to execute
in turn. This is currently implemented using debugger guards. The
cpu loop steps one CPU for a few instructions, then steps the
next CPU for a few instructions, etc.
- there is some limited support in the debugger for two CPUs, for
example printing information from each CPU when single stepping.
- change Makefile.in to "cvs-snapshot" information rather than printing
the release number, since in fact it's not the same as the release anymore
- use #defines to give the actions names (ACT_IGNORE, ACT_REPORT, ACT_FATAL)
- register all logfunctions as they call setio, and keep a list so that
we can change their settings more easily. I admit I used a static-sized
array to store them. Sorry.
- instead of printing a prefix [GEN ] for generic messages, just leave the
prefix blank [ ]. Otherwise you start wondering what does gen stand
for.
- avoid reentry into fatal, since fatal can call BX_INFO and friends.
This avoids a potential infinite recursion.
- now that files other than .bochsrc can be the rc file, print the
actual name of the file in error messages.
what action to take on panic, error, info, and debug. The lines don't
have any effect quite yet because of an initialization order problem
with the logfunctions.