Skip to content

Commit

Permalink
stubs: split semihosting_get_target from system only stubs
Browse files Browse the repository at this point in the history
As we are about to have a common syscalls.c for gdbstub we need to
stub out one semihosting helper function for all targets.

Signed-off-by: Alex Bennée <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Message-Id: <[email protected]>
  • Loading branch information
stsquad committed Mar 7, 2023
1 parent 0820a07 commit ad66b5c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
1 change: 1 addition & 0 deletions stubs/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,5 @@ if have_system
else
stub_ss.add(files('qdev.c'))
endif
stub_ss.add(files('semihost-all.c'))
stub_ss.add(when: 'CONFIG_VFIO_USER_SERVER', if_false: files('vfio-user-obj.c'))
17 changes: 17 additions & 0 deletions stubs/semihost-all.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Semihosting Stubs for all targets
*
* Copyright (c) 2023 Linaro Ltd
*
* Stubs for all targets that don't actually do semihosting.
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/

#include "qemu/osdep.h"
#include "semihosting/semihost.h"

SemihostingTarget semihosting_get_target(void)
{
return SEMIHOSTING_TARGET_AUTO;
}
5 changes: 0 additions & 5 deletions stubs/semihost.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ bool semihosting_enabled(bool is_user)
return false;
}

SemihostingTarget semihosting_get_target(void)
{
return SEMIHOSTING_TARGET_AUTO;
}

/*
* All the rest are empty subs. We could g_assert_not_reached() but
* that adds extra weight to the final binary. Waste not want not.
Expand Down

0 comments on commit ad66b5c

Please sign in to comment.