mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
semihosting: Split out semihost_sys_close
Split out the non-ARM specific portions of SYS_CLOSE to a reusable function. This handles all GuestFD. Note that gdb_do_syscall %x reads target_ulong, not int. Reviewed-by: Luc Michel <lmichel@kalray.eu> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
5b3f39cb04
commit
5eadbbfca6
4 changed files with 57 additions and 41 deletions
|
@ -49,6 +49,11 @@ int alloc_guestfd(void)
|
|||
return i;
|
||||
}
|
||||
|
||||
static void do_dealloc_guestfd(GuestFD *gf)
|
||||
{
|
||||
gf->type = GuestFDUnused;
|
||||
}
|
||||
|
||||
/*
|
||||
* Look up the guestfd in the data structure; return NULL
|
||||
* for out of bounds, but don't check whether the slot is unused.
|
||||
|
@ -119,5 +124,5 @@ void dealloc_guestfd(int guestfd)
|
|||
GuestFD *gf = do_get_guestfd(guestfd);
|
||||
|
||||
assert(gf);
|
||||
gf->type = GuestFDUnused;
|
||||
do_dealloc_guestfd(gf);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue