Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
cpu: Introduce a wrapper for being able to use TARGET_NAME in common …
…code

In some spots, it would be helpful to be able to use TARGET_NAME
in common (target independent) code, too. Thus introduce a wrapper
that can be called from common code, too, just like we already
have one for target_words_bigendian().

Message-Id: <20230424160434.331175-3-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
  • Loading branch information
huth committed May 16, 2023
1 parent 5503da4 commit 1077f50
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cpu.c
Expand Up @@ -427,6 +427,11 @@ bool target_words_bigendian(void)
#endif
}

const char *target_name(void)
{
return TARGET_NAME;
}

void page_size_init(void)
{
/* NOTE: we can always suppose that qemu_host_page_size >=
Expand Down
2 changes: 2 additions & 0 deletions include/hw/core/cpu.h
Expand Up @@ -1013,6 +1013,8 @@ void cpu_exec_unrealizefn(CPUState *cpu);
*/
bool target_words_bigendian(void);

const char *target_name(void);

void page_size_init(void);

#ifdef NEED_CPU_H
Expand Down

0 comments on commit 1077f50

Please sign in to comment.