OSDN Git Service

Hexagon: list available CPUs with `-cpu help`
authorMatheus Tavares Bernardino <quic_mathbern@quicinc.com>
Thu, 4 May 2023 18:53:11 +0000 (15:53 -0300)
committerTaylor Simpson <tsimpson@quicinc.com>
Thu, 18 May 2023 19:40:52 +0000 (12:40 -0700)
commitf0e0c9844326d47694299e1d9ce3c0bcc1b3a457
tree545aaa892b44357c1b76d11aeb998fcca9b65c37
parentc3199390c2357f5bf695fa0cbf2b1cfd48ebc5fc
Hexagon: list available CPUs with `-cpu help`

Currently, qemu-hexagon only models the v67 cpu. Nonetheless if we try
to get this information with `-cpu help`, qemu just exists with an error
code and no output. Let's correct that.

The code is basically a copy from target/alpha/cpu.h, but we strip the
"-hexagon-cpu" suffix before printing. This is to avoid confusing
situations like the following:

    $ qemu-hexagon -cpu help

    Available CPUs:
      v67-hexagon-cpu

    $ qemu-hexagon -cpu v67-hexagon-cpu ./prog

    qemu-hexagon: unable to find CPU model 'v67-hexagon-cpu'

Signed-off-by: Matheus Tavares Bernardino <quic_mathbern@quicinc.com>
Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
Tested-by: Taylor Simpson <tsimpson@quicinc.com>
Reviewed-by: Taylor Simpson <tsimpson@quicinc.com>
Message-Id: <b946e17c7e17eed9095700b54c5ead36e5d55dfa.1683225804.git.quic_mathbern@quicinc.com>
target/hexagon/cpu.c
target/hexagon/cpu.h