sim: common: trim trailing whitespace

This commit is contained in:
Mike Frysinger 2011-03-15 03:16:17 +00:00
parent 7f35e99197
commit 028f651542
42 changed files with 300 additions and 292 deletions

View File

@ -1,3 +1,15 @@
2011-03-14 Mike Frysinger <vapier@gentoo.org>
* callback.c, cgen-engine.h, dv-core.c, dv-glue.c, dv-pal.c,
hw-base.c, hw-device.c, hw-device.h, hw-handles.c, hw-instances.c,
hw-ports.c, hw-ports.h, hw-properties.c, hw-tree.c, nrun.c,
run-sim.h, run.c, sim-alu.h, sim-assert.h, sim-base.h, sim-basics.h,
sim-config.c, sim-core.c, sim-core.h, sim-engine.h, sim-events.c,
sim-events.h, sim-fpu.c, sim-hw.c, sim-inline.h, sim-load.c,
sim-memopt.c, sim-n-core.h, sim-options.c, sim-profile.c,
sim-signal.c, sim-trace.c, sim-trace.h, sim-utils.c, sim-watch.c,
syscall.c: Trim trailing whitespace.
2011-03-05 Mike Frysinger <vapier@gentoo.org> 2011-03-05 Mike Frysinger <vapier@gentoo.org>
* gennltvals.sh: Handle bfin targets. * gennltvals.sh: Handle bfin targets.

View File

@ -102,7 +102,7 @@ static int wrap PARAMS ((host_callback *, int));
/* Set the callback copy of errno from what we see now. */ /* Set the callback copy of errno from what we see now. */
static int static int
wrap (p, val) wrap (p, val)
host_callback *p; host_callback *p;
int val; int val;
@ -114,7 +114,7 @@ wrap (p, val)
/* Make sure the FD provided is ok. If not, return non-zero /* Make sure the FD provided is ok. If not, return non-zero
and set errno. */ and set errno. */
static int static int
fdbad (p, fd) fdbad (p, fd)
host_callback *p; host_callback *p;
int fd; int fd;
@ -127,7 +127,7 @@ fdbad (p, fd)
return 0; return 0;
} }
static int static int
fdmap (p, fd) fdmap (p, fd)
host_callback *p; host_callback *p;
int fd; int fd;
@ -135,7 +135,7 @@ fdmap (p, fd)
return p->fdmap[fd]; return p->fdmap[fd];
} }
static int static int
os_close (p, fd) os_close (p, fd)
host_callback *p; host_callback *p;
int fd; int fd;
@ -223,7 +223,7 @@ os_poll_quit (p)
{ {
return 1; return 1;
} }
else else
{ {
sim_cb_eprintf (p, "CTRL-A to quit, CTRL-B to quit harder\n"); sim_cb_eprintf (p, "CTRL-A to quit, CTRL-B to quit harder\n");
} }
@ -243,7 +243,7 @@ os_poll_quit (p)
#define os_poll_quit 0 #define os_poll_quit 0
#endif /* defined(__GO32__) || defined(_MSC_VER) */ #endif /* defined(__GO32__) || defined(_MSC_VER) */
static int static int
os_get_errno (p) os_get_errno (p)
host_callback *p; host_callback *p;
{ {
@ -251,7 +251,7 @@ os_get_errno (p)
} }
static int static int
os_isatty (p, fd) os_isatty (p, fd)
host_callback *p; host_callback *p;
int fd; int fd;
@ -266,7 +266,7 @@ os_isatty (p, fd)
return result; return result;
} }
static int static int
os_lseek (p, fd, off, way) os_lseek (p, fd, off, way)
host_callback *p; host_callback *p;
int fd; int fd;
@ -282,7 +282,7 @@ os_lseek (p, fd, off, way)
return result; return result;
} }
static int static int
os_open (p, name, flags) os_open (p, name, flags)
host_callback *p; host_callback *p;
const char *name; const char *name;
@ -308,7 +308,7 @@ os_open (p, name, flags)
return -1; return -1;
} }
static int static int
os_read (p, fd, buf, len) os_read (p, fd, buf, len)
host_callback *p; host_callback *p;
int fd; int fd;
@ -365,7 +365,7 @@ os_read (p, fd, buf, len)
return result; return result;
} }
static int static int
os_read_stdin (p, buf, len) os_read_stdin (p, buf, len)
host_callback *p; host_callback *p;
char *buf; char *buf;
@ -374,7 +374,7 @@ os_read_stdin (p, buf, len)
return wrap (p, read (0, buf, len)); return wrap (p, read (0, buf, len));
} }
static int static int
os_write (p, fd, buf, len) os_write (p, fd, buf, len)
host_callback *p; host_callback *p;
int fd; int fd;
@ -446,7 +446,7 @@ os_write (p, fd, buf, len)
return result; return result;
} }
static int static int
os_write_stdout (p, buf, len) os_write_stdout (p, buf, len)
host_callback *p ATTRIBUTE_UNUSED; host_callback *p ATTRIBUTE_UNUSED;
const char *buf; const char *buf;
@ -462,7 +462,7 @@ os_flush_stdout (p)
fflush (stdout); fflush (stdout);
} }
static int static int
os_write_stderr (p, buf, len) os_write_stderr (p, buf, len)
host_callback *p ATTRIBUTE_UNUSED; host_callback *p ATTRIBUTE_UNUSED;
const char *buf; const char *buf;
@ -478,7 +478,7 @@ os_flush_stderr (p)
fflush (stderr); fflush (stderr);
} }
static int static int
os_rename (p, f1, f2) os_rename (p, f1, f2)
host_callback *p; host_callback *p;
const char *f1; const char *f1;
@ -496,7 +496,7 @@ os_system (p, s)
return wrap (p, system (s)); return wrap (p, system (s));
} }
static long static long
os_time (p, t) os_time (p, t)
host_callback *p; host_callback *p;
long *t; long *t;
@ -505,7 +505,7 @@ os_time (p, t)
} }
static int static int
os_unlink (p, f1) os_unlink (p, f1)
host_callback *p; host_callback *p;
const char *f1; const char *f1;
@ -587,7 +587,7 @@ os_lstat (p, file, buf)
#endif #endif
} }
static int static int
os_ftruncate (p, fd, len) os_ftruncate (p, fd, len)
host_callback *p; host_callback *p;
int fd; int fd;
@ -844,7 +844,7 @@ host_callback default_callback =
0, /* open_map */ 0, /* open_map */
0, /* signal_map */ 0, /* signal_map */
0, /* stat_map */ 0, /* stat_map */
/* Defaults expected to be overridden at initialization, where needed. */ /* Defaults expected to be overridden at initialization, where needed. */
BFD_ENDIAN_UNKNOWN, /* target_endian */ BFD_ENDIAN_UNKNOWN, /* target_endian */
4, /* target_sizeof_int */ 4, /* target_sizeof_int */

View File

@ -137,7 +137,7 @@ union sem {
#ifdef __GNUC__ #ifdef __GNUC__
#define SEM_SET_FULL_CODE(abuf, idesc) \ #define SEM_SET_FULL_CODE(abuf, idesc) \
do { (abuf)->semantic.sem_case = (idesc)->sem_full_lab; } while (0) do { (abuf)->semantic.sem_case = (idesc)->sem_full_lab; } while (0)
#else #else
#define SEM_SET_FULL_CODE(abuf, idesc) \ #define SEM_SET_FULL_CODE(abuf, idesc) \
do { (abuf)->semantic.sem_case = (idesc)->num; } while (0) do { (abuf)->semantic.sem_case = (idesc)->num; } while (0)
#endif #endif
@ -150,7 +150,7 @@ union sem {
#ifdef __GNUC__ #ifdef __GNUC__
#define SEM_SET_FAST_CODE(abuf, idesc) \ #define SEM_SET_FAST_CODE(abuf, idesc) \
do { (abuf)->semantic.sem_case = (idesc)->sem_fast_lab; } while (0) do { (abuf)->semantic.sem_case = (idesc)->sem_fast_lab; } while (0)
#else #else
#define SEM_SET_FAST_CODE(abuf, idesc) \ #define SEM_SET_FAST_CODE(abuf, idesc) \
do { (abuf)->semantic.sem_case = (idesc)->num; } while (0) do { (abuf)->semantic.sem_case = (idesc)->num; } while (0)
#endif #endif

View File

@ -24,11 +24,11 @@
#include "hw-main.h" #include "hw-main.h"
/* DEVICE /* DEVICE
core - root of the device tree core - root of the device tree
DESCRIPTION DESCRIPTION
The core device, positioned at the root of the device tree appears The core device, positioned at the root of the device tree appears
to its child devices as a normal device just like every other to its child devices as a normal device just like every other
device in the tree. device in the tree.

View File

@ -31,13 +31,13 @@
#endif #endif
/* DEVICE /* DEVICE
glue - glue to interconnect and test hardware ports glue - glue to interconnect and test hardware ports
DESCRIPTION DESCRIPTION
The glue device provides two functions. Firstly, it provides a The glue device provides two functions. Firstly, it provides a
mechanism for inspecting and driving the port network. Secondly, mechanism for inspecting and driving the port network. Secondly,
@ -70,7 +70,7 @@
PROPERTIES PROPERTIES
reg = <address> <size> (required) reg = <address> <size> (required)
@ -88,7 +88,7 @@
PORTS PORTS
int[0..] (input, output) int[0..] (input, output)
Both an input and an output port. Both an input and an output port.
@ -137,11 +137,11 @@
| write_string("AND is "); | write_string("AND is ");
| write_int(ans); | write_int(ans);
| write_line(); | write_line();
BUGS BUGS
A future implementation of this device may support multiple A future implementation of this device may support multiple
interrupt ranges. interrupt ranges.
@ -192,7 +192,7 @@ static void
hw_glue_finish (struct hw *me) hw_glue_finish (struct hw *me)
{ {
struct hw_glue *glue = HW_ZALLOC (me, struct hw_glue); struct hw_glue *glue = HW_ZALLOC (me, struct hw_glue);
/* establish our own methods */ /* establish our own methods */
set_hw_data (me, glue); set_hw_data (me, glue);
set_hw_io_read_buffer (me, hw_glue_io_read_buffer); set_hw_io_read_buffer (me, hw_glue_io_read_buffer);
@ -202,7 +202,7 @@ hw_glue_finish (struct hw *me)
/* attach to our parent bus */ /* attach to our parent bus */
do_hw_attach_regs (me); do_hw_attach_regs (me);
/* establish the output registers */ /* establish the output registers */
{ {
reg_property_spec unit; reg_property_spec unit;
@ -233,7 +233,7 @@ hw_glue_finish (struct hw *me)
glue->nr_outputs = glue->sizeof_output / sizeof (unsigned_word); glue->nr_outputs = glue->sizeof_output / sizeof (unsigned_word);
glue->output = hw_zalloc (me, glue->sizeof_output); glue->output = hw_zalloc (me, glue->sizeof_output);
} }
/* establish the input ports */ /* establish the input ports */
{ {
const struct hw_property *ranges; const struct hw_property *ranges;
@ -256,7 +256,7 @@ hw_glue_finish (struct hw *me)
glue->sizeof_input = glue->nr_inputs * sizeof (unsigned); glue->sizeof_input = glue->nr_inputs * sizeof (unsigned);
glue->input = hw_zalloc (me, glue->sizeof_input); glue->input = hw_zalloc (me, glue->sizeof_input);
} }
/* determine our type */ /* determine our type */
{ {
const char *name = hw_name(me); const char *name = hw_name(me);
@ -267,7 +267,7 @@ hw_glue_finish (struct hw *me)
else else
hw_abort (me, "unimplemented glue type"); hw_abort (me, "unimplemented glue type");
} }
HW_TRACE ((me, "int-number %d, nr_inputs %d, nr_outputs %d", HW_TRACE ((me, "int-number %d, nr_inputs %d, nr_outputs %d",
glue->int_number, glue->nr_inputs, glue->nr_outputs)); glue->int_number, glue->nr_inputs, glue->nr_outputs));
} }

View File

@ -44,13 +44,13 @@
/* DEVICE /* DEVICE
pal - glue logic device containing assorted junk pal - glue logic device containing assorted junk
DESCRIPTION DESCRIPTION
Typical hardware dependant hack. This device allows the firmware Typical hardware dependant hack. This device allows the firmware
to gain access to all the things the firmware needs (but the OS to gain access to all the things the firmware needs (but the OS
doesn't). doesn't).
@ -74,10 +74,10 @@
RESET (write): halts the simulator. The value written to the RESET (write): halts the simulator. The value written to the
register is used as an exit status. register is used as an exit status.
PROCESSOR ID (read): returns the processor identifier (0 .. N-1) of PROCESSOR ID (read): returns the processor identifier (0 .. N-1) of
the processor performing the read. the processor performing the read.
INTERRUPT (write): This register must be written using a two byte INTERRUPT (write): This register must be written using a two byte
store. The low byte specifies a port and the upper byte specifies store. The low byte specifies a port and the upper byte specifies
the a level. LEVEL is driven on the specified port. By the a level. LEVEL is driven on the specified port. By
@ -122,7 +122,7 @@
PROPERTIES PROPERTIES
reg = <address> <size> (required) reg = <address> <size> (required)
@ -429,7 +429,7 @@ hw_pal_io_write_buffer (struct hw *me,
{ {
hw_pal_device *hw_pal = (hw_pal_device*) hw_data (me); hw_pal_device *hw_pal = (hw_pal_device*) hw_data (me);
unsigned_1 *byte = (unsigned_1 *) source; unsigned_1 *byte = (unsigned_1 *) source;
switch (addr & hw_pal_address_mask) switch (addr & hw_pal_address_mask)
{ {
@ -467,12 +467,12 @@ hw_pal_io_write_buffer (struct hw *me,
do_counter_write (me, hw_pal, "countdown", do_counter_write (me, hw_pal, "countdown",
&hw_pal->countdown, source, nr_bytes); &hw_pal->countdown, source, nr_bytes);
break; break;
case hw_pal_timer: case hw_pal_timer:
do_counter_write (me, hw_pal, "timer", do_counter_write (me, hw_pal, "timer",
&hw_pal->timer, source, nr_bytes); &hw_pal->timer, source, nr_bytes);
break; break;
} }
return nr_bytes; return nr_bytes;
} }

View File

@ -313,7 +313,7 @@ full_name_of_hw (struct hw *leaf,
strcat (buf, hw_name (leaf)); strcat (buf, hw_name (leaf));
strcat (buf, unit); strcat (buf, unit);
} }
/* return it usefully */ /* return it usefully */
if (buf == full_name) if (buf == full_name)
buf = hw_strdup (leaf, full_name); buf = hw_strdup (leaf, full_name);
@ -362,7 +362,7 @@ hw_create (struct sim_state *sd,
root = root->parent_of_hw; root = root->parent_of_hw;
hw->root_of_hw = root; hw->root_of_hw = root;
} }
/* a unique identifier for the device on the parents bus */ /* a unique identifier for the device on the parents bus */
if (parent != NULL) if (parent != NULL)
{ {
@ -424,7 +424,7 @@ hw_create (struct sim_state *sd,
create_hw_event_data (hw); create_hw_event_data (hw);
create_hw_handle_data (hw); create_hw_handle_data (hw);
create_hw_instance_data (hw); create_hw_instance_data (hw);
return hw; return hw;
} }
@ -461,7 +461,7 @@ hw_finish (struct hw *me)
&& hw_find_property (hw_root (me), "global-trace?") != NULL && hw_find_property (hw_root (me), "global-trace?") != NULL
&& hw_find_boolean_property (hw_root (me), "global-trace?")) && hw_find_boolean_property (hw_root (me), "global-trace?"))
me->trace_of_hw_p = 1; me->trace_of_hw_p = 1;
/* Allow the real device to override any methods */ /* Allow the real device to override any methods */
me->base_of_hw->descriptor->to_finish (me); me->base_of_hw->descriptor->to_finish (me);

View File

@ -50,7 +50,7 @@ hw_ioctl (struct hw *me,
va_end(ap); va_end(ap);
return status; return status;
} }
char * char *
hw_strdup (struct hw *me, const char *str) hw_strdup (struct hw *me, const char *str)
{ {

View File

@ -341,7 +341,7 @@ typedef int (hw_unit_encode_method)
const hw_unit *unit, const hw_unit *unit,
char *encoded, char *encoded,
int sizeof_buf); int sizeof_buf);
#define hw_unit_encode(bus, unit, encoded, sizeof_encoded) \ #define hw_unit_encode(bus, unit, encoded, sizeof_encoded) \
((bus)->to_unit_encode (bus, unit, encoded, sizeof_encoded)) ((bus)->to_unit_encode (bus, unit, encoded, sizeof_encoded))

View File

@ -155,7 +155,7 @@ hw_handle_add_ihandle (struct hw *hw,
struct hw_instance *internal) struct hw_instance *internal)
{ {
struct hw_handle_data *db = hw->handles_of_hw; struct hw_handle_data *db = hw->handles_of_hw;
if (hw_handle_2ihandle (hw, internal) != 0) if (hw_handle_2ihandle (hw, internal) != 0)
{ {
hw_abort (hw, "attempting to add an ihandle already in the data base"); hw_abort (hw, "attempting to add an ihandle already in the data base");
} }
@ -177,7 +177,7 @@ hw_handle_add_phandle (struct hw *hw,
struct hw *internal) struct hw *internal)
{ {
struct hw_handle_data *db = hw->handles_of_hw; struct hw_handle_data *db = hw->handles_of_hw;
if (hw_handle_2phandle (hw, internal) != 0) if (hw_handle_2phandle (hw, internal) != 0)
{ {
hw_abort (hw, "attempting to add a phandle already in the data base"); hw_abort (hw, "attempting to add a phandle already in the data base");
} }
@ -234,5 +234,3 @@ hw_handle_remove_phandle (struct hw *hw,
} }
hw_abort (hw, "attempt to remove nonexistant phandle"); hw_abort (hw, "attempt to remove nonexistant phandle");
} }

View File

@ -156,7 +156,7 @@ int
hw_instance_call_method (struct hw_instance *instance, hw_instance_call_method (struct hw_instance *instance,
const char *method_name, const char *method_name,
int n_stack_args, int n_stack_args,
unsigned_cell stack_args[/*n_stack_args*/], unsigned_cell stack_args[/*n_stack_args*/],
int n_stack_returns, int n_stack_returns,
unsigned_cell stack_returns[/*n_stack_args*/]) unsigned_cell stack_returns[/*n_stack_args*/])
{ {

View File

@ -251,7 +251,7 @@ hw_port_decode (struct hw *me,
{ {
const struct hw_port_descriptor *ports = const struct hw_port_descriptor *ports =
me->ports_of_hw->ports; me->ports_of_hw->ports;
if (ports != NULL) if (ports != NULL)
{ {
while (ports->name != NULL) while (ports->name != NULL)
{ {

View File

@ -26,7 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
struct hw_port_descriptor { struct hw_port_descriptor {
const char *name; const char *name;
int number; int number;
int nr_ports; int nr_ports;
port_direction direction; port_direction direction;
}; };
@ -99,7 +99,7 @@ void hw_port_traverse
(struct hw *me, (struct hw *me,
hw_port_traverse_function *handler, hw_port_traverse_function *handler,
void *data); void *data);
/* DESTINATION is attached (detached) to LINE of the device ME /* DESTINATION is attached (detached) to LINE of the device ME
@ -124,6 +124,6 @@ int hw_port_encode
char *buf, char *buf,
int sizeof_buf, int sizeof_buf,
port_direction direction); port_direction direction);
#endif #endif

View File

@ -85,7 +85,7 @@ hw_add_property (struct hw *me,
{ {
struct hw_property_data *new_entry = NULL; struct hw_property_data *new_entry = NULL;
struct hw_property *new_value = NULL; struct hw_property *new_value = NULL;
/* find the list end */ /* find the list end */
struct hw_property_data **insertion_point = &me->properties_of_hw; struct hw_property_data **insertion_point = &me->properties_of_hw;
while (*insertion_point != NULL) while (*insertion_point != NULL)
@ -94,7 +94,7 @@ hw_add_property (struct hw *me,
return; return;
insertion_point = &(*insertion_point)->next; insertion_point = &(*insertion_point)->next;
} }
/* create a new value */ /* create a new value */
new_value = HW_ZALLOC (me, struct hw_property); new_value = HW_ZALLOC (me, struct hw_property);
new_value->name = (char *) strdup (property); new_value->name = (char *) strdup (property);
@ -109,7 +109,7 @@ hw_add_property (struct hw *me,
new_value->owner = me; new_value->owner = me;
new_value->original = original; new_value->original = original;
new_value->disposition = disposition; new_value->disposition = disposition;
/* insert the value into the list */ /* insert the value into the list */
new_entry = HW_ZALLOC (me, struct hw_property_data); new_entry = HW_ZALLOC (me, struct hw_property_data);
*insertion_point = new_entry; *insertion_point = new_entry;
@ -440,7 +440,7 @@ hw_set_ihandle_property (struct hw *me,
cells = H2BE_cell (hw_instance_to_external (ihandle)); cells = H2BE_cell (hw_instance_to_external (ihandle));
hw_set_property (me, property, ihandle_property, hw_set_property (me, property, ihandle_property,
&cells, sizeof (cells)); &cells, sizeof (cells));
} }
#endif #endif
@ -509,7 +509,7 @@ hw_find_integer_array_property (struct hw *me,
int sizeof_integer = sizeof (*integer); int sizeof_integer = sizeof (*integer);
signed_cell *cell; signed_cell *cell;
HW_TRACE ((me, "hw_find_integer(property=%s)\n", property)); HW_TRACE ((me, "hw_find_integer(property=%s)\n", property));
/* check things sane */ /* check things sane */
node = hw_find_property (me, property); node = hw_find_property (me, property);
if (node == NULL) if (node == NULL)
@ -521,11 +521,11 @@ hw_find_integer_array_property (struct hw *me,
hw_abort (me, "property \"%s\" contains an incomplete number of cells", property); hw_abort (me, "property \"%s\" contains an incomplete number of cells", property);
if (node->sizeof_array <= sizeof_integer * index) if (node->sizeof_array <= sizeof_integer * index)
return 0; return 0;
/* Find and convert the value */ /* Find and convert the value */
cell = ((signed_cell*)node->array) + index; cell = ((signed_cell*)node->array) + index;
*integer = BE2H_cell (*cell); *integer = BE2H_cell (*cell);
return node->sizeof_array / sizeof_integer; return node->sizeof_array / sizeof_integer;
} }
@ -584,7 +584,7 @@ hw_add_range_array_property (struct hw *me,
unsigned_cell *cells = hw_zalloc (me, sizeof_cells); unsigned_cell *cells = hw_zalloc (me, sizeof_cells);
unsigned_cell *cell; unsigned_cell *cell;
int i; int i;
/* copy the property elements over */ /* copy the property elements over */
cell = cells; cell = cells;
for (i = 0; i < nr_ranges; i++) for (i = 0; i < nr_ranges; i++)
@ -594,20 +594,20 @@ hw_add_range_array_property (struct hw *me,
cell = unit_address_to_cells (&range->child_address, cell, cell = unit_address_to_cells (&range->child_address, cell,
hw_unit_nr_address_cells (me)); hw_unit_nr_address_cells (me));
/* copy the parent address */ /* copy the parent address */
cell = unit_address_to_cells (&range->parent_address, cell, cell = unit_address_to_cells (&range->parent_address, cell,
hw_unit_nr_address_cells (hw_parent (me))); hw_unit_nr_address_cells (hw_parent (me)));
/* copy the size */ /* copy the size */
cell = unit_address_to_cells (&range->size, cell, cell = unit_address_to_cells (&range->size, cell,
hw_unit_nr_size_cells (me)); hw_unit_nr_size_cells (me));
} }
ASSERT (cell == &cells[nr_range_property_cells (me, nr_ranges)]); ASSERT (cell == &cells[nr_range_property_cells (me, nr_ranges)]);
/* add it */ /* add it */
hw_add_property (me, property, range_array_property, hw_add_property (me, property, range_array_property,
cells, sizeof_cells, cells, sizeof_cells,
cells, sizeof_cells, cells, sizeof_cells,
NULL, permenant_object); NULL, permenant_object);
hw_free (me, cells); hw_free (me, cells);
} }
@ -621,38 +621,38 @@ hw_find_range_array_property (struct hw *me,
unsigned sizeof_entry = (nr_range_property_cells (me, 1) unsigned sizeof_entry = (nr_range_property_cells (me, 1)
* sizeof (unsigned_cell)); * sizeof (unsigned_cell));
const unsigned_cell *cells; const unsigned_cell *cells;
/* locate the property */ /* locate the property */
node = hw_find_property (me, property); node = hw_find_property (me, property);
if (node == NULL) if (node == NULL)
hw_abort (me, "property \"%s\" not found", property); hw_abort (me, "property \"%s\" not found", property);
if (node->type != range_array_property) if (node->type != range_array_property)
hw_abort (me, "property \"%s\" of wrong type (range array)", property); hw_abort (me, "property \"%s\" of wrong type (range array)", property);
/* aligned ? */ /* aligned ? */
if ((node->sizeof_array % sizeof_entry) != 0) if ((node->sizeof_array % sizeof_entry) != 0)
hw_abort (me, "property \"%s\" contains an incomplete number of entries", hw_abort (me, "property \"%s\" contains an incomplete number of entries",
property); property);
/* within bounds? */ /* within bounds? */
if (node->sizeof_array < sizeof_entry * (index + 1)) if (node->sizeof_array < sizeof_entry * (index + 1))
return 0; return 0;
/* find the range of interest */ /* find the range of interest */
cells = (unsigned_cell*)((char*)node->array + sizeof_entry * index); cells = (unsigned_cell*)((char*)node->array + sizeof_entry * index);
/* copy the child address out - converting as we go */ /* copy the child address out - converting as we go */
cells = cells_to_unit_address (cells, &range->child_address, cells = cells_to_unit_address (cells, &range->child_address,
hw_unit_nr_address_cells (me)); hw_unit_nr_address_cells (me));
/* copy the parent address out - converting as we go */ /* copy the parent address out - converting as we go */
cells = cells_to_unit_address (cells, &range->parent_address, cells = cells_to_unit_address (cells, &range->parent_address,
hw_unit_nr_address_cells (hw_parent (me))); hw_unit_nr_address_cells (hw_parent (me)));
/* copy the size - converting as we go */ /* copy the size - converting as we go */
cells = cells_to_unit_address (cells, &range->size, cells = cells_to_unit_address (cells, &range->size,
hw_unit_nr_size_cells (me)); hw_unit_nr_size_cells (me));
return node->sizeof_array / sizeof_entry; return node->sizeof_array / sizeof_entry;
} }
@ -677,7 +677,7 @@ hw_add_reg_array_property (struct hw *me,
unsigned_cell *cells = hw_zalloc (me, sizeof_cells); unsigned_cell *cells = hw_zalloc (me, sizeof_cells);
unsigned_cell *cell; unsigned_cell *cell;
int i; int i;
/* copy the property elements over */ /* copy the property elements over */
cell = cells; cell = cells;
for (i = 0; i < nr_regs; i++) for (i = 0; i < nr_regs; i++)
@ -691,13 +691,13 @@ hw_add_reg_array_property (struct hw *me,
hw_unit_nr_size_cells (hw_parent (me))); hw_unit_nr_size_cells (hw_parent (me)));
} }
ASSERT (cell == &cells[nr_reg_property_cells (me, nr_regs)]); ASSERT (cell == &cells[nr_reg_property_cells (me, nr_regs)]);
/* add it */ /* add it */
hw_add_property (me, property, reg_array_property, hw_add_property (me, property, reg_array_property,
cells, sizeof_cells, cells, sizeof_cells,
cells, sizeof_cells, cells, sizeof_cells,
NULL, permenant_object); NULL, permenant_object);
hw_free (me, cells); hw_free (me, cells);
} }
@ -711,34 +711,34 @@ hw_find_reg_array_property (struct hw *me,
unsigned sizeof_entry = (nr_reg_property_cells (me, 1) unsigned sizeof_entry = (nr_reg_property_cells (me, 1)
* sizeof (unsigned_cell)); * sizeof (unsigned_cell));
const unsigned_cell *cells; const unsigned_cell *cells;
/* locate the property */ /* locate the property */
node = hw_find_property (me, property); node = hw_find_property (me, property);
if (node == NULL) if (node == NULL)
hw_abort (me, "property \"%s\" not found", property); hw_abort (me, "property \"%s\" not found", property);
if (node->type != reg_array_property) if (node->type != reg_array_property)
hw_abort (me, "property \"%s\" of wrong type (reg array)", property); hw_abort (me, "property \"%s\" of wrong type (reg array)", property);
/* aligned ? */ /* aligned ? */
if ((node->sizeof_array % sizeof_entry) != 0) if ((node->sizeof_array % sizeof_entry) != 0)
hw_abort (me, "property \"%s\" contains an incomplete number of entries", hw_abort (me, "property \"%s\" contains an incomplete number of entries",
property); property);
/* within bounds? */ /* within bounds? */
if (node->sizeof_array < sizeof_entry * (index + 1)) if (node->sizeof_array < sizeof_entry * (index + 1))
return 0; return 0;
/* find the range of interest */ /* find the range of interest */
cells = (unsigned_cell*)((char*)node->array + sizeof_entry * index); cells = (unsigned_cell*)((char*)node->array + sizeof_entry * index);
/* copy the address out - converting as we go */ /* copy the address out - converting as we go */
cells = cells_to_unit_address (cells, &reg->address, cells = cells_to_unit_address (cells, &reg->address,
hw_unit_nr_address_cells (hw_parent (me))); hw_unit_nr_address_cells (hw_parent (me)));
/* copy the size out - converting as we go */ /* copy the size out - converting as we go */
cells = cells_to_unit_address (cells, &reg->size, cells = cells_to_unit_address (cells, &reg->size,
hw_unit_nr_size_cells (hw_parent (me))); hw_unit_nr_size_cells (hw_parent (me)));
return node->sizeof_array / sizeof_entry; return node->sizeof_array / sizeof_entry;
} }

View File

@ -44,27 +44,27 @@
/* manipulate/lookup device names */ /* manipulate/lookup device names */
typedef struct _name_specifier { typedef struct _name_specifier {
/* components in the full length name */ /* components in the full length name */
char *path; char *path;
char *property; char *property;
char *value; char *value;
/* current device */ /* current device */
char *family; char *family;
char *name; char *name;
char *unit; char *unit;
char *args; char *args;
/* previous device */ /* previous device */
char *last_name; char *last_name;
char *last_family; char *last_family;
char *last_unit; char *last_unit;
char *last_args; char *last_args;
/* work area */ /* work area */
char buf[1024]; char buf[1024];
} name_specifier; } name_specifier;
@ -78,7 +78,7 @@ split_device_specifier (struct hw *current,
name_specifier *spec) name_specifier *spec)
{ {
char *chp = NULL; char *chp = NULL;
/* expand any leading alias if present */ /* expand any leading alias if present */
if (current != NULL if (current != NULL
&& *device_specifier != '\0' && *device_specifier != '\0'
@ -114,18 +114,18 @@ split_device_specifier (struct hw *current,
{ {
strcpy(spec->buf, device_specifier); strcpy(spec->buf, device_specifier);
} }
/* check no overflow */ /* check no overflow */
if (strlen(spec->buf) >= sizeof(spec->buf)) if (strlen(spec->buf) >= sizeof(spec->buf))
hw_abort (NULL, "split_device_specifier: buffer overflow\n"); hw_abort (NULL, "split_device_specifier: buffer overflow\n");
/* strip leading spaces */ /* strip leading spaces */
chp = spec->buf; chp = spec->buf;
while (*chp != '\0' && isspace(*chp)) while (*chp != '\0' && isspace(*chp))
chp++; chp++;
if (*chp == '\0') if (*chp == '\0')
return 0; return 0;
/* find the path and terminate it with null */ /* find the path and terminate it with null */
spec->path = chp; spec->path = chp;
while (*chp != '\0' && !isspace(*chp)) while (*chp != '\0' && !isspace(*chp))
@ -135,12 +135,12 @@ split_device_specifier (struct hw *current,
*chp = '\0'; *chp = '\0';
chp++; chp++;
} }
/* and any value */ /* and any value */
while (*chp != '\0' && isspace(*chp)) while (*chp != '\0' && isspace(*chp))
chp++; chp++;
spec->value = chp; spec->value = chp;
/* now go back and chop the property off of the path */ /* now go back and chop the property off of the path */
if (spec->value[0] == '\0') if (spec->value[0] == '\0')
{ {
@ -165,7 +165,7 @@ split_device_specifier (struct hw *current,
spec->property = chp+1; spec->property = chp+1;
} }
} }
/* and mark the rest as invalid */ /* and mark the rest as invalid */
spec->name = NULL; spec->name = NULL;
spec->family = NULL; spec->family = NULL;
@ -175,7 +175,7 @@ split_device_specifier (struct hw *current,
spec->last_family = NULL; spec->last_family = NULL;
spec->last_unit = NULL; spec->last_unit = NULL;
spec->last_args = NULL; spec->last_args = NULL;
return 1; return 1;
} }
@ -239,7 +239,7 @@ split_device_name (name_specifier *spec)
chp = strchr (spec->name, '/'); chp = strchr (spec->name, '/');
if (chp == NULL) if (chp == NULL)
spec->path = strchr (spec->name, '\0'); spec->path = strchr (spec->name, '\0');
else else
{ {
spec->path = chp+1; spec->path = chp+1;
*chp = '\0'; *chp = '\0';
@ -365,15 +365,15 @@ split_find_device (struct hw *current,
else else
break; break;
} }
/* now go through the path proper */ /* now go through the path proper */
if (current == NULL) if (current == NULL)
{ {
split_device_name (spec); split_device_name (spec);
return NULL; return NULL;
} }
while (split_device_name (spec)) while (split_device_name (spec))
{ {
struct hw *child; struct hw *child;
@ -398,7 +398,7 @@ split_find_device (struct hw *current,
return current; /* search failed */ return current; /* search failed */
current = child; current = child;
} }
return current; return current;
} }
@ -411,10 +411,10 @@ split_fill_path (struct hw *current,
/* break it up */ /* break it up */
if (!split_device_specifier (current, device_specifier, spec)) if (!split_device_specifier (current, device_specifier, spec))
hw_abort (current, "error parsing %s\n", device_specifier); hw_abort (current, "error parsing %s\n", device_specifier);
/* fill our tree with its contents */ /* fill our tree with its contents */
current = split_find_device (current, spec); current = split_find_device (current, spec);
/* add any additional devices as needed */ /* add any additional devices as needed */
if (spec->name != NULL) if (spec->name != NULL)
{ {
@ -431,7 +431,7 @@ split_fill_path (struct hw *current,
} }
while (split_device_name (spec)); while (split_device_name (spec));
} }
return current; return current;
} }
@ -540,13 +540,13 @@ parse_reg_property (struct hw *current,
int reg_nr; int reg_nr;
reg_property_spec *regs; reg_property_spec *regs;
const char *chp; const char *chp;
/* determine the number of reg entries by counting tokens */ /* determine the number of reg entries by counting tokens */
nr_regs = count_entries (current, property_name, property_value, 2); nr_regs = count_entries (current, property_name, property_value, 2);
/* create working space */ /* create working space */
regs = zalloc (nr_regs * sizeof (*regs)); regs = zalloc (nr_regs * sizeof (*regs));
/* fill it in */ /* fill it in */
chp = property_value; chp = property_value;
for (reg_nr = 0; reg_nr < nr_regs; reg_nr++) for (reg_nr = 0; reg_nr < nr_regs; reg_nr++)
@ -556,11 +556,11 @@ parse_reg_property (struct hw *current,
chp = parse_size (current, hw_parent(current), chp = parse_size (current, hw_parent(current),
chp, &regs[reg_nr].size); chp, &regs[reg_nr].size);
} }
/* create it */ /* create it */
hw_add_reg_array_property (current, property_name, hw_add_reg_array_property (current, property_name,
regs, nr_regs); regs, nr_regs);
free (regs); free (regs);
} }
@ -576,13 +576,13 @@ parse_ranges_property (struct hw *current,
int range_nr; int range_nr;
range_property_spec *ranges; range_property_spec *ranges;
const char *chp; const char *chp;
/* determine the number of ranges specified */ /* determine the number of ranges specified */
nr_ranges = count_entries (current, property_name, property_value, 3); nr_ranges = count_entries (current, property_name, property_value, 3);
/* create a property of that size */ /* create a property of that size */
ranges = zalloc (nr_ranges * sizeof(*ranges)); ranges = zalloc (nr_ranges * sizeof(*ranges));
/* fill it in */ /* fill it in */
chp = property_value; chp = property_value;
for (range_nr = 0; range_nr < nr_ranges; range_nr++) for (range_nr = 0; range_nr < nr_ranges; range_nr++)
@ -594,10 +594,10 @@ parse_ranges_property (struct hw *current,
chp = parse_size (current, current, chp = parse_size (current, current,
chp, &ranges[range_nr].size); chp, &ranges[range_nr].size);
} }
/* create it */ /* create it */
hw_add_range_array_property (current, property_name, ranges, nr_ranges); hw_add_range_array_property (current, property_name, ranges, nr_ranges);
free (ranges); free (ranges);
} }
@ -654,7 +654,7 @@ parse_string_property (struct hw *current,
const char *chp; const char *chp;
int nr_strings; int nr_strings;
int approx_nr_strings; int approx_nr_strings;
/* get an estimate as to the number of strings by counting double /* get an estimate as to the number of strings by counting double
quotes */ quotes */
approx_nr_strings = 2; approx_nr_strings = 2;
@ -664,22 +664,22 @@ parse_string_property (struct hw *current,
approx_nr_strings++; approx_nr_strings++;
} }
approx_nr_strings = (approx_nr_strings) / 2; approx_nr_strings = (approx_nr_strings) / 2;
/* create a string buffer for that many (plus a null) */ /* create a string buffer for that many (plus a null) */
strings = (char**) zalloc ((approx_nr_strings + 1) * sizeof(char*)); strings = (char**) zalloc ((approx_nr_strings + 1) * sizeof(char*));
/* now find all the strings */ /* now find all the strings */
chp = property_value; chp = property_value;
nr_strings = 0; nr_strings = 0;
while (1) while (1)
{ {
/* skip leading space */ /* skip leading space */
while (*chp != '\0' && isspace (*chp)) while (*chp != '\0' && isspace (*chp))
chp += 1; chp += 1;
if (*chp == '\0') if (*chp == '\0')
break; break;
/* copy it in */ /* copy it in */
if (*chp == '"') if (*chp == '"')
{ {
@ -733,7 +733,7 @@ parse_string_property (struct hw *current,
property_name); property_name);
} }
ASSERT (strings[nr_strings] == NULL); /* from zalloc */ ASSERT (strings[nr_strings] == NULL); /* from zalloc */
/* install it */ /* install it */
if (nr_strings == 0) if (nr_strings == 0)
hw_add_string_property (current, property_name, ""); hw_add_string_property (current, property_name, "");
@ -745,7 +745,7 @@ parse_string_property (struct hw *current,
hw_add_string_array_property (current, property_name, hw_add_string_array_property (current, property_name,
specs, nr_strings); specs, nr_strings);
} }
/* flush the created string */ /* flush the created string */
while (nr_strings > 0) while (nr_strings > 0)
{ {
@ -765,10 +765,10 @@ parse_ihandle_property (struct hw *current,
const char *value) const char *value)
{ {
ihandle_runtime_property_spec ihandle; ihandle_runtime_property_spec ihandle;
/* pass the full path */ /* pass the full path */
ihandle.full_path = value; ihandle.full_path = value;
/* save this ready for the ihandle create */ /* save this ready for the ihandle create */
hw_add_ihandle_runtime_property (current, property, hw_add_ihandle_runtime_property (current, property,
&ihandle); &ihandle);
@ -806,7 +806,7 @@ hw_tree_parse (struct hw *current,
va_end (ap); va_end (ap);
return current; return current;
} }
struct hw * struct hw *
hw_tree_vparse (struct hw *current, hw_tree_vparse (struct hw *current,
const char *fmt, const char *fmt,
@ -814,15 +814,15 @@ hw_tree_vparse (struct hw *current,
{ {
char device_specifier[1024]; char device_specifier[1024];
name_specifier spec; name_specifier spec;
/* format the path */ /* format the path */
vsprintf (device_specifier, fmt, ap); vsprintf (device_specifier, fmt, ap);
if (strlen (device_specifier) >= sizeof (device_specifier)) if (strlen (device_specifier) >= sizeof (device_specifier))
hw_abort (NULL, "device_tree_add_deviced: buffer overflow\n"); hw_abort (NULL, "device_tree_add_deviced: buffer overflow\n");
/* construct the tree down to the final struct hw */ /* construct the tree down to the final struct hw */
current = split_fill_path (current, device_specifier, &spec); current = split_fill_path (current, device_specifier, &spec);
/* is there an interrupt spec */ /* is there an interrupt spec */
if (spec.property == NULL if (spec.property == NULL
&& spec.value != NULL) && spec.value != NULL)
@ -862,7 +862,7 @@ hw_tree_vparse (struct hw *current,
break; break;
} }
} }
/* is there a property */ /* is there a property */
if (spec.property != NULL) if (spec.property != NULL)
{ {
@ -1102,7 +1102,7 @@ print_properties (struct hw *me,
if (property->original != NULL) if (property->original != NULL)
{ {
p->print (p->file, " !"); p->print (p->file, " !");
p->print (p->file, "%s/%s", p->print (p->file, "%s/%s",
hw_path (property->original->owner), hw_path (property->original->owner),
property->original->name); property->original->name);
} }
@ -1259,17 +1259,17 @@ hw_tree_find_device (struct hw *root,
{ {
struct hw *node; struct hw *node;
name_specifier spec; name_specifier spec;
/* parse the path */ /* parse the path */
split_device_specifier (root, path_to_device, &spec); split_device_specifier (root, path_to_device, &spec);
if (spec.value != NULL) if (spec.value != NULL)
return NULL; /* something wierd */ return NULL; /* something wierd */
/* now find it */ /* now find it */
node = split_find_device (root, &spec); node = split_find_device (root, &spec);
if (spec.name != NULL) if (spec.name != NULL)
return NULL; /* not a leaf */ return NULL; /* not a leaf */
return node; return node;
} }

View File

@ -102,11 +102,11 @@ main (int argc, char **argv)
prog_bfd = bfd_openr (name, 0); prog_bfd = bfd_openr (name, 0);
if (prog_bfd == NULL) if (prog_bfd == NULL)
{ {
fprintf (stderr, "%s: can't open \"%s\": %s\n", fprintf (stderr, "%s: can't open \"%s\": %s\n",
myname, name, bfd_errmsg (bfd_get_error ())); myname, name, bfd_errmsg (bfd_get_error ()));
exit (1); exit (1);
} }
if (!bfd_check_format (prog_bfd, bfd_object)) if (!bfd_check_format (prog_bfd, bfd_object))
{ {
fprintf (stderr, "%s: \"%s\" is not an object file: %s\n", fprintf (stderr, "%s: \"%s\" is not an object file: %s\n",
myname, name, bfd_errmsg (bfd_get_error ())); myname, name, bfd_errmsg (bfd_get_error ()));
@ -155,10 +155,10 @@ main (int argc, char **argv)
/* remain on breakpoint or signals in oe mode*/ /* remain on breakpoint or signals in oe mode*/
while (((reason == sim_signalled) && while (((reason == sim_signalled) &&
(sigrc == sim_signal_to_host (sd, SIM_SIGTRAP))) || (sigrc == sim_signal_to_host (sd, SIM_SIGTRAP))) ||
((reason == sim_stopped) && ((reason == sim_stopped) &&
(STATE_ENVIRONMENT (sd) == OPERATING_ENVIRONMENT))); (STATE_ENVIRONMENT (sd) == OPERATING_ENVIRONMENT)));
} }
else else
{ {
do do
{ {
@ -175,28 +175,28 @@ main (int argc, char **argv)
sim_resume (sd, 0, sigrc); sim_resume (sd, 0, sigrc);
signal (SIGINT, prev_sigint); signal (SIGINT, prev_sigint);
sim_stop_reason (sd, &reason, &sigrc); sim_stop_reason (sd, &reason, &sigrc);
if ((reason == sim_stopped) && if ((reason == sim_stopped) &&
(sigrc == sim_signal_to_host (sd, SIM_SIGINT))) (sigrc == sim_signal_to_host (sd, SIM_SIGINT)))
break; /* exit on control-C */ break; /* exit on control-C */
/* remain on signals in oe mode */ /* remain on signals in oe mode */
} while ((reason == sim_stopped) && } while ((reason == sim_stopped) &&
(STATE_ENVIRONMENT (sd) == OPERATING_ENVIRONMENT)); (STATE_ENVIRONMENT (sd) == OPERATING_ENVIRONMENT));
} }
/* Print any stats the simulator collected. */ /* Print any stats the simulator collected. */
if (STATE_VERBOSE_P (sd)) if (STATE_VERBOSE_P (sd))
sim_info (sd, 0); sim_info (sd, 0);
/* Shutdown the simulator. */ /* Shutdown the simulator. */
sim_close (sd, 0); sim_close (sd, 0);
/* If reason is sim_exited, then sigrc holds the exit code which we want /* If reason is sim_exited, then sigrc holds the exit code which we want
to return. If reason is sim_stopped or sim_signalled, then sigrc holds to return. If reason is sim_stopped or sim_signalled, then sigrc holds
the signal that the simulator received; we want to return that to the signal that the simulator received; we want to return that to
indicate failure. */ indicate failure. */
/* Why did we stop? */ /* Why did we stop? */
switch (reason) switch (reason)
{ {

View File

@ -1,7 +1,7 @@
/* This file defines the part of the interface between the standalone /* This file defines the part of the interface between the standalone
simaulator program - run - and simulator library - libsim.a - that simaulator program - run - and simulator library - libsim.a - that
is not used by GDB. The GDB part is described in include/remote-sim.h. is not used by GDB. The GDB part is described in include/remote-sim.h.
Copyright 2002, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Copyright 2002, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of GDB. This file is part of GDB.

View File

@ -352,7 +352,7 @@ usage (int help)
exit (help ? 0 : 1); exit (help ? 0 : 1);
} }
static void static void
print_version () print_version ()
{ {
printf ("GNU simulator %s%s\n", PKGVERSION, version); printf ("GNU simulator %s%s\n", PKGVERSION, version);

View File

@ -82,7 +82,7 @@
if (ALU16_HAD_OVERFLOW) \ if (ALU16_HAD_OVERFLOW) \
sim_engine_halt (...); \ sim_engine_halt (...); \
(RES) = ALU16_OVERFLOW_RESULT (RES) = ALU16_OVERFLOW_RESULT
ALU*_HAD_CARRY_BORROW: Returns a nonzero value if unsigned ALU*_HAD_CARRY_BORROW: Returns a nonzero value if unsigned
overflow or underflow (also referred to as carry and borrow) overflow or underflow (also referred to as carry and borrow)
occurred. occurred.
@ -93,8 +93,8 @@
#define ALU64_END(RES) \ #define ALU64_END(RES) \
State.carry = ALU64_HAD_CARRY_BORROW; \ State.carry = ALU64_HAD_CARRY_BORROW; \
(RES) = ALU64_CARRY_BORROW_RESULT (RES) = ALU64_CARRY_BORROW_RESULT
Addition: Addition:
ALU*_ADD(VAL): Add VAL to the ALU accumulator. Record any ALU*_ADD(VAL): Add VAL to the ALU accumulator. Record any
@ -135,7 +135,7 @@
/* Twos complement arithmetic - addition/subtraction - carry/borrow /* Twos complement arithmetic - addition/subtraction - carry/borrow
(or you thought you knew the answer to 0-0) (or you thought you knew the answer to 0-0)
Notation and Properties: Notation and Properties:
@ -154,7 +154,7 @@
UMAXn: The upper bound of an unsigned N bit value (the lower UMAXn: The upper bound of an unsigned N bit value (the lower
bound is always zero). bound is always zero).
Un: UMAXn + 1. Unsigned arithmetic is computed `modulo (Un)'. Un: UMAXn + 1. Unsigned arithmetic is computed `modulo (Un)'.
X[p]: Is bit P of X. X[0] denotes the least significant bit. X[p]: Is bit P of X. X[0] denotes the least significant bit.
@ -193,7 +193,7 @@
The two N bit operands are sign extended to M>N bits and then The two N bit operands are sign extended to M>N bits and then
added. Overflow occurs when SIGN_BIT<n> and SIGN_BIT<m> do not added. Overflow occurs when SIGN_BIT<n> and SIGN_BIT<m> do not
match. match.
Rm = (SEXTn (Xn) + SEXTn (Yn)) Rm = (SEXTn (Xn) + SEXTn (Yn))
V = MSBn ((Rm >> (M - N)) ^ Rm) V = MSBn ((Rm >> (M - N)) ^ Rm)
@ -241,7 +241,7 @@
The following table lists the output for all given inputs into a The following table lists the output for all given inputs into a
full-adder. full-adder.
I X Y R | C I X Y R | C
------------+--- ------------+---
0 0 0 0 | 0 0 0 0 0 | 0
@ -264,7 +264,7 @@
XY\R 0 1 XY\R 0 1
+------- +-------
00 | 0 0 00 | 0 0
01 | 1 0 01 | 1 0
11 | 1 1 11 | 1 1
10 | 1 0 10 | 1 0
@ -275,7 +275,7 @@
Verifying: Verifying:
I X Y R | C | X&Y X&~R Y&~R I X Y R | C | X&Y X&~R Y&~R
------------+---+--------------- ------------+---+---------------
0 0 0 0 | 0 | 0 0 0 0 0 0 0 | 0 | 0 0 0
0 0 1 1 | 0 | 0 0 0 0 0 1 1 | 0 | 0 0 0

View File

@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */

View File

@ -34,7 +34,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
CIA_ADDR to return the integral value. *-/ CIA_ADDR to return the integral value. *-/
/-* #define CIA_ADDR(cia) (...) *-/ /-* #define CIA_ADDR(cia) (...) *-/
#include "sim-base.h" #include "sim-base.h"
finally, two data types `struct _sim_cpu' and `struct sim_state' finally, two data types `struct _sim_cpu' and `struct sim_state'
are defined: are defined:

View File

@ -49,7 +49,7 @@ extern int asprintf (char **result, const char *format, ...);
#endif #endif
/* Some versions of GCC include an attribute operator, define it */ /* Some versions of GCC include an attribute operator, define it */
#if !defined (__attribute__) #if !defined (__attribute__)

View File

@ -224,8 +224,8 @@ sim_config (SIM_DESC sd)
config_stdio_to_a (current_stdio)); config_stdio_to_a (current_stdio));
return SIM_RC_FAIL; return SIM_RC_FAIL;
} }
/* check the value of MSB */ /* check the value of MSB */
if (WITH_TARGET_WORD_MSB != 0 if (WITH_TARGET_WORD_MSB != 0
&& WITH_TARGET_WORD_MSB != (WITH_TARGET_WORD_BITSIZE - 1)) && WITH_TARGET_WORD_MSB != (WITH_TARGET_WORD_BITSIZE - 1))
@ -234,8 +234,8 @@ sim_config (SIM_DESC sd)
WITH_TARGET_WORD_BITSIZE, WITH_TARGET_WORD_MSB); WITH_TARGET_WORD_BITSIZE, WITH_TARGET_WORD_MSB);
return SIM_RC_FAIL; return SIM_RC_FAIL;
} }
/* set the environment */ /* set the environment */
#if (WITH_TREE_PROPERTIES) #if (WITH_TREE_PROPERTIES)
if (STATE_ENVIRONMENT (sd) == ALL_ENVIRONMENT) if (STATE_ENVIRONMENT (sd) == ALL_ENVIRONMENT)
@ -256,8 +256,8 @@ sim_config (SIM_DESC sd)
#endif #endif
if (STATE_ENVIRONMENT (sd) == ALL_ENVIRONMENT) if (STATE_ENVIRONMENT (sd) == ALL_ENVIRONMENT)
STATE_ENVIRONMENT (sd) = DEFAULT_ENVIRONMENT; STATE_ENVIRONMENT (sd) = DEFAULT_ENVIRONMENT;
/* set the alignment */ /* set the alignment */
#if (WITH_TREE_PROPERTIES) #if (WITH_TREE_PROPERTIES)
if (current_alignment == 0) if (current_alignment == 0)
@ -270,7 +270,7 @@ sim_config (SIM_DESC sd)
current_alignment = WITH_ALIGNMENT; current_alignment = WITH_ALIGNMENT;
if (current_alignment == 0) if (current_alignment == 0)
current_alignment = WITH_DEFAULT_ALIGNMENT; current_alignment = WITH_DEFAULT_ALIGNMENT;
/* verify the alignment */ /* verify the alignment */
if (CURRENT_ALIGNMENT == 0) if (CURRENT_ALIGNMENT == 0)
{ {
@ -284,13 +284,13 @@ sim_config (SIM_DESC sd)
config_alignment_to_a (current_alignment)); config_alignment_to_a (current_alignment));
return SIM_RC_FAIL; return SIM_RC_FAIL;
} }
#if defined (WITH_FLOATING_POINT) #if defined (WITH_FLOATING_POINT)
/* set the floating point */ /* set the floating point */
if (current_floating_point == 0) if (current_floating_point == 0)
current_floating_point = WITH_FLOATING_POINT; current_floating_point = WITH_FLOATING_POINT;
/* verify the floating point */ /* verify the floating point */
if (CURRENT_FLOATING_POINT == 0) if (CURRENT_FLOATING_POINT == 0)
{ {
@ -304,7 +304,7 @@ sim_config (SIM_DESC sd)
config_alignment_to_a (current_floating_point)); config_alignment_to_a (current_floating_point));
return SIM_RC_FAIL; return SIM_RC_FAIL;
} }
#endif #endif
return SIM_RC_OK; return SIM_RC_OK;
} }
@ -374,9 +374,9 @@ print_sim_config (SIM_DESC sd)
#if defined (WITH_RESERVED_BITS) #if defined (WITH_RESERVED_BITS)
sim_io_printf (sd, "WITH_RESERVED_BITS = %d\n", WITH_RESERVED_BITS); sim_io_printf (sd, "WITH_RESERVED_BITS = %d\n", WITH_RESERVED_BITS);
#endif #endif
#if defined (WITH_PROFILE) #if defined (WITH_PROFILE)
sim_io_printf (sd, "WITH_PROFILE = %d\n", WITH_PROFILE); sim_io_printf (sd, "WITH_PROFILE = %d\n", WITH_PROFILE);
#endif #endif
} }

View File

@ -220,7 +220,7 @@ sim_core_map_attach (SIM_DESC sd,
last_mapping = &next_mapping->next; last_mapping = &next_mapping->next;
next_mapping = next_mapping->next; next_mapping = next_mapping->next;
} }
/* check insertion point correct */ /* check insertion point correct */
SIM_ASSERT (next_mapping == NULL || next_mapping->level >= level); SIM_ASSERT (next_mapping == NULL || next_mapping->level >= level);
if (next_mapping != NULL && next_mapping->level == level if (next_mapping != NULL && next_mapping->level == level
@ -376,7 +376,7 @@ sim_core_attach (SIM_DESC sd,
} }
/* attach the region to all applicable access maps */ /* attach the region to all applicable access maps */
for (map = 0; for (map = 0;
map < nr_maps; map < nr_maps;
map++) map++)
{ {
@ -388,7 +388,7 @@ sim_core_attach (SIM_DESC sd,
free_buffer = NULL; free_buffer = NULL;
} }
} }
/* Just copy this map to each of the processor specific data structures. /* Just copy this map to each of the processor specific data structures.
FIXME - later this will be replaced by true processor specific FIXME - later this will be replaced by true processor specific
maps. */ maps. */
@ -538,9 +538,9 @@ sim_core_read_buffer (SIM_DESC sd,
(unsigned_1*)buffer + count, (unsigned_1*)buffer + count,
mapping->space, mapping->space,
raddr, raddr,
nr_bytes, nr_bytes,
sd, sd,
cpu, cpu,
cia) != nr_bytes) cia) != nr_bytes)
break; break;
count += nr_bytes; count += nr_bytes;
@ -607,7 +607,7 @@ sim_core_write_buffer (SIM_DESC sd,
raddr, raddr,
nr_bytes, nr_bytes,
sd, sd,
cpu, cpu,
cia) != nr_bytes) cia) != nr_bytes)
break; break;
count += nr_bytes; count += nr_bytes;
@ -672,7 +672,7 @@ sim_core_set_xor (SIM_DESC sd,
core->byte_xor = WITH_XOR_ENDIAN - 1; core->byte_xor = WITH_XOR_ENDIAN - 1;
else else
core->byte_xor = 0; core->byte_xor = 0;
} }
} }
} }
else { else {
@ -749,8 +749,8 @@ sim_core_xor_read_buffer (SIM_DESC sd,
} }
} }
#endif #endif
#if EXTERN_SIM_CORE_P #if EXTERN_SIM_CORE_P
unsigned unsigned
sim_core_xor_write_buffer (SIM_DESC sd, sim_core_xor_write_buffer (SIM_DESC sd,

View File

@ -278,7 +278,7 @@ DECLARE_SIM_CORE_WRITE_N(aligned,4,4)
DECLARE_SIM_CORE_WRITE_N(aligned,8,8) DECLARE_SIM_CORE_WRITE_N(aligned,8,8)
DECLARE_SIM_CORE_WRITE_N(aligned,16,16) DECLARE_SIM_CORE_WRITE_N(aligned,16,16)
#define sim_core_write_unaligned_1 sim_core_write_aligned_1 #define sim_core_write_unaligned_1 sim_core_write_aligned_1
DECLARE_SIM_CORE_WRITE_N(unaligned,2,2) DECLARE_SIM_CORE_WRITE_N(unaligned,2,2)
DECLARE_SIM_CORE_WRITE_N(unaligned,4,4) DECLARE_SIM_CORE_WRITE_N(unaligned,4,4)
DECLARE_SIM_CORE_WRITE_N(unaligned,8,8) DECLARE_SIM_CORE_WRITE_N(unaligned,8,8)

View File

@ -73,7 +73,7 @@ extern void sim_engine_halt
if ((LAST_CPU) != NULL) CIA_SET (LAST_CPU, CIA) if ((LAST_CPU) != NULL) CIA_SET (LAST_CPU, CIA)
#endif #endif
/* NB: If a port uses the SIM_CPU_EXCEPTION_* hooks, the default /* NB: If a port uses the SIM_CPU_EXCEPTION_* hooks, the default
SIM_ENGINE_HALT_HOOK and SIM_ENGINE_RESUME_HOOK must not be used. SIM_ENGINE_HALT_HOOK and SIM_ENGINE_RESUME_HOOK must not be used.
They conflict in that the PC set by the HALT_HOOK may overwrite the They conflict in that the PC set by the HALT_HOOK may overwrite the
proper one, as intended to be saved by the EXCEPTION_TRIGGER proper one, as intended to be saved by the EXCEPTION_TRIGGER

View File

@ -74,7 +74,7 @@ typedef enum {
watch_sim_le_2, watch_sim_le_2,
watch_sim_le_4, watch_sim_le_4,
watch_sim_le_8, watch_sim_le_8,
/* wallclock */ /* wallclock */
watch_clock, watch_clock,
@ -111,7 +111,7 @@ struct _sim_event {
/* The event queue maintains a single absolute time using two /* The event queue maintains a single absolute time using two
variables. variables.
TIME_OF_EVENT: this holds the time at which the next event is ment TIME_OF_EVENT: this holds the time at which the next event is ment
to occur. If no next event it will hold the time of the last to occur. If no next event it will hold the time of the last
event. event.
@ -387,7 +387,7 @@ sim_events_remain_time (SIM_DESC sd, sim_event *event)
{ {
if (event == 0) if (event == 0)
return 0; return 0;
return (event->time_of_event - sim_events_time (sd)); return (event->time_of_event - sim_events_time (sd));
} }
@ -447,10 +447,10 @@ insert_sim_event (SIM_DESC sd,
if (delta < 0) if (delta < 0)
sim_io_error (sd, "what is past is past!\n"); sim_io_error (sd, "what is past is past!\n");
/* compute when the event should occur */ /* compute when the event should occur */
time_of_event = sim_events_time (sd) + delta; time_of_event = sim_events_time (sd) + delta;
/* find the queue insertion point - things are time ordered */ /* find the queue insertion point - things are time ordered */
prev = &events->queue; prev = &events->queue;
curr = events->queue; curr = events->queue;
@ -462,12 +462,12 @@ insert_sim_event (SIM_DESC sd,
curr = curr->next; curr = curr->next;
} }
SIM_ASSERT (curr == NULL || time_of_event < curr->time_of_event); SIM_ASSERT (curr == NULL || time_of_event < curr->time_of_event);
/* insert it */ /* insert it */
new_event->next = curr; new_event->next = curr;
*prev = new_event; *prev = new_event;
new_event->time_of_event = time_of_event; new_event->time_of_event = time_of_event;
/* adjust the time until the first event */ /* adjust the time until the first event */
update_time_from_event (sd); update_time_from_event (sd);
} }
@ -554,7 +554,7 @@ sim_events_schedule_after_signal (SIM_DESC sd,
sigfillset(&new_mask); sigfillset(&new_mask);
sigprocmask (SIG_SETMASK, &new_mask, &old_mask); sigprocmask (SIG_SETMASK, &new_mask, &old_mask);
#endif #endif
/* allocate an event entry from the signal buffer */ /* allocate an event entry from the signal buffer */
new_event = &events->held [events->nr_held]; new_event = &events->held [events->nr_held];
events->nr_held ++; events->nr_held ++;
@ -563,7 +563,7 @@ sim_events_schedule_after_signal (SIM_DESC sd,
sim_engine_abort (NULL, NULL, NULL_CIA, sim_engine_abort (NULL, NULL, NULL_CIA,
"sim_events_schedule_after_signal - buffer oveflow"); "sim_events_schedule_after_signal - buffer oveflow");
} }
new_event->data = data; new_event->data = data;
new_event->handler = handler; new_event->handler = handler;
new_event->time_of_event = delta_time; /* work it out later */ new_event->time_of_event = delta_time; /* work it out later */
@ -575,7 +575,7 @@ sim_events_schedule_after_signal (SIM_DESC sd,
/*-UNLOCK-*/ /*-UNLOCK-*/
sigprocmask (SIG_SETMASK, &old_mask, NULL); sigprocmask (SIG_SETMASK, &old_mask, NULL);
#endif #endif
ETRACE ((_ETRACE, ETRACE ((_ETRACE,
"signal scheduled at %ld - tag 0x%lx - time %ld, handler 0x%lx, data 0x%lx\n", "signal scheduled at %ld - tag 0x%lx - time %ld, handler 0x%lx, data 0x%lx\n",
(long)sim_events_time(sd), (long)sim_events_time(sd),
@ -1105,7 +1105,7 @@ sim_events_process (SIM_DESC sd)
if (events->nr_held > 0) if (events->nr_held > 0)
{ {
int i; int i;
#if defined(HAVE_SIGPROCMASK) && defined(SIG_SETMASK) #if defined(HAVE_SIGPROCMASK) && defined(SIG_SETMASK)
/*-LOCK-*/ /*-LOCK-*/
sigset_t old_mask; sigset_t old_mask;
@ -1123,14 +1123,14 @@ sim_events_process (SIM_DESC sd)
entry->data); entry->data);
} }
events->nr_held = 0; events->nr_held = 0;
#if defined(HAVE_SIGPROCMASK) && defined(SIG_SETMASK) #if defined(HAVE_SIGPROCMASK) && defined(SIG_SETMASK)
/*-UNLOCK-*/ /*-UNLOCK-*/
sigprocmask(SIG_SETMASK, &old_mask, NULL); sigprocmask(SIG_SETMASK, &old_mask, NULL);
#endif #endif
} }
/* Process any watchpoints. Be careful to allow a watchpoint to /* Process any watchpoints. Be careful to allow a watchpoint to
appear/disappear under our feet. appear/disappear under our feet.
To ensure that watchpoints are processed only once per cycle, To ensure that watchpoints are processed only once per cycle,
@ -1162,7 +1162,7 @@ sim_events_process (SIM_DESC sd)
events->watchedpoints = to_do; events->watchedpoints = to_do;
} }
} }
/* consume all events for this or earlier times. Be careful to /* consume all events for this or earlier times. Be careful to
allow an event to appear/disappear under our feet */ allow an event to appear/disappear under our feet */
while (events->queue->time_of_event < while (events->queue->time_of_event <
@ -1184,13 +1184,13 @@ sim_events_process (SIM_DESC sd)
sim_events_free (sd, to_do); sim_events_free (sd, to_do);
handler (sd, data); handler (sd, data);
} }
/* put things back where they belong ready for the next iteration */ /* put things back where they belong ready for the next iteration */
events->watchpoints = events->watchedpoints; events->watchpoints = events->watchedpoints;
events->watchedpoints = NULL; events->watchedpoints = NULL;
if (events->watchpoints != NULL) if (events->watchpoints != NULL)
events->work_pending = 1; events->work_pending = 1;
/* advance the time */ /* advance the time */
SIM_ASSERT (events->time_from_event >= events->nr_ticks_to_process); SIM_ASSERT (events->time_from_event >= events->nr_ticks_to_process);
SIM_ASSERT (events->queue != NULL); /* always poll event */ SIM_ASSERT (events->queue != NULL); /* always poll event */

View File

@ -55,7 +55,7 @@
if (events-were-next) if (events-were-next)
next-cpu-nr = 0; next-cpu-nr = 0;
.... // prime main loop .... // prime main loop
while (1) while (1)
{ {

View File

@ -43,7 +43,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "sim-assert.h" #include "sim-assert.h"
/* Debugging support. /* Debugging support.
If digits is -1, then print all digits. */ If digits is -1, then print all digits. */
static void static void
@ -78,7 +78,7 @@ print_bits (unsigned64 x,
typedef union { typedef union {
double d; double d;
unsigned64 i; unsigned64 i;
} sim_fpu_map; } sim_fpu_map;
/* A packed IEEE floating point number. /* A packed IEEE floating point number.
@ -94,7 +94,7 @@ typedef union {
Zero (0 == BIASEDEXP && FRAC == 0): Zero (0 == BIASEDEXP && FRAC == 0):
(sign ? "-" : "+") 0.0 (sign ? "-" : "+") 0.0
Infinity (BIASEDEXP == EXPMAX && FRAC == 0): Infinity (BIASEDEXP == EXPMAX && FRAC == 0):
(sign ? "-" : "+") "infinity" (sign ? "-" : "+") "infinity"
@ -254,7 +254,7 @@ pack_fpu (const sim_fpu *src,
/* Infinity */ /* Infinity */
sign = src->sign; sign = src->sign;
exp = EXPMAX; exp = EXPMAX;
fraction = 0; fraction = 0;
} }
else else
{ {
@ -309,7 +309,7 @@ pack_fpu (const sim_fpu *src,
(long) LSEXTRACTED32 (packed, 23 - 1, 0)); (long) LSEXTRACTED32 (packed, 23 - 1, 0));
} }
#endif #endif
return packed; return packed;
} }
@ -536,7 +536,7 @@ i2fpu (sim_fpu *f, signed64 i, int is_64bit)
f->sign = (i < 0); f->sign = (i < 0);
f->normal_exp = NR_FRAC_GUARD; f->normal_exp = NR_FRAC_GUARD;
if (f->sign) if (f->sign)
{ {
/* Special case for minint, since there is no corresponding /* Special case for minint, since there is no corresponding
+ve integer representation for it */ +ve integer representation for it */
@ -553,7 +553,7 @@ i2fpu (sim_fpu *f, signed64 i, int is_64bit)
if (f->fraction >= IMPLICIT_2) if (f->fraction >= IMPLICIT_2)
{ {
do do
{ {
f->fraction = (f->fraction >> 1) | (f->fraction & 1); f->fraction = (f->fraction >> 1) | (f->fraction & 1);
f->normal_exp += 1; f->normal_exp += 1;
@ -896,7 +896,7 @@ do_round (sim_fpu *f,
return 0; return 0;
break; break;
case sim_fpu_class_snan: case sim_fpu_class_snan:
/* Quieten a SignalingNaN */ /* Quieten a SignalingNaN */
f->class = sim_fpu_class_qnan; f->class = sim_fpu_class_qnan;
return sim_fpu_status_invalid_snan; return sim_fpu_status_invalid_snan;
break; break;
@ -1371,14 +1371,14 @@ sim_fpu_mul (sim_fpu *f,
res2 += ((ps_hh__ >> 32) & 0xffffffff) + pp_hh; res2 += ((ps_hh__ >> 32) & 0xffffffff) + pp_hh;
high = res2; high = res2;
low = res0; low = res0;
f->normal_exp = l->normal_exp + r->normal_exp; f->normal_exp = l->normal_exp + r->normal_exp;
f->sign = l->sign ^ r->sign; f->sign = l->sign ^ r->sign;
f->class = sim_fpu_class_number; f->class = sim_fpu_class_number;
/* Input is bounded by [1,2) ; [2^60,2^61) /* Input is bounded by [1,2) ; [2^60,2^61)
Output is bounded by [1,4) ; [2^120,2^122) */ Output is bounded by [1,4) ; [2^120,2^122) */
/* Adjust the exponent according to where the decimal point ended /* Adjust the exponent according to where the decimal point ended
up in the high 64 bit word. In the source the decimal point up in the high 64 bit word. In the source the decimal point
was at NR_FRAC_GUARD. */ was at NR_FRAC_GUARD. */
@ -1511,7 +1511,7 @@ sim_fpu_div (sim_fpu *f,
f->normal_exp--; f->normal_exp--;
} }
ASSERT (numerator >= denominator); ASSERT (numerator >= denominator);
/* Gain extra precision, already used one spare bit */ /* Gain extra precision, already used one spare bit */
numerator <<= NR_SPARE; numerator <<= NR_SPARE;
denominator <<= NR_SPARE; denominator <<= NR_SPARE;
@ -1610,7 +1610,7 @@ sim_fpu_max (sim_fpu *f,
} }
ASSERT (l->sign == r->sign); ASSERT (l->sign == r->sign);
if (l->normal_exp > r->normal_exp if (l->normal_exp > r->normal_exp
|| (l->normal_exp == r->normal_exp && || (l->normal_exp == r->normal_exp &&
l->fraction > r->fraction)) l->fraction > r->fraction))
{ {
/* |l| > |r| */ /* |l| > |r| */
@ -1693,7 +1693,7 @@ sim_fpu_min (sim_fpu *f,
} }
ASSERT (l->sign == r->sign); ASSERT (l->sign == r->sign);
if (l->normal_exp > r->normal_exp if (l->normal_exp > r->normal_exp
|| (l->normal_exp == r->normal_exp && || (l->normal_exp == r->normal_exp &&
l->fraction > r->fraction)) l->fraction > r->fraction))
{ {
/* |l| > |r| */ /* |l| > |r| */
@ -1808,20 +1808,20 @@ sim_fpu_sqrt (sim_fpu *f,
* *
* Developed at SunPro, a Sun Microsystems, Inc. business. * Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this * Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice * software is freely granted, provided that this notice
* is preserved. * is preserved.
* ==================================================== * ====================================================
*/ */
/* __ieee754_sqrt(x) /* __ieee754_sqrt(x)
* Return correctly rounded sqrt. * Return correctly rounded sqrt.
* ------------------------------------------ * ------------------------------------------
* | Use the hardware sqrt if you have one | * | Use the hardware sqrt if you have one |
* ------------------------------------------ * ------------------------------------------
* Method: * Method:
* Bit by bit method using integer arithmetic. (Slow, but portable) * Bit by bit method using integer arithmetic. (Slow, but portable)
* 1. Normalization * 1. Normalization
* Scale x to y in [1,4) with even powers of 2: * Scale x to y in [1,4) with even powers of 2:
* find an integer k such that 1 <= (y=x*2^(2k)) < 4, then * find an integer k such that 1 <= (y=x*2^(2k)) < 4, then
* sqrt(x) = 2^k * sqrt(y) * sqrt(x) = 2^k * sqrt(y)
- -
@ -1841,9 +1841,9 @@ sim_fpu_sqrt (sim_fpu *f,
* i+1 2 * i+1 2
* s = 2*q , and y = 2 * ( y - q ). (1) * s = 2*q , and y = 2 * ( y - q ). (1)
* i i i i * i i i i
* *
* To compute q from q , one checks whether * To compute q from q , one checks whether
* i+1 i * i+1 i
* *
* -(i+1) 2 * -(i+1) 2
* (q + 2 ) <= y. (2) * (q + 2 ) <= y. (2)
@ -1853,12 +1853,12 @@ sim_fpu_sqrt (sim_fpu *f,
* i+1 i i+1 i * i+1 i i+1 i
* *
* With some algebric manipulation, it is not difficult to see * With some algebric manipulation, it is not difficult to see
* that (2) is equivalent to * that (2) is equivalent to
* -(i+1) * -(i+1)
* s + 2 <= y (3) * s + 2 <= y (3)
* i i * i i
* *
* The advantage of (3) is that s and y can be computed by * The advantage of (3) is that s and y can be computed by
* i i * i i
* the following recurrence formula: * the following recurrence formula:
* if (3) is false * if (3) is false
@ -1874,15 +1874,15 @@ sim_fpu_sqrt (sim_fpu *f,
* -i -(i+1) * -i -(i+1)
* s = s + 2 , y = y - s - 2 (5) * s = s + 2 , y = y - s - 2 (5)
* i+1 i i+1 i i * i+1 i i+1 i i
* *
- -
- -(i+1) - -(i+1)
- NOTE: y = 2 (y - s - 2 ) - NOTE: y = 2 (y - s - 2 )
- i+1 i i - i+1 i i
- -
* One may easily use induction to prove (4) and (5). * One may easily use induction to prove (4) and (5).
* Note. Since the left hand side of (3) contain only i+2 bits, * Note. Since the left hand side of (3) contain only i+2 bits,
* it does not necessary to do a full (53-bit) comparison * it does not necessary to do a full (53-bit) comparison
* in (3). * in (3).
* 3. Final rounding * 3. Final rounding
* After generating the 53 bits result, we compute one more bit. * After generating the 53 bits result, we compute one more bit.
@ -1892,7 +1892,7 @@ sim_fpu_sqrt (sim_fpu *f,
* The rounding mode can be detected by checking whether * The rounding mode can be detected by checking whether
* huge + tiny is equal to huge, and whether huge - tiny is * huge + tiny is equal to huge, and whether huge - tiny is
* equal to huge for some floating point number "huge" and "tiny". * equal to huge for some floating point number "huge" and "tiny".
* *
* Special cases: * Special cases:
* sqrt(+-0) = +-0 ... exact * sqrt(+-0) = +-0 ... exact
* sqrt(inf) = inf * sqrt(inf) = inf
@ -1927,7 +1927,7 @@ sim_fpu_sqrt (sim_fpu *f,
b = IMPLICIT_1; b = IMPLICIT_1;
q = 0; q = 0;
s = 0; s = 0;
while (b) while (b)
{ {
unsigned64 t = s + b; unsigned64 t = s + b;

View File

@ -150,7 +150,7 @@ merge_device_file (struct sim_state *sd,
struct hw *current = STATE_HW (sd)->tree; struct hw *current = STATE_HW (sd)->tree;
int line_nr; int line_nr;
char device_path[1000]; char device_path[1000];
/* try opening the file */ /* try opening the file */
description = fopen (file_name, "r"); description = fopen (file_name, "r");
if (description == NULL) if (description == NULL)
@ -158,7 +158,7 @@ merge_device_file (struct sim_state *sd,
perror (file_name); perror (file_name);
return SIM_RC_FAIL; return SIM_RC_FAIL;
} }
line_nr = 0; line_nr = 0;
while (fgets (device_path, sizeof(device_path), description)) while (fgets (device_path, sizeof(device_path), description))
{ {
@ -267,7 +267,7 @@ hw_option_handler (struct sim_state *sd, sim_cpu *cpu, int opt,
sim_hw_print (sd, sim_io_vprintf); sim_hw_print (sd, sim_io_vprintf);
return SIM_RC_OK; return SIM_RC_OK;
} }
case OPTION_HW_FILE: case OPTION_HW_FILE:
{ {
return merge_device_file (sd, arg); return merge_device_file (sd, arg);
@ -333,7 +333,7 @@ sim_hw_uninstall (struct sim_state *sd)
/* CPU: The simulation is running and the current CPU/CIA /* CPU: The simulation is running and the current CPU/CIA
initiates a data transfer. */ initiates a data transfer. */
void void
sim_cpu_hw_io_read_buffer (sim_cpu *cpu, sim_cpu_hw_io_read_buffer (sim_cpu *cpu,
sim_cia cia, sim_cia cia,
struct hw *hw, struct hw *hw,
@ -349,7 +349,7 @@ sim_cpu_hw_io_read_buffer (sim_cpu *cpu,
sim_engine_abort (sd, cpu, cia, "broken CPU read"); sim_engine_abort (sd, cpu, cia, "broken CPU read");
} }
void void
sim_cpu_hw_io_write_buffer (sim_cpu *cpu, sim_cpu_hw_io_write_buffer (sim_cpu *cpu,
sim_cia cia, sim_cia cia,
struct hw *hw, struct hw *hw,
@ -370,7 +370,7 @@ sim_cpu_hw_io_write_buffer (sim_cpu *cpu,
/* SYSTEM: A data transfer is being initiated by the system. */ /* SYSTEM: A data transfer is being initiated by the system. */
unsigned unsigned
sim_hw_io_read_buffer (struct sim_state *sd, sim_hw_io_read_buffer (struct sim_state *sd,
struct hw *hw, struct hw *hw,
void *dest, void *dest,

View File

@ -176,7 +176,7 @@
Since no inlining is defined. All macro's get standard defaults Since no inlining is defined. All macro's get standard defaults
(extern, static, ...). (extern, static, ...).
H_REVEALS_MODULE (alt includes our): H_REVEALS_MODULE (alt includes our):
@ -226,7 +226,7 @@
altprog.c defines ALTPROG_C and then includes sim-inline.c altprog.c defines ALTPROG_C and then includes sim-inline.c
sim-inline.c defines C_INLINE_C and then includes sim-inline.h sim-inline.c defines C_INLINE_C and then includes sim-inline.h
In sim-inline.h the expression `` defined (SIM_INLINE) && ! In sim-inline.h the expression `` defined (SIM_INLINE) && !
defined (OURPROG_C) && REVEAL_MODULE_P (OURPROG_INLINE) '' is defined (OURPROG_C) && REVEAL_MODULE_P (OURPROG_INLINE) '' is
true so it defines *_OURPROG as static and EXTERN_OURPROG_P as true so it defines *_OURPROG as static and EXTERN_OURPROG_P as
@ -246,7 +246,7 @@
ourprog.c defines OURPROG_C and then includes sim-inline.c ourprog.c defines OURPROG_C and then includes sim-inline.c
sim-inline.c defines C_INLINE_C and then includes sim-inline.h sim-inline.c defines C_INLINE_C and then includes sim-inline.h
In sim-inline.h the term `` ! defined (OURPROG_C) '' is FALSE In sim-inline.h the term `` ! defined (OURPROG_C) '' is FALSE
so it defines *_OURPROG as non-static and EXTERN_OURPROG_P as so it defines *_OURPROG as non-static and EXTERN_OURPROG_P as
TRUE. TRUE.

View File

@ -82,13 +82,13 @@ sim_load_file (sd, myname, callback, prog, prog_bfd, verbose_p, lma_p, do_write)
result_bfd = bfd_openr (prog, 0); result_bfd = bfd_openr (prog, 0);
if (result_bfd == NULL) if (result_bfd == NULL)
{ {
eprintf (callback, "%s: can't open \"%s\": %s\n", eprintf (callback, "%s: can't open \"%s\": %s\n",
myname, prog, bfd_errmsg (bfd_get_error ())); myname, prog, bfd_errmsg (bfd_get_error ()));
return NULL; return NULL;
} }
} }
if (!bfd_check_format (result_bfd, bfd_object)) if (!bfd_check_format (result_bfd, bfd_object))
{ {
eprintf (callback, "%s: \"%s\" is not an object file: %s\n", eprintf (callback, "%s: \"%s\" is not an object file: %s\n",
myname, prog, bfd_errmsg (bfd_get_error ())); myname, prog, bfd_errmsg (bfd_get_error ()));
@ -102,9 +102,9 @@ sim_load_file (sd, myname, callback, prog, prog_bfd, verbose_p, lma_p, do_write)
start_time = time (NULL); start_time = time (NULL);
found_loadable_section = 0; found_loadable_section = 0;
for (s = result_bfd->sections; s; s = s->next) for (s = result_bfd->sections; s; s = s->next)
{ {
if (s->flags & SEC_LOAD) if (s->flags & SEC_LOAD)
{ {
bfd_size_type size; bfd_size_type size;

View File

@ -184,7 +184,7 @@ do_memopt_add (SIM_DESC sd,
if (mmap_next_fd >= 0) if (mmap_next_fd >= 0)
{ {
/* Some kernels will SIGBUS the application if mmap'd file /* Some kernels will SIGBUS the application if mmap'd file
is not large enough. */ is not large enough. */
if (s.st_size < bytes) if (s.st_size < bytes)
{ {
sim_io_error (sd, sim_io_error (sd,
@ -199,9 +199,9 @@ do_memopt_add (SIM_DESC sd,
strerror(errno)); strerror(errno));
} }
} }
#endif #endif
/* Need heap allocation? */ /* Need heap allocation? */
if (free_buffer == NULL) if (free_buffer == NULL)
{ {
/* If filling with non-zero value, do not use clearing allocator. */ /* If filling with non-zero value, do not use clearing allocator. */
@ -385,7 +385,7 @@ memory_option_handler (SIM_DESC sd, sim_cpu *cpu, int opt,
parse_addr (arg, &level, &space, &addr); parse_addr (arg, &level, &space, &addr);
return do_memopt_delete (sd, level, space, addr); return do_memopt_delete (sd, level, space, addr);
} }
case OPTION_MEMORY_REGION: case OPTION_MEMORY_REGION:
{ {
char *chp = arg; char *chp = arg;

View File

@ -138,7 +138,7 @@ sim_core_trace_M (sim_cpu *cpu,
} }
#endif #endif
/* TAGS: sim_core_read_aligned_1 sim_core_read_aligned_2 */ /* TAGS: sim_core_read_aligned_1 sim_core_read_aligned_2 */
/* TAGS: sim_core_read_aligned_4 sim_core_read_aligned_8 */ /* TAGS: sim_core_read_aligned_4 sim_core_read_aligned_8 */
/* TAGS: sim_core_read_aligned_16 */ /* TAGS: sim_core_read_aligned_16 */
@ -193,7 +193,7 @@ sim_core_read_aligned_N(sim_cpu *cpu,
return val; return val;
} }
#endif #endif
/* TAGS: sim_core_read_unaligned_1 sim_core_read_unaligned_2 */ /* TAGS: sim_core_read_unaligned_1 sim_core_read_unaligned_2 */
/* TAGS: sim_core_read_unaligned_4 sim_core_read_unaligned_8 */ /* TAGS: sim_core_read_unaligned_4 sim_core_read_unaligned_8 */
/* TAGS: sim_core_read_unaligned_16 */ /* TAGS: sim_core_read_unaligned_16 */

View File

@ -515,7 +515,7 @@ dup_arg_p (const char *arg)
arg_table[hash] = arg; arg_table[hash] = arg;
return 0; return 0;
} }
/* Called by sim_open to parse the arguments. */ /* Called by sim_open to parse the arguments. */
SIM_RC SIM_RC
@ -637,7 +637,7 @@ sim_parse_args (SIM_DESC sd, char **argv)
} }
} }
} }
/* Terminate the short and long option lists. */ /* Terminate the short and long option lists. */
*p = 0; *p = 0;
lp->name = NULL; lp->name = NULL;
@ -734,7 +734,7 @@ print_help (SIM_DESC sd, sim_cpu *cpu, const struct option_list *ol, int is_comm
} }
while (OPTION_VALID_P (o) && o->doc == NULL); while (OPTION_VALID_P (o) && o->doc == NULL);
} }
/* list any long options (aliases) for the current OPT */ /* list any long options (aliases) for the current OPT */
o = opt; o = opt;
do do
@ -921,7 +921,7 @@ sim_args_command (SIM_DESC sd, char *cmd)
/* something to do? */ /* something to do? */
if (cmd == NULL) if (cmd == NULL)
return SIM_RC_OK; /* FIXME - perhaps help would be better */ return SIM_RC_OK; /* FIXME - perhaps help would be better */
if (cmd [0] == '-') if (cmd [0] == '-')
{ {
/* user specified -<opt> ... form? */ /* user specified -<opt> ... form? */
@ -1012,7 +1012,7 @@ sim_args_command (SIM_DESC sd, char *cmd)
freeargv (argv); freeargv (argv);
} }
/* didn't find anything that remotly matched */ /* didn't find anything that remotly matched */
return SIM_RC_FAIL; return SIM_RC_FAIL;
} }

View File

@ -190,7 +190,7 @@ set_profile_option_mask (SIM_DESC sd, const char *name, int mask, const char *ar
} }
} }
} }
} }
return SIM_RC_OK; return SIM_RC_OK;
} }
@ -414,7 +414,7 @@ profile_option_handler (SIM_DESC sd,
{ {
PROFILE_PC_START (CPU_PROFILE_DATA (STATE_CPU (sd, cpu_nr))) = base; PROFILE_PC_START (CPU_PROFILE_DATA (STATE_CPU (sd, cpu_nr))) = base;
PROFILE_PC_END (CPU_PROFILE_DATA (STATE_CPU (sd, cpu_nr))) = bound; PROFILE_PC_END (CPU_PROFILE_DATA (STATE_CPU (sd, cpu_nr))) = bound;
} }
for (cpu_nr = 0; cpu_nr < MAX_NR_PROCESSORS; ++cpu_nr) for (cpu_nr = 0; cpu_nr < MAX_NR_PROCESSORS; ++cpu_nr)
CPU_PROFILE_FLAGS (STATE_CPU (sd, cpu_nr))[PROFILE_PC_IDX] = 1; CPU_PROFILE_FLAGS (STATE_CPU (sd, cpu_nr))[PROFILE_PC_IDX] = 1;
} }
@ -535,7 +535,7 @@ profile_pc_event (SIM_DESC sd,
PROFILE_PC_COUNT (profile) [i] += 1; /* Overflow? */ PROFILE_PC_COUNT (profile) [i] += 1; /* Overflow? */
else else
PROFILE_PC_COUNT (profile) [PROFILE_PC_NR_BUCKETS (profile)] += 1; PROFILE_PC_COUNT (profile) [PROFILE_PC_NR_BUCKETS (profile)] += 1;
PROFILE_PC_EVENT (profile) = PROFILE_PC_EVENT (profile) =
sim_events_schedule (sd, PROFILE_PC_FREQ (profile), profile_pc_event, cpu); sim_events_schedule (sd, PROFILE_PC_FREQ (profile), profile_pc_event, cpu);
} }
@ -698,7 +698,7 @@ profile_print_pc (sim_cpu *cpu, int verbose)
/* FIXME: Is this the best place for this code? */ /* FIXME: Is this the best place for this code? */
{ {
FILE *pf = fopen ("gmon.out", "wb"); FILE *pf = fopen ("gmon.out", "wb");
if (pf == NULL) if (pf == NULL)
sim_io_eprintf (sd, "Failed to open \"gmon.out\" profile file\n"); sim_io_eprintf (sd, "Failed to open \"gmon.out\" profile file\n");
else else

View File

@ -95,7 +95,7 @@ sim_signal_to_host (SIM_DESC sd, SIM_SIGNAL sig)
#endif #endif
} }
enum target_signal enum target_signal
sim_signal_to_target (SIM_DESC sd, SIM_SIGNAL sig) sim_signal_to_target (SIM_DESC sd, SIM_SIGNAL sig)
{ {
switch (sig) switch (sig)

View File

@ -214,7 +214,7 @@ set_trace_option_mask (SIM_DESC sd, const char *name, int mask, const char *arg)
} }
} }
} }
} }
return SIM_RC_OK; return SIM_RC_OK;
} }
@ -605,7 +605,7 @@ print_data (SIM_DESC sd,
abort (); abort ();
} }
} }
static const char * static const char *
trace_idx_to_str (int trace_idx) trace_idx_to_str (int trace_idx)
{ {
@ -1021,7 +1021,7 @@ trace_result_word1 (SIM_DESC sd,
save_data (sd, data, trace_fmt_word, sizeof (unsigned_word), &r0); save_data (sd, data, trace_fmt_word, sizeof (unsigned_word), &r0);
trace_results (sd, cpu, trace_idx, last_input); trace_results (sd, cpu, trace_idx, last_input);
} }
void void
trace_result0 (SIM_DESC sd, trace_result0 (SIM_DESC sd,
@ -1035,7 +1035,7 @@ trace_result0 (SIM_DESC sd,
last_input = TRACE_INPUT_IDX (data); last_input = TRACE_INPUT_IDX (data);
trace_results (sd, cpu, trace_idx, last_input); trace_results (sd, cpu, trace_idx, last_input);
} }
void void
trace_result_word2 (SIM_DESC sd, trace_result_word2 (SIM_DESC sd,
@ -1053,7 +1053,7 @@ trace_result_word2 (SIM_DESC sd,
save_data (sd, data, trace_fmt_word, sizeof (r1), &r1); save_data (sd, data, trace_fmt_word, sizeof (r1), &r1);
trace_results (sd, cpu, trace_idx, last_input); trace_results (sd, cpu, trace_idx, last_input);
} }
void void
trace_result_word4 (SIM_DESC sd, trace_result_word4 (SIM_DESC sd,
@ -1075,7 +1075,7 @@ trace_result_word4 (SIM_DESC sd,
save_data (sd, data, trace_fmt_word, sizeof (r3), &r3); save_data (sd, data, trace_fmt_word, sizeof (r3), &r3);
trace_results (sd, cpu, trace_idx, last_input); trace_results (sd, cpu, trace_idx, last_input);
} }
void void
trace_result_bool1 (SIM_DESC sd, trace_result_bool1 (SIM_DESC sd,
@ -1091,7 +1091,7 @@ trace_result_bool1 (SIM_DESC sd,
save_data (sd, data, trace_fmt_bool, sizeof (r0), &r0); save_data (sd, data, trace_fmt_bool, sizeof (r0), &r0);
trace_results (sd, cpu, trace_idx, last_input); trace_results (sd, cpu, trace_idx, last_input);
} }
void void
trace_result_addr1 (SIM_DESC sd, trace_result_addr1 (SIM_DESC sd,
@ -1107,7 +1107,7 @@ trace_result_addr1 (SIM_DESC sd,
save_data (sd, data, trace_fmt_addr, sizeof (r0), &r0); save_data (sd, data, trace_fmt_addr, sizeof (r0), &r0);
trace_results (sd, cpu, trace_idx, last_input); trace_results (sd, cpu, trace_idx, last_input);
} }
void void
trace_result_fp1 (SIM_DESC sd, trace_result_fp1 (SIM_DESC sd,
@ -1123,7 +1123,7 @@ trace_result_fp1 (SIM_DESC sd,
save_data (sd, data, trace_fmt_fp, sizeof (fp_word), &f0); save_data (sd, data, trace_fmt_fp, sizeof (fp_word), &f0);
trace_results (sd, cpu, trace_idx, last_input); trace_results (sd, cpu, trace_idx, last_input);
} }
void void
trace_result_fp2 (SIM_DESC sd, trace_result_fp2 (SIM_DESC sd,
@ -1141,7 +1141,7 @@ trace_result_fp2 (SIM_DESC sd,
save_data (sd, data, trace_fmt_fp, sizeof (f1), &f1); save_data (sd, data, trace_fmt_fp, sizeof (f1), &f1);
trace_results (sd, cpu, trace_idx, last_input); trace_results (sd, cpu, trace_idx, last_input);
} }
void void
trace_result_fpu1 (SIM_DESC sd, trace_result_fpu1 (SIM_DESC sd,
@ -1159,7 +1159,7 @@ trace_result_fpu1 (SIM_DESC sd,
save_data (sd, data, trace_fmt_fp, sizeof (double), &d); save_data (sd, data, trace_fmt_fp, sizeof (double), &d);
trace_results (sd, cpu, trace_idx, last_input); trace_results (sd, cpu, trace_idx, last_input);
} }
void void
trace_result_string1 (SIM_DESC sd, trace_result_string1 (SIM_DESC sd,
@ -1175,7 +1175,7 @@ trace_result_string1 (SIM_DESC sd,
save_data (sd, data, trace_fmt_string, strlen (s0) + 1, s0); save_data (sd, data, trace_fmt_string, strlen (s0) + 1, s0);
trace_results (sd, cpu, trace_idx, last_input); trace_results (sd, cpu, trace_idx, last_input);
} }
void void
trace_result_word1_string1 (SIM_DESC sd, trace_result_word1_string1 (SIM_DESC sd,
@ -1193,7 +1193,7 @@ trace_result_word1_string1 (SIM_DESC sd,
save_data (sd, data, trace_fmt_string, strlen (s0) + 1, s0); save_data (sd, data, trace_fmt_string, strlen (s0) + 1, s0);
trace_results (sd, cpu, trace_idx, last_input); trace_results (sd, cpu, trace_idx, last_input);
} }
void void
trace_vprintf (SIM_DESC sd, sim_cpu *cpu, const char *fmt, va_list ap) trace_vprintf (SIM_DESC sd, sim_cpu *cpu, const char *fmt, va_list ap)

View File

@ -394,7 +394,7 @@ do { \
if (TRACE_ALU_P (CPU)) \ if (TRACE_ALU_P (CPU)) \
trace_input0 (SD, CPU, TRACE_ALU_IDX); \ trace_input0 (SD, CPU, TRACE_ALU_IDX); \
} while (0) } while (0)
#define TRACE_ALU_INPUT1(V0) \ #define TRACE_ALU_INPUT1(V0) \
do { \ do { \
if (TRACE_ALU_P (CPU)) \ if (TRACE_ALU_P (CPU)) \
@ -466,7 +466,7 @@ do { \
if (TRACE_FPU_P (CPU)) \ if (TRACE_FPU_P (CPU)) \
trace_input0 (SD, CPU, TRACE_FPU_IDX); \ trace_input0 (SD, CPU, TRACE_FPU_IDX); \
} while (0) } while (0)
#define TRACE_FP_INPUT1(V0) \ #define TRACE_FP_INPUT1(V0) \
do { \ do { \
if (TRACE_FPU_P (CPU)) \ if (TRACE_FPU_P (CPU)) \
@ -490,7 +490,7 @@ do { \
if (TRACE_FPU_P (CPU)) \ if (TRACE_FPU_P (CPU)) \
trace_input_word1 (SD, CPU, TRACE_FPU_IDX, (V0)); \ trace_input_word1 (SD, CPU, TRACE_FPU_IDX, (V0)); \
} while (0) } while (0)
#define TRACE_FP_RESULT(R0) \ #define TRACE_FP_RESULT(R0) \
do { \ do { \
if (TRACE_FPU_P (CPU)) \ if (TRACE_FPU_P (CPU)) \

View File

@ -235,13 +235,13 @@ sim_analyze_program (SIM_DESC sd, char *prog_name, bfd *prog_bfd)
prog_bfd = bfd_openr (prog_name, STATE_TARGET (sd)); prog_bfd = bfd_openr (prog_name, STATE_TARGET (sd));
if (prog_bfd == NULL) if (prog_bfd == NULL)
{ {
sim_io_eprintf (sd, "%s: can't open \"%s\": %s\n", sim_io_eprintf (sd, "%s: can't open \"%s\": %s\n",
STATE_MY_NAME (sd), STATE_MY_NAME (sd),
prog_name, prog_name,
bfd_errmsg (bfd_get_error ())); bfd_errmsg (bfd_get_error ()));
return SIM_RC_FAIL; return SIM_RC_FAIL;
} }
if (!bfd_check_format (prog_bfd, bfd_object)) if (!bfd_check_format (prog_bfd, bfd_object))
{ {
sim_io_eprintf (sd, "%s: \"%s\" is not an object file: %s\n", sim_io_eprintf (sd, "%s: \"%s\" is not an object file: %s\n",
STATE_MY_NAME (sd), STATE_MY_NAME (sd),
@ -402,5 +402,3 @@ transfer_to_str (unsigned transfer)
default: return "(error)"; default: return "(error)";
} }
} }

View File

@ -165,7 +165,7 @@ do_watchpoint_info (SIM_DESC sd)
sim_io_printf (sd, "\n"); sim_io_printf (sd, "\n");
} }
} }
static sim_event_handler handle_watchpoint; static sim_event_handler handle_watchpoint;
@ -221,7 +221,7 @@ handle_watchpoint (SIM_DESC sd, void *data)
schedule_watchpoint (sd, point); schedule_watchpoint (sd, point);
else else
do_watchpoint_delete (sd, point->ident, invalid_watchpoint); do_watchpoint_delete (sd, point->ident, invalid_watchpoint);
if (point->interrupt_nr == watch->nr_interrupts) if (point->interrupt_nr == watch->nr_interrupts)
sim_engine_halt (sd, NULL, NULL, NULL_CIA, sim_stopped, SIM_SIGINT); sim_engine_halt (sd, NULL, NULL, NULL_CIA, sim_stopped, SIM_SIGINT);
else else
@ -260,7 +260,7 @@ do_watchpoint_create (SIM_DESC sd,
break; break;
arg++; arg++;
} }
(*point)->arg0 = strtoul (arg, &arg, 0); (*point)->arg0 = strtoul (arg, &arg, 0);
if (arg[0] == ',') if (arg[0] == ',')
(*point)->arg0 = strtoul (arg, NULL, 0); (*point)->arg0 = strtoul (arg, NULL, 0);
@ -283,7 +283,7 @@ watchpoint_option_handler (SIM_DESC sd, sim_cpu *cpu, int opt,
else else
switch (opt) switch (opt)
{ {
case OPTION_WATCH_DELETE: case OPTION_WATCH_DELETE:
if (isdigit ((int) arg[0])) if (isdigit ((int) arg[0]))
{ {
@ -337,19 +337,19 @@ watchpoint_option_handler (SIM_DESC sd, sim_cpu *cpu, int opt,
} }
sim_io_eprintf (sd, "Unknown watchpoint type `%s'\n", arg); sim_io_eprintf (sd, "Unknown watchpoint type `%s'\n", arg);
return SIM_RC_FAIL; return SIM_RC_FAIL;
case OPTION_WATCH_INFO: case OPTION_WATCH_INFO:
{ {
do_watchpoint_info (sd); do_watchpoint_info (sd);
return SIM_RC_OK; return SIM_RC_OK;
} }
default: default:
sim_io_eprintf (sd, "Unknown watch option %d\n", opt); sim_io_eprintf (sd, "Unknown watch option %d\n", opt);
return SIM_RC_FAIL; return SIM_RC_FAIL;
} }
} }

View File

@ -93,7 +93,7 @@ get_string (cb, sc, buf, buflen, addr)
path name along with the syscall request, and cache the file path name along with the syscall request, and cache the file
name somewhere (or otherwise tweak this as desired). */ name somewhere (or otherwise tweak this as desired). */
unsigned int count = (*sc->read_mem) (cb, sc, addr, p, 1); unsigned int count = (*sc->read_mem) (cb, sc, addr, p, 1);
if (count != 1) if (count != 1)
return EINVAL; return EINVAL;
if (*p == 0) if (*p == 0)