mbox series

[RFC,0/2] Make the core disassembler functions target-independent

Message ID 20230508133745.109463-1-thuth@redhat.com (mailing list archive)
Headers show
Series Make the core disassembler functions target-independent | expand

Message

Thomas Huth May 8, 2023, 1:37 p.m. UTC
Move disas.c into the target-independent source set, so that we
only have to compile this code once instead multiple times (one
time for each target).

Marked as RFC since we have to replace the target_ulongs here
with hwaddr, and the TARGET_FMT_lx with HWADDR_FMT_plx, which is
a little bit ugly ... what's your opinion?

Thomas Huth (2):
  disas: Move softmmu specific code to separate file
  disas: Move disas.c into the target-independent source set

 meson.build            |  4 +-
 disas/disas-internal.h | 20 +++++++++
 include/disas/disas.h  | 21 +++------
 include/hw/elf_ops.h   |  2 +-
 bsd-user/elfload.c     |  2 +-
 disas.c                | 98 ++++++++----------------------------------
 disas/disas-mon.c      | 65 ++++++++++++++++++++++++++++
 linux-user/elfload.c   |  2 +-
 disas/meson.build      |  2 +
 9 files changed, 116 insertions(+), 100 deletions(-)
 create mode 100644 disas/disas-internal.h
 create mode 100644 disas/disas-mon.c

Comments

Richard Henderson May 8, 2023, 2:04 p.m. UTC | #1
On 5/8/23 14:37, Thomas Huth wrote:
> Move disas.c into the target-independent source set, so that we
> only have to compile this code once instead multiple times (one
> time for each target).
> 
> Marked as RFC since we have to replace the target_ulongs here
> with hwaddr, and the TARGET_FMT_lx with HWADDR_FMT_plx, which is
> a little bit ugly ... what's your opinion?
> 
> Thomas Huth (2):
>    disas: Move softmmu specific code to separate file
>    disas: Move disas.c into the target-independent source set

Patches 79-83 from

https://patchew.org/QEMU/20230503072331.1747057-1-richard.henderson@linaro.org/

do the same thing, using uint64_t instead of hwaddr (it's not).


r~
Thomas Huth May 8, 2023, 2:28 p.m. UTC | #2
On 08/05/2023 16.04, Richard Henderson wrote:
> On 5/8/23 14:37, Thomas Huth wrote:
>> Move disas.c into the target-independent source set, so that we
>> only have to compile this code once instead multiple times (one
>> time for each target).
>>
>> Marked as RFC since we have to replace the target_ulongs here
>> with hwaddr, and the TARGET_FMT_lx with HWADDR_FMT_plx, which is
>> a little bit ugly ... what's your opinion?
>>
>> Thomas Huth (2):
>>    disas: Move softmmu specific code to separate file
>>    disas: Move disas.c into the target-independent source set
> 
> Patches 79-83 from
> 
> https://patchew.org/QEMU/20230503072331.1747057-1-richard.henderson@linaro.org/
> 
> do the same thing, using uint64_t instead of hwaddr (it's not).

Ah, great, so I can scratch this from my list :-)

But FYI, you missed to update bsd-user/elfload.c in the patch that updates 
linux-user/elfload.c.

  Thomas
Richard Henderson May 9, 2023, 3:54 p.m. UTC | #3
On 5/8/23 15:04, Richard Henderson wrote:
> On 5/8/23 14:37, Thomas Huth wrote:
>> Move disas.c into the target-independent source set, so that we
>> only have to compile this code once instead multiple times (one
>> time for each target).
>>
>> Marked as RFC since we have to replace the target_ulongs here
>> with hwaddr, and the TARGET_FMT_lx with HWADDR_FMT_plx, which is
>> a little bit ugly ... what's your opinion?
>>
>> Thomas Huth (2):
>>    disas: Move softmmu specific code to separate file
>>    disas: Move disas.c into the target-independent source set
> 
> Patches 79-83 from
> 
> https://patchew.org/QEMU/20230503072331.1747057-1-richard.henderson@linaro.org/
> 
> do the same thing, using uint64_t instead of hwaddr (it's not).

I've just realized that only the choice of hwaddr/uint64_t overlap; I failed to take this 
all of the way to building disas once.

I will integrate our two sets.


r~