/* Static cycle count for all insns executed so far, including
non-context-specific stall cycles, for example when adding to PC. */
- unsigned64 basic_cycle_count;
+ uint64_t basic_cycle_count;
/* Stall cycles for unaligned access of memory operands. FIXME:
Should or should not include unaligned [PC+] operands? */
- unsigned64 unaligned_mem_dword_count;
+ uint64_t unaligned_mem_dword_count;
/* Context-specific stall cycles. */
- unsigned64 memsrc_stall_count;
- unsigned64 memraw_stall_count;
- unsigned64 movemsrc_stall_count;
- unsigned64 movemaddr_stall_count;
- unsigned64 movemdst_stall_count;
- unsigned64 mulsrc_stall_count;
- unsigned64 jumpsrc_stall_count;
- unsigned64 branch_stall_count;
- unsigned64 jumptarget_stall_count;
+ uint64_t memsrc_stall_count;
+ uint64_t memraw_stall_count;
+ uint64_t movemsrc_stall_count;
+ uint64_t movemaddr_stall_count;
+ uint64_t movemdst_stall_count;
+ uint64_t mulsrc_stall_count;
+ uint64_t jumpsrc_stall_count;
+ uint64_t branch_stall_count;
+ uint64_t jumptarget_stall_count;
/* What kind of target-specific trace to perform. */
int flags;
struct cris_vec_tr
{
- unsigned32 portval, vec;
+ uint32_t portval, vec;
};
enum cris_multiple_ints
struct cris_hw
{
struct hw_event *pending_handler;
- unsigned32 pending_vector;
+ uint32_t pending_vector;
struct cris_vec_tr *int_to_vec;
enum cris_multiple_ints multi_int_action;
- unsigned32 multiple_int_vector;
+ uint32_t multiple_int_vector;
};
/* An event function, calling the actual CPU-model-specific
time we get here, until a new time is seen (supposedly unstuck
re-delivery). (Fixing in SIM/GDB source will hopefully then
also be easier, having a tangible test-case.) */
- static signed64 last_events_time = 0;
- static signed64 delta = 1;
- signed64 this_events_time = hw_event_queue_time (me);
+ static int64_t last_events_time = 0;
+ static int64_t delta = 1;
+ int64_t this_events_time = hw_event_queue_time (me);
if (this_events_time == last_events_time)
delta++;
int intparam)
{
struct cris_hw *crishw = hw_data (me);
- unsigned32 vec;
+ uint32_t vec;
/* A few placeholders; only the INT port is implemented. */
switch (my_port)
vec = crishw->int_to_vec[i].vec;
}
else
- vec = (unsigned32) intparam;
+ vec = (uint32_t) intparam;
if (crishw->pending_vector != 0)
{
vec_for_int = hw_find_property (me, "vec-for-int");
if (vec_for_int != NULL)
{
- unsigned32 vecsize;
- unsigned32 i;
+ uint32_t vecsize;
+ uint32_t i;
if (hw_property_type (vec_for_int) != array_property)
hw_abort (me, "property \"vec-for-int\" has the wrong type");
|| vec_sc < 0)
hw_abort (me, "no valid vector translation pair %u", i);
- crishw->int_to_vec[i].portval = (unsigned32) portval_sc;
- crishw->int_to_vec[i].vec = (unsigned32) vec_sc;
+ crishw->int_to_vec[i].portval = (uint32_t) portval_sc;
+ crishw->int_to_vec[i].vec = (uint32_t) vec_sc;
}
crishw->int_to_vec[i].portval = 0;
typedef struct _hw_rv_device
{
/* Mapping of remote interrupt bit-numbers to local ones. */
- unsigned32 remote_to_local_int[32];
+ uint32_t remote_to_local_int[32];
/* When multiple bits are set, a non-zero value here indicates that
this value should be used instead. */
- unsigned32 intmultiple;
+ uint32_t intmultiple;
/* Local address of registers. */
- unsigned32 reg_address;
+ uint32_t reg_address;
/* Size of register bank in bytes. */
- unsigned32 reg_size;
+ uint32_t reg_size;
/* Remote address of registers. */
- unsigned32 remote_reg_address;
+ uint32_t remote_reg_address;
/* Local address of DMA:able memory. */
- unsigned32 mem_address;
+ uint32_t mem_address;
/* Size of DMA:able memory in bytes. */
- unsigned32 mem_size;
+ uint32_t mem_size;
/* Bitmask for valid DMA request size. */
- unsigned32 mem_burst_mask;
+ uint32_t mem_burst_mask;
/* Remote address of DMA:able memory. */
- unsigned32 remote_mem_address;
+ uint32_t remote_mem_address;
/* (Local) address of mbox; where to put a pointer to the mbox to be
sent. */
- unsigned32 mbox_address;
+ uint32_t mbox_address;
/* Probably not 127.0.0.1:10000. */
const char *host;
int port;
/* If non-NULL, points to memory to use instead of connection. */
- unsigned8 *dummy;
+ uint8_t *dummy;
/* File descriptor for the socket. Set to -1 when error. Only one
of dummy and this is active. */
/* This, plus latency because the CPU might not be checking until a
CTI insn (usually a branch or a jump) is the interval in cycles
between the rv is polled for e.g. DMA requests. */
- unsigned32 max_tick_poll_interval;
+ uint32_t max_tick_poll_interval;
/* Running counter for exponential backoff up to
max_tick_poll_interval to avoid polling the connection
unnecessarily often. Set to 1 when rv activity (read/write
register, DMA request) is detected. */
- unsigned32 next_period;
+ uint32_t next_period;
/* This is the interval in wall-clock seconds between watchdog
packets are sent to the remote side. Zero means no watchdog
packets. */
- unsigned32 watchdog_interval;
+ uint32_t watchdog_interval;
/* Last time we sent a watchdog packet. */
struct timeval last_wdog_time;
unsigned int len)
{
hw_rv_device *rv = (hw_rv_device *) hw_data (me);
- unsigned8 *bufp = buf;
+ uint8_t *bufp = buf;
/* If we don't have a valid fd here, it's because we got an error
initially, and we suppressed that error. */
unsigned int len)
{
hw_rv_device *rv = (hw_rv_device *) hw_data (me);
- unsigned8 *bufp = buf;
+ uint8_t *bufp = buf;
while (len > 0)
{
unsigned int len_noheader)
{
hw_rv_device *rv = (hw_rv_device *) hw_data (me);
- unsigned8 buf[32+3];
- unsigned8 *bufp;
+ uint8_t buf[32+3];
+ uint8_t *bufp;
unsigned int len = len_noheader + 3;
int ret;
{
hw_rv_device *rv = (hw_rv_device *) hw_data (me);
/* If you change this size, please adjust the mem2 testcase. */
- unsigned8 buf[32+8];
- unsigned8 *bufp = buf;
- unsigned32 leaddr;
- unsigned32 addr;
- unsigned32 lelen;
- unsigned32 i;
+ uint8_t buf[32+8];
+ uint8_t *bufp = buf;
+ uint32_t leaddr;
+ uint32_t addr;
+ uint32_t lelen;
+ uint32_t i;
if (len != 8)
hw_abort (me, "expected DMA read request len 8+3, got %d+3", len);
{
hw_rv_device *rv = (hw_rv_device *) hw_data (me);
/* If you change this size, please adjust the mem2 testcase. */
- unsigned8 buf[32+8];
- unsigned8 *bufp = buf;
- unsigned32 leaddr;
- unsigned32 addr;
- unsigned32 lelen;
- unsigned32 len;
- unsigned32 i;
+ uint8_t buf[32+8];
+ uint8_t *bufp = buf;
+ uint32_t leaddr;
+ uint32_t addr;
+ uint32_t lelen;
+ uint32_t len;
+ uint32_t i;
hw_rv_read (me, &leaddr, 4);
hw_rv_read (me, &lelen, 4);
hw_rv_irq (struct hw *me, unsigned int len)
{
hw_rv_device *rv = (hw_rv_device *) hw_data (me);
- unsigned32 intbitsle;
- unsigned32 intbits_ext;
- unsigned32 intval = 0;
+ uint32_t intbitsle;
+ uint32_t intbits_ext;
+ uint32_t intval = 0;
int i;
if (len != 4)
static void
hw_rv_handle_incoming (struct hw *me,
int expected_type,
- unsigned8 *buf,
+ uint8_t *buf,
unsigned int *return_len)
{
hw_rv_device *rv = (hw_rv_device *) hw_data (me);
- unsigned8 cbuf[32];
+ uint8_t cbuf[32];
unsigned int len;
unsigned int cmd;
do_poll_event (struct hw *me, void *data)
{
hw_rv_device *rv = (hw_rv_device *) hw_data (me);
- unsigned32 new_period;
+ uint32_t new_period;
if (rv->dummy != NULL)
return;
unsigned int nr_bytes)
{
hw_rv_device *rv = (hw_rv_device *) hw_data (me);
- unsigned8 addr_data[8] = "";
- unsigned32 a_l = H2LE_4 (addr - rv->reg_address + rv->remote_reg_address);
+ uint8_t addr_data[8] = "";
+ uint32_t a_l = H2LE_4 (addr - rv->reg_address + rv->remote_reg_address);
unsigned int len = 8;
if (nr_bytes != 4)
static void
hw_rv_mbox (struct hw *me, unsigned_word address)
{
- unsigned8 buf[256+3];
+ uint8_t buf[256+3];
unsigned int cmd;
unsigned int rlen;
- unsigned32 i;
+ uint32_t i;
unsigned int len
= hw_dma_read_buffer (me, buf, 0, address, 3);
{
hw_rv_device *rv = (hw_rv_device *) hw_data (me);
- unsigned8 addr_data[8] = "";
- unsigned32 a_l = H2LE_4 (addr - rv->reg_address + rv->remote_reg_address);
+ uint8_t addr_data[8] = "";
+ uint32_t a_l = H2LE_4 (addr - rv->reg_address + rv->remote_reg_address);
unsigned int len = 8;
if (nr_bytes != 4)
if (addr == rv->mbox_address)
{
- unsigned32 mbox_addr_le;
+ uint32_t mbox_addr_le;
if (rv->dummy != NULL)
hw_abort (me, "mbox not supported for a dummy instance");
memcpy (&mbox_addr_le, source, 4);
if (hw_property_type (dummy_prop) == integer_property)
{
- unsigned32 dummyfill = hw_find_integer_property (me, "dummy");
- unsigned8 *dummymem = hw_malloc (me, rv->reg_size);
+ uint32_t dummyfill = hw_find_integer_property (me, "dummy");
+ uint8_t *dummymem = hw_malloc (me, rv->reg_size);
memset (dummymem, dummyfill, rv->reg_size);
rv->dummy = dummymem;
}
else
{
const char *dummyarg = hw_find_string_property (me, "dummy");
- unsigned8 *dummymem = hw_malloc (me, rv->reg_size);
+ uint8_t *dummymem = hw_malloc (me, rv->reg_size);
FILE *f = fopen (dummyarg, "rb");
if (f == NULL)
signed_cell attach_address_sc
= hw_find_integer_property (me, "mbox");
- rv->mbox_address = (unsigned32) attach_address_sc;
+ rv->mbox_address = (uint32_t) attach_address_sc;
hw_attach_address (hw_parent (me),
0,
- 0, (unsigned32) attach_address_sc, 4, me);
+ 0, (uint32_t) attach_address_sc, 4, me);
}
else
hw_abort (me, "property \"mbox\" has the wrong type");
&& hw_find_integer_array_property (me, "mem", 1, &attach_size_sc))
{
/* Unfortunate choice of types forces us to dance around a bit. */
- rv->mem_address = (unsigned32) attach_address_sc;
- rv->mem_size = (unsigned32) attach_size_sc;
+ rv->mem_address = (uint32_t) attach_address_sc;
+ rv->mem_size = (uint32_t) attach_size_sc;
if ((attach_address_sc & 3) != 0)
hw_abort (me, "memory block must be 4 byte aligned");
}