A lot of cpu state is stored in global variables, as is memory handling.
The sim_size support needs unwinding at some point. But at least this
is an improvement on the status quo.
In preparation for converting to nrun, call the common functions that
are needed. This doesn't produce any new warnings, and the generated
code should be the same.
The sbrk syscall assumes the sbrk region starts after the bss and the
current implementation requires a bss section to exist. Since there
is no requirement for programs to have a bss in general, we want to
drop this check. However, there is still the sbrk syscall that wants
to know about the region.
Since libgloss doesn't actually use the sbrk syscall (it implements
sbrk in its own way), and the sim really shouldn't enforce a specific
memory layout on programs, lets simply delete sbrk support. Now it
always returns an error.
A lot of cpu state is stored in global variables, as is memory handling.
The sim_size support needs unwinding at some point. But at least this
is an improvement on the status quo.
The build line was missing the normal BUILD_xxx flags. Once we added
that, we get warnings that weren't shown before. As we fix those, we
notice that the -d option segfaults because it tries to write readonly
memory. Fix that too as part of the const/prototype clean up.
The previous profile change broke these sims that use sim-profile but
not sim-cpu (due to missing model support). Add simple funcs until we
can convert these over properly.
The profile code was using STATE_WATCHPOINTS to get access to the PC, but
we already have a standard method for getting the pc, so switch to that.
This assumes that sizeof_pc is the same size as sim_cia, but we already
assume this in places by way of sim_pc_{get,set}, and this is how it's
documented in the sim-base.h API.
This partially reverts commits:
105dd264de3df3af7c3fc4892a6b379e3042ec07
Now that dv-sockser is handled entirely by the common build logic, the
failure these targets were hitting isn't really possible anymore. Lets
reset their hardware status back to defaulting to on. Some of these
were set to "always" previously, but we don't support that anymore.
The current default handling for the --enable-sim-hardware option ends up
forcing the value to whatever is set as the first argument when calling
the macro (by virtue of how autoconf works). Relocate the setup code to
the 4th parameter of the AC_ARG_ENABLE macro to fix it.
This was caused by the simplification work in 1517bd2742.
Reported-by: Hans-Peter Nilsson <hans-peter.nilsson@axis.com>
Since no sim is using the "always" option to SIM_AC_OPTION_HARDWARE, and
we don't want to require hw support to always be enabled, drop the option.
This leads to a slight simplification in the macro too as we can collapse
the sim_hw_p variable.
This looks like copy & paste logic from the m32r port (and history
suggests this as well). Since building with hw & device support
enabled leads to failures:
sim/frv/devices.c: In function 'device_io_read_buffer':
sim/frv/devices.c:39:15: error: 'UART_INCHAR_ADDR' undeclared (first use in this function)
Delete it entirely. We leave device support in place as it is used
to flush the scache.
If dv-sockser is available, lets add it to the common SIM_HW_OBJS
variable so it is always included automatically. Now ports do not
have to shoe horn it in directly themselves. It does mean it will
be compiled for targets that don't explicitly use it, but that's
really what we want anyways.
This lets ports assume that the dv-sockser API is always available if
they want to. This way we don't have to do an abort at configure time
and it makes the resulting code a bit simpler.
* load.c (rl78_load): If the G10, G13 or G14 flag bits are set in
the ELF header use them to select the proper emulation mode.
* mem.c (mem_put_byte): Use mem_put_hi to store a value into the
MDB register.
(mem_get_byte): Use mem_get_hi to extract a value from the MDB
register.
Rather than manually include tconfig.h when we think we'll need it (which
is error prone as it can define symbols we expect from config.h), have it
be included directly by config.h. Since we know we have to include that
header everywhere already, this will make sure tconfig.h isn't missed.
It should also be fine as tconfig.h is supposed to be simple and only set
up a few core defines for the target.
This allows us to stop symlinking it in place all the time and just use
it straight out of the respective source directory.
Pull out the duplicated dv_sockser_install prototype from the tconfig.in
files and put it in the one place it gets used -- sim-module.c. This is
still arguably incorrect, but it's better than the status quo where the
tconfig.in has to include header files and duplicate the dv-sockser func.
The tconfig header is meant to be simple and contain a target defines.
This dates back to the start of the repo, but has never really been used.
The sim-inline.c file has been checked in to the source, and attempts to
build it in the build tree leads to a circular dep warning from make. It
also doesn't produce a file that is usable -- it can't be compiled. Punt!
We want people to stop using the run.c frontend, but it's hard to notice
when it's still set as the default. Lets flip things so nrun.c is the
default, and users of run.c will get an error by default. We turn that
error into a warning for existing sims so we don't break them -- this is
mostly meant for people starting new ports.