amdgcn: Implement proper locks: Fix 'newlib/libc/sys/amdgcn/include/sys/lock.h' for C++ (was: [PATCH] amdgcn: Implement proper locks)

Thomas Schwinge tschwinge@baylibre.com
Thu Apr 4 14:05:47 GMT 2024


Hi!

On 2024-03-22T14:53:30+0000, Andrew Stubbs <ams@baylibre.com> wrote:
> This should prevent printf output from multiple threads getting garbled.

Confirmed, thanks!

> I don't know why IO ever worked properly -- probably it was always a bit
> broken -- but the GFX11 devices have a different cache architecture and
> trying to print from many threads at once corrupted the FILE buffers.

> --- /dev/null
> +++ b/newlib/libc/sys/amdgcn/include/sys/lock.h
> @@ -0,0 +1,39 @@
> +#ifndef __SYS_LOCK_H__
> +#define __SYS_LOCK_H__
> +
> +#include <newlib.h>
> +#include <_ansi.h>
> +
> +typedef unsigned int _LOCK_T;
> +[...]
> +
> +#ifdef __cplusplus
> +}
> +#endif
> +
> +#endif /* __SYS_LOCK_H__ */

Pushed to main branch commit ed50a50b9b551ed693d28cd458a49e5196d27f06
"amdgcn: Implement proper locks: Fix 'newlib/libc/sys/amdgcn/include/sys/lock.h' for C++",
see attached.


Grüße
 Thomas


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-amdgcn-Implement-proper-locks-Fix-newlib-libc-sys-am.patch
Type: text/x-diff
Size: 1094 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/newlib/attachments/20240404/d214de53/attachment.bin>


More information about the Newlib mailing list