Browse Source
Have target_name() be a target-agnostic method, dispatching to a per-target TargetInfo singleton structure. By default a stub singleton is used. No logical change expected. Inspired-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20250424222112.36194-3-philmd@linaro.org>pull/291/head
11 changed files with 70 additions and 11 deletions
@ -0,0 +1,26 @@ |
|||
/*
|
|||
* QEMU TargetInfo structure definition |
|||
* |
|||
* Copyright (c) Linaro |
|||
* |
|||
* SPDX-License-Identifier: GPL-2.0-or-later |
|||
*/ |
|||
|
|||
#ifndef QEMU_TARGET_INFO_IMPL_H |
|||
#define QEMU_TARGET_INFO_IMPL_H |
|||
|
|||
#include "qemu/target-info.h" |
|||
|
|||
typedef struct TargetInfo { |
|||
/* runtime equivalent of TARGET_NAME definition */ |
|||
const char *target_name; |
|||
} TargetInfo; |
|||
|
|||
/**
|
|||
* target_info: |
|||
* |
|||
* Returns: The TargetInfo structure definition for this target binary. |
|||
*/ |
|||
const TargetInfo *target_info(void); |
|||
|
|||
#endif |
|||
@ -0,0 +1,16 @@ |
|||
/*
|
|||
* QEMU target info helpers |
|||
* |
|||
* Copyright (c) Linaro |
|||
* |
|||
* SPDX-License-Identifier: GPL-2.0-or-later |
|||
*/ |
|||
|
|||
#include "qemu/osdep.h" |
|||
#include "qemu/target-info.h" |
|||
#include "qemu/target-info-impl.h" |
|||
|
|||
const char *target_name(void) |
|||
{ |
|||
return target_info()->target_name; |
|||
} |
|||
Loading…
Reference in new issue