mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
semihosting: Cleanup chardev init
Rename qemu_semihosting_connect_chardevs to qemu_semihosting_chardev_init; pass the result directly to qemu_semihosting_console_init. Store the chardev in SemihostingConsole instead of SemihostingConfig, which lets us drop semihosting_get_chardev. Reviewed-by: Luc Michel <lmichel@kalray.eu> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
e7fb6f3205
commit
fb08790b35
5 changed files with 26 additions and 44 deletions
|
@ -51,7 +51,6 @@ QemuOptsList qemu_semihosting_config_opts = {
|
|||
typedef struct SemihostingConfig {
|
||||
bool enabled;
|
||||
SemihostingTarget target;
|
||||
Chardev *chardev;
|
||||
char **argv;
|
||||
int argc;
|
||||
const char *cmdline; /* concatenated argv */
|
||||
|
@ -122,11 +121,6 @@ void semihosting_arg_fallback(const char *file, const char *cmd)
|
|||
}
|
||||
}
|
||||
|
||||
Chardev *semihosting_get_chardev(void)
|
||||
{
|
||||
return semihosting.chardev;
|
||||
}
|
||||
|
||||
void qemu_semihosting_enable(void)
|
||||
{
|
||||
semihosting.enabled = true;
|
||||
|
@ -172,16 +166,19 @@ int qemu_semihosting_config_options(const char *optarg)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void qemu_semihosting_connect_chardevs(void)
|
||||
/* We had to defer this until chardevs were created */
|
||||
void qemu_semihosting_chardev_init(void)
|
||||
{
|
||||
/* We had to defer this until chardevs were created */
|
||||
Chardev *chr = NULL;
|
||||
|
||||
if (semihost_chardev) {
|
||||
Chardev *chr = qemu_chr_find(semihost_chardev);
|
||||
chr = qemu_chr_find(semihost_chardev);
|
||||
if (chr == NULL) {
|
||||
error_report("semihosting chardev '%s' not found",
|
||||
semihost_chardev);
|
||||
exit(1);
|
||||
}
|
||||
semihosting.chardev = chr;
|
||||
}
|
||||
|
||||
qemu_semihosting_console_init(chr);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue