/* Main header for the CRIS simulator, based on the m32r header.
- Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
Contributed by Axis Communications.
This file is part of the GNU simulators.
char sigsuspended;
};
+typedef int (*cris_interrupt_delivery_fn) (SIM_CPU *,
+ enum cris_interrupt_type,
+ unsigned int);
+
struct _sim_cpu {
/* sim/common cpu base. */
sim_cpu_base base;
CRIS_MISC_PROFILE cris_prev_misc_profile;
#define CPU_CRIS_PREV_MISC_PROFILE(cpu) (& (cpu)->cris_prev_misc_profile)
+#if WITH_HW
+ cris_interrupt_delivery_fn deliver_interrupt;
+#define CPU_CRIS_DELIVER_INTERRUPT(cpu) (cpu->deliver_interrupt)
+#endif
+
/* Simulator environment data. */
USI endmem;
USI endbrk;
for sigmasks and sigpendings. */
USI sighandler[64];
+ /* This is a hack to implement just the parts of fcntl F_GETFL that
+ are used in open+fdopen calls for the standard scenario: for such
+ a call we check that the last syscall was open, we check that the
+ passed fd is the same returned then, and so we return the same
+ flags passed to open. This way, we avoid complicating the
+ generic sim callback machinery by introducing fcntl
+ mechanisms. */
+ USI last_syscall;
+ USI last_open_fd;
+ USI last_open_flags;
+
/* Function for initializing CPU thread context, which varies in size
with each CPU model. They should be in some constant parts or
initialized in *_init_cpu, but we can't modify that for now. */