[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/5] m68k: implement server and client side
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 2/5] m68k: implement server and client side |
Date: |
Sat, 18 Feb 2017 22:37:49 +0000 |
On 7 February 2017 at 18:33, Laurent Vivier <address@hidden> wrote:
> This also adds the basic test file and the configuration update.
>
> This implementation can only test instructions with values in register and
> no memory access.
>
> Signed-off-by: Laurent Vivier <address@hidden>
Hi; I got round to setting up my machine with an m68k cross
compiler so I can at least compile-test the other target
architectures, and I noticed this code generates compiler
warnings:
> +/* reginfo_dump: print state to a stream, returns nonzero on success */
> +void reginfo_dump(struct reginfo *ri, int is_master)
> +{
> + int i;
> + if (is_master) {
> + fprintf(stderr, " pc \e[1;101;37m0x%08x\e[0m\n",
> + ri->pc);
> + }
> + fprintf(stderr, "\tPC: %08x\n", ri->gregs[R_PC]);
> + fprintf(stderr, "\tPS: %04x\n", ri->gregs[R_PS]);
> +
> + for (i = 0; i < 8; i++) {
> + fprintf(stderr, "\tD%d: %8x\tA%d: %8x\n", i, ri->gregs[i],
> + i, ri->gregs[i + 8]);
> + }
> +
> +
> + for (i = 0; i < 8; i++) {
> + fprintf(stderr, "\tFP%d: %08x %08x %08x\n", i,
> + ri->fpregs.f_fpregs[i * 3], ri->fpregs.f_fpregs[i * 3 + 1],
> + ri->fpregs.f_fpregs[i * 3 + 2]);
/home/pm215/risu/risu_reginfo_m68k.c:95:37: warning: format ‘%x’
expects argument of type ‘unsigned int’, but argument 4 has type ‘int
*’ [-Wformat=]
fprintf(stderr, "\tFP%d: %08x %08x %08x\n", i,
^
and similarly for the other 3 f_fpregs[] arguments here
and in the fprintf calls in reginfo_dump_mismatch().
Looking at the m68k sys/ucontext.h its definition of
struct fpregset is
#ifdef __mcoldfire__
int f_fpregs[8][2];
#else
int f_fpregs[8][3];
#endif
so it's a 2d array, not a 1d array.
Any suggestions for how to fix the code? The whole file
seems to treat f_fpregs as a 1d array...
thanks
-- PMM
- [Qemu-devel] [PATCH 0/5] risu: add m68k target support, Laurent Vivier, 2017/02/07
- [Qemu-devel] [PATCH 3/5] m68k: add risufile with m68k instructions., Laurent Vivier, 2017/02/07
- [Qemu-devel] [PATCH 4/5] m68k: add instruction needing an extended word, Laurent Vivier, 2017/02/07
- [Qemu-devel] [PATCH 1/5] m68k: implement risugen module, Laurent Vivier, 2017/02/07
- [Qemu-devel] [PATCH 2/5] m68k: implement server and client side, Laurent Vivier, 2017/02/07
- Re: [Qemu-devel] [PATCH 2/5] m68k: implement server and client side,
Peter Maydell <=
- [Qemu-devel] [PATCH 5/5] m68k: manage memory block, Laurent Vivier, 2017/02/07
- Re: [Qemu-devel] [PATCH 0/5] risu: add m68k target support, Peter Maydell, 2017/02/10