X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=sim%2Fcris%2Fsim-main.h;h=483046d90ee18749b1bd7d9ba8734785b3525d23;hb=aad3b3cbc1391fb0091d03b252bd53fbd1d2dd84;hp=b67153300651a41bf789def7ec041e0720d564b8;hpb=cce0efb55e75ff1caac4f6037744ccd0c9c8cdde;p=deliverable%2Fbinutils-gdb.git diff --git a/sim/cris/sim-main.h b/sim/cris/sim-main.h index b671533006..483046d90e 100644 --- a/sim/cris/sim-main.h +++ b/sim/cris/sim-main.h @@ -1,5 +1,5 @@ /* 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. @@ -117,6 +117,10 @@ struct cris_thread_info { 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; @@ -132,6 +136,11 @@ struct _sim_cpu { 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; @@ -166,6 +175,17 @@ struct _sim_cpu { 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. */