[PATCH v1 1/5] lib/string: Add memset_simple()

Wolfgang Denk wd at denx.de
Fri Aug 6 17:36:25 CEST 2021


Dear Stefan,

In message <20210806133843.3642916-2-sr at denx.de> you wrote:
> The optimized memset() ARM64 implementation cannot be used very early
> on, since caches need to be enabled for this function to work. Otherwise
> an exception occurs (only printed with very early DEBUG_UART enabled).
>
> This patch now implements a very simple memset() version, which will be
> used in a few selected places in the ARM64 early boot process.
...

We have already implementations of memset() elsewhere, for example in
lib/string.c [hey, that's even the file you are modifying...], then
again in lib/efi/efi_stub.c and also in
lib/efi_loader/efi_freestanding.c - so do we really need another
implementation?

BTW: lib/efi_loader/efi_freestanding.c  looks completely useless to
me.  Can we dump this? [Adding Heinich to Cc:]


> +void *memset_simple(void *s, int c, size_t count)
> +{
> +	char *s8 = (char *)s;
> +
> +	while (count--)
> +		*s8++ = c;
> +
> +	return s;
> +}

In which way is this different from memset() as defined in the same
file (further up) with CONFIG_TINY_MEMSET enabled?  And even without
this option the memset() implementation here should work.  Or does
it not?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
: ... and it's got weird formatting - Notepad, Write, Works  3  can't
: decipher it, and it's too big to go in DOS Edit. Help!
Install an operating system. :-)                  -- Tom Christiansen


More information about the U-Boot mailing list