diff options
author | Doug Evans <dje@google.com> | 1997-11-26 19:52:34 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 1997-11-26 19:52:34 +0000 |
commit | 4123aca8104bc6442c977cca937aef83ad0a959b (patch) | |
tree | c7a7e5577ec6d90f23c59f3f0ebfc03746cd387d /sim/common/syscall.c | |
parent | 881a60116f6ee0886327e818024bb0d9b29ed31a (diff) | |
download | gdb-4123aca8104bc6442c977cca937aef83ad0a959b.zip gdb-4123aca8104bc6442c977cca937aef83ad0a959b.tar.gz gdb-4123aca8104bc6442c977cca937aef83ad0a959b.tar.bz2 |
Undo last change. callback.h changed instead.
Plus:
* syscall.c (cb_syscall): Test CB_SYSCALL struct magic number.
Diffstat (limited to 'sim/common/syscall.c')
-rw-r--r-- | sim/common/syscall.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/sim/common/syscall.c b/sim/common/syscall.c index fbeb24c..1556ece 100644 --- a/sim/common/syscall.c +++ b/sim/common/syscall.c @@ -64,8 +64,8 @@ /* When doing file read/writes, do this many bytes at a time. */ #define FILE_XFR_SIZE 4096 -/* FIXME: for now */ -#define TWORD unsigned long +/* FIXME: for now, need to consider target word size. */ +#define TWORD long #define TADDR unsigned long /* Utility of cb_syscall to fetch a path name or other string from the target. @@ -131,8 +131,10 @@ cb_syscall (cb, sc) host_callback *cb; CB_SYSCALL *sc; { - /* ??? Need to consider target word size. */ - long result = 0, errcode = 0; + TWORD result = 0, errcode = 0; + + if (sc->magic != CB_SYSCALL_MAGIC) + abort (); switch (cb_target_to_host_syscall (cb, sc->func)) { @@ -390,10 +392,7 @@ cb_syscall (cb, sc) result = -1; goto FinishSyscall; } - /* ??? Coercion to unsigned avoids -Wall -Werror failure. - Ya, cb_host_to_target_stat could return an unsigned int, - but that seems worse. */ - if ((*sc->write_mem) (cb, sc, addr, buf, buflen) != (unsigned) buflen) + if ((*sc->write_mem) (cb, sc, addr, buf, buflen) != buflen) { free (buf); errcode = EINVAL; @@ -425,10 +424,7 @@ cb_syscall (cb, sc) result = -1; goto FinishSyscall; } - /* ??? Coercion to unsigned avoids -Wall -Werror failure. - Ya, cb_host_to_target_stat could return an unsigned int, - but that seems worse. */ - if ((*sc->write_mem) (cb, sc, addr, buf, buflen) != (unsigned) buflen) + if ((*sc->write_mem) (cb, sc, addr, buf, buflen) != buflen) { free (buf); errcode = EINVAL; |