diff options
author | Hans-Peter Nilsson <hp@axis.com> | 2005-11-17 16:14:53 +0000 |
---|---|---|
committer | Hans-Peter Nilsson <hp@axis.com> | 2005-11-17 16:14:53 +0000 |
commit | ed1f044ac6423184b2e2b8f805ddc4f76ea1256c (patch) | |
tree | 89918a464f6ebd0e6ca81ec2b38cf9387f053fa5 /sim/cris/sim-main.h | |
parent | 5457266c93b2d713d95a4879446015aac02b270c (diff) | |
download | gdb-ed1f044ac6423184b2e2b8f805ddc4f76ea1256c.zip gdb-ed1f044ac6423184b2e2b8f805ddc4f76ea1256c.tar.gz gdb-ed1f044ac6423184b2e2b8f805ddc4f76ea1256c.tar.bz2 |
* cris/sim-main.h (struct _sim_cpu): New members last_syscall,
last_open_fd, last_open_flags.
* cris/traps.c: Don't include targ-vals.h.
(TARGET_O_ACCMODE): Define.
(cris_break_13_handler): Set new _sim_cpu members.
<case TARGET_SYS_fcntl>: Support special case of F_GETFL.
Rearrange code as switch. Emit "unimplemented" abort for
unimplemented fcntl calls.
Diffstat (limited to 'sim/cris/sim-main.h')
-rw-r--r-- | sim/cris/sim-main.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sim/cris/sim-main.h b/sim/cris/sim-main.h index b671533..b35b927 100644 --- a/sim/cris/sim-main.h +++ b/sim/cris/sim-main.h @@ -166,6 +166,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. */ |