mirror of
https://github.com/qemu/qemu.git
synced 2026-09-22 14:34:34 +00:00
tests/tcg/s390x/console.c: directly implement memcpy and memset
pc-bios/s390-ccw/sclp.c uses memcpy and memset. pc-bios/s390-ccw is part of QEMU repository. However roms/SLOF is only available if submodules have been initialized, which is not not always the case. To break this dependency, just copy their definition here, and remove include to submodules files. Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com> Tested-by: Aniket Sahu <asahu1x@linux.ibm.com> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com> Message-ID: <20260827221506.91574-86-pierrick.bouvier@oss.qualcomm.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
This commit is contained in:
committed by
Alex Bennée
parent
4851d25f0e
commit
e52f65dcd1
@@ -6,8 +6,34 @@
|
||||
*/
|
||||
|
||||
#include "../../../pc-bios/s390-ccw/sclp.c"
|
||||
#include "../../../roms/SLOF/lib/libc/string/memset.c"
|
||||
#include "../../../roms/SLOF/lib/libc/string/memcpy.c"
|
||||
#include "string.h"
|
||||
|
||||
|
||||
void *
|
||||
memcpy(void *dest, const void *src, size_t n)
|
||||
{
|
||||
char *cdest;
|
||||
const char *csrc = src;
|
||||
|
||||
cdest = dest;
|
||||
while (n-- > 0) {
|
||||
*cdest++ = *csrc++;
|
||||
}
|
||||
|
||||
return dest;
|
||||
}
|
||||
|
||||
void *
|
||||
memset(void *dest, int c, size_t size)
|
||||
{
|
||||
unsigned char *d = (unsigned char *)dest;
|
||||
|
||||
while (size-- > 0) {
|
||||
*d++ = (unsigned char)c;
|
||||
}
|
||||
|
||||
return dest;
|
||||
}
|
||||
|
||||
void __sys_outc(char c)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user