diff options
author | Claudio Fontana <claudio.fontana@huawei.com> | 2013-09-19 14:51:05 +0200 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2014-04-25 13:07:15 +0100 |
commit | 3af90c91d9b8762071e3cc7ff518cb9c6527940e (patch) | |
tree | d0a433caf67ef16e4dc6357a33e919c1d7489429 /risu_reginfo_arm.h | |
parent | dc7abf3adb24c52a59b4ef7b40c58ffb4f45ff93 (diff) |
risu_reginfo_arm: new module for the reginfo struct
put the struct reginfo and its methods in a separate module.
This also addresses the problem with the memcmp
being used directly on the struct without the memset 0.
Signed-off-by: Claudio Fontana <claudio.fontana@linaro.org>
Diffstat (limited to 'risu_reginfo_arm.h')
-rw-r--r-- | risu_reginfo_arm.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/risu_reginfo_arm.h b/risu_reginfo_arm.h new file mode 100644 index 0000000..80c28c6 --- /dev/null +++ b/risu_reginfo_arm.h @@ -0,0 +1,38 @@ +/***************************************************************************** + * Copyright (c) 2013 Linaro Limited + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Peter Maydell (Linaro) - initial implementation + * Claudio Fontana (Linaro) - minor refactoring + *****************************************************************************/ + +#ifndef RISU_REGINFO_ARM_H +#define RISU_REGINFO_ARM_H + +struct reginfo +{ + uint64_t fpregs[32]; + uint32_t faulting_insn; + uint32_t faulting_insn_size; + uint32_t gpreg[16]; + uint32_t cpsr; + uint32_t fpscr; +}; + +/* initialize a reginfo structure with data from uc */ +void reginfo_init(struct reginfo *ri, ucontext_t *uc); + +/* returns 1 if structs are equal, zero otherwise */ +int reginfo_is_eq(struct reginfo *r1, struct reginfo *r2); + +/* print struct values to a stream, return 0 on stream err, 1 on success */ +int reginfo_dump(struct reginfo *ri, FILE *f); + +/* print a detailed mismatch report, return 0 on stream err, 1 on success */ +int reginfo_dump_mismatch(struct reginfo *m, struct reginfo *a, FILE *f); + +#endif /* RISU_REGINFO_ARM_H */ |