mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] sandbox: implement DEBUG_LL support
Date: Wed, 5 Oct 2022 08:36:12 +0200	[thread overview]
Message-ID: <20221005063612.GP986@pengutronix.de> (raw)
In-Reply-To: <20221004154800.3457742-1-a.fatoum@pengutronix.de>

On Tue, Oct 04, 2022 at 05:48:00PM +0200, Ahmad Fatoum wrote:
> We can't currently debug malloc() or early parts of the driver model on
> sandbox, because we require both to allocate the sandbox console device.
> 
> To make debugging such early startup easier in future, add some simple
> DEBUG_LL support.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  arch/sandbox/Kconfig                |  1 +
>  arch/sandbox/Makefile               |  3 ++-
>  arch/sandbox/include/asm/debug_ll.h | 16 ++++++++++++++++
>  3 files changed, 19 insertions(+), 1 deletion(-)
>  create mode 100644 arch/sandbox/include/asm/debug_ll.h

Applied, thanks

Sascha

> 
> diff --git a/arch/sandbox/Kconfig b/arch/sandbox/Kconfig
> index a8bca8757f28..d3889fcac03c 100644
> --- a/arch/sandbox/Kconfig
> +++ b/arch/sandbox/Kconfig
> @@ -16,6 +16,7 @@ config SANDBOX
>  	select ARCH_HAS_STACK_DUMP if ASAN
>  	select GENERIC_FIND_NEXT_BIT
>  	select HAS_ARCH_SJLJ
> +	select HAS_ASM_DEBUG_LL
>  	default y
>  
>  config ARCH_TEXT_BASE
> diff --git a/arch/sandbox/Makefile b/arch/sandbox/Makefile
> index aee6bccc9c14..d5ba05ba866f 100644
> --- a/arch/sandbox/Makefile
> +++ b/arch/sandbox/Makefile
> @@ -30,7 +30,8 @@ KBUILD_CFLAGS += -Dmalloc=barebox_malloc -Dcalloc=barebox_calloc \
>  		-Dopendir=barebox_opendir -Dreaddir=barebox_readdir \
>  		-Dclosedir=barebox_closedir -Dreadlink=barebox_readlink \
>  		-Doptarg=barebox_optarg -Doptind=barebox_optind \
> -		-Dsetjmp=barebox_setjmp -Dlongjmp=barebox_longjmp
> +		-Dsetjmp=barebox_setjmp -Dlongjmp=barebox_longjmp \
> +		-Dputchar=barebox_putchar
>  
>  machdirs := $(patsubst %,arch/sandbox/mach-%/,$(machine-y))
>  
> diff --git a/arch/sandbox/include/asm/debug_ll.h b/arch/sandbox/include/asm/debug_ll.h
> new file mode 100644
> index 000000000000..7bef8710581e
> --- /dev/null
> +++ b/arch/sandbox/include/asm/debug_ll.h
> @@ -0,0 +1,16 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +
> +#ifndef __ASM_DEBUG_LL__
> +#define __ASM_DEBUG_LL__
> +
> +#undef putchar
> +
> +static inline void PUTC_LL(char ch)
> +{
> +	int putchar(int c);
> +	putchar(ch);
> +}
> +
> +#define putchar barebox_putchar
> +
> +#endif /* __ASM_DEBUG_LL__ */
> -- 
> 2.30.2
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



      reply	other threads:[~2022-10-05  6:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-04 15:48 Ahmad Fatoum
2022-10-05  6:36 ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221005063612.GP986@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox