Line 40... |
Line 40... |
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
#include <fcntl.h>
|
#include <fcntl.h>
|
|
|
/* JTAG or1k target ops. */
|
/* JTAG or1k target ops. */
|
extern void jtag_init PARAMS ((char * args));
|
extern void jtag_init PARAMS ((char * args));
|
extern unsigned long long int jtag_read_reg PARAMS ((unsigned int regno));
|
extern ULONGEST jtag_read_reg PARAMS ((unsigned int regno));
|
extern void jtag_write_reg PARAMS ((unsigned int regno, unsigned long long int data));
|
extern void jtag_write_reg PARAMS ((unsigned int regno, ULONGEST data));
|
extern void jtag_done PARAMS ((void));
|
extern void jtag_done PARAMS ((void));
|
extern void jtag_set_chain PARAMS ((int chain));
|
extern void jtag_set_chain PARAMS ((int chain));
|
struct target_ops or1k_jtag_ops;
|
struct target_ops or1k_jtag_ops;
|
static struct or1k_target_ops or1k_target_jtag =
|
static struct or1k_target_ops or1k_target_jtag =
|
{
|
{
|
Line 246... |
Line 246... |
/* Sets register/memory regno to data. */
|
/* Sets register/memory regno to data. */
|
|
|
static void
|
static void
|
or1k_write_reg (regno, data)
|
or1k_write_reg (regno, data)
|
unsigned int regno;
|
unsigned int regno;
|
unsigned long long int data;
|
ULONGEST data;
|
{
|
{
|
if (current_or1k_target != NULL && current_or1k_target->to_write_reg != NULL)
|
if (current_or1k_target != NULL && current_or1k_target->to_write_reg != NULL)
|
current_or1k_target->to_write_reg (regno, data);
|
current_or1k_target->to_write_reg (regno, data);
|
}
|
}
|
|
|
/* Reads register/memory from regno. */
|
/* Reads register/memory from regno. */
|
|
|
static unsigned long long int
|
static ULONGEST
|
or1k_read_reg (regno)
|
or1k_read_reg (regno)
|
unsigned int regno;
|
unsigned int regno;
|
{
|
{
|
if (current_or1k_target != NULL && current_or1k_target->to_read_reg != NULL)
|
if (current_or1k_target != NULL && current_or1k_target->to_read_reg != NULL)
|
return current_or1k_target->to_read_reg (regno);
|
return current_or1k_target->to_read_reg (regno);
|
Line 409... |
Line 409... |
warning ("internal error: or1k_initialize called twice");
|
warning ("internal error: or1k_initialize called twice");
|
return;
|
return;
|
}
|
}
|
|
|
or1k_status = TARGET_CONNECTING;
|
or1k_status = TARGET_CONNECTING;
|
or1k_reset ();
|
|
if (current_or1k_target != NULL && current_or1k_target->to_init != NULL)
|
if (current_or1k_target != NULL && current_or1k_target->to_init != NULL)
|
current_or1k_target->to_init (args);
|
current_or1k_target->to_init (args);
|
|
|
|
or1k_reset ();
|
|
|
/* Determine implementation configuration. */
|
/* Determine implementation configuration. */
|
or1k_implementation.VR = or1k_read_spr_reg (VR_SPRNUM);
|
or1k_implementation.VR = or1k_read_spr_reg (VR_SPRNUM);
|
or1k_implementation.UPR = or1k_read_spr_reg (UPR_SPRNUM);
|
or1k_implementation.UPR = or1k_read_spr_reg (UPR_SPRNUM);
|
|
|
/* Determine number of gpr_regs. */
|
/* Determine number of gpr_regs. */
|
Line 562... |
Line 563... |
|
|
static void
|
static void
|
or1k_read_trace ()
|
or1k_read_trace ()
|
{
|
{
|
struct htrace_data_struct data;
|
struct htrace_data_struct data;
|
long long int tmp;
|
ULONGEST tmp;
|
int first = 1;
|
int first = 1;
|
FILE *fd;
|
FILE *fd;
|
if ((fd = fopen (TRACE_FILENAME, "ab")) == NULL)
|
if ((fd = fopen (TRACE_FILENAME, "ab")) == NULL)
|
{
|
{
|
warning ("Cannot append to trace file.");
|
warning ("Cannot append to trace file.");
|