]> Git Repo - qemu.git/commit
target/arm: Use uint64_t for midr field in CPU state struct
authorPhilippe Mathieu-Daudé <[email protected]>
Tue, 28 Apr 2020 17:26:34 +0000 (19:26 +0200)
committerPeter Maydell <[email protected]>
Mon, 4 May 2020 09:32:46 +0000 (10:32 +0100)
commite544f80030121040c8932ff1bd4006f390266c0f
treefc49c1dbf17f6b1937c3828f0f73bdb0690fb723
parent5a89dd2385a193aa954a7c9bf4e381f2ba6ae359
target/arm: Use uint64_t for midr field in CPU state struct

MIDR_EL1 is a 64-bit system register with the top 32-bit being RES0.
Represent it in QEMU's ARMCPU struct with a uint64_t, not a
uint32_t.

This fixes an error when compiling with -Werror=conversion
because we were manipulating the register value using a
local uint64_t variable:

  target/arm/cpu64.c: In function ‘aarch64_max_initfn’:
  target/arm/cpu64.c:628:21: error: conversion from ‘uint64_t’ {aka ‘long unsigned int’} to ‘uint32_t’ {aka ‘unsigned int’} may change value [-Werror=conversion]
    628 |         cpu->midr = t;
        |                     ^

and future-proofs us against a possible future architecture
change using some of the top 32 bits.

Suggested-by: Laurent Desnogues <[email protected]>
Suggested-by: Peter Maydell <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Laurent Desnogues <[email protected]>
Message-id: 20200428172634[email protected]
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
target/arm/cpu.c
target/arm/cpu.h
This page took 0.025672 seconds and 4 git commands to generate.