mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Peter Mamonov <pmamonov@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v3] commands: import memtester 4.3.0 from Debian GNU/Linux
Date: Mon, 2 Nov 2020 10:37:15 +0100	[thread overview]
Message-ID: <20201102093715.GV26805@pengutronix.de> (raw)
In-Reply-To: <20201101214115.16472-1-pmamonov@gmail.com>

Hi Peter,

On Mon, Nov 02, 2020 at 12:41:15AM +0300, Peter Mamonov wrote:
> Memtester is an utility for testing the memory subsystem for faults.  For
> hardware developers, memtester can be told to test memory starting at a
> particular physical address.

Applied with some adjustments, thanks

> +#include <linux/limits.h>
> +
> +#define rand32() random32()
> +
> +#if defined(CONFIG_32BIT)
> +    #define rand_ul() rand32()
> +    #define UL_ONEBITS 0xffffffff
> +    #define UL_LEN 32
> +    #define CHECKERBOARD1 0x55555555
> +    #define CHECKERBOARD2 0xaaaaaaaa
> +    #define UL_BYTE(x) ((x | x << 8 | x << 16 | x << 24))
> +#elif defined(CONFIG_64BIT)
> +    #define rand64() (((ul) rand32()) << 32 | ((ul) rand32()))
> +    #define rand_ul() rand64()
> +    #define UL_ONEBITS 0xffffffffffffffffUL
> +    #define UL_LEN 64
> +    #define CHECKERBOARD1 0x5555555555555555
> +    #define CHECKERBOARD2 0xaaaaaaaaaaaaaaaa
> +    #define UL_BYTE(x) (((ul)x | (ul)x<<8 | (ul)x<<16 | (ul)x<<24 | (ul)x<<32 | (ul)x<<40 | (ul)x<<48 | (ul)x<<56))
> +#else
> +    #error long on this platform is not 32 or 64 bits
> +#endif

CONFIG_32BIT is not always set, only CONFIG_64BIT is. I had to change
this to

#ifdef CONFIG_64BIT
...
#else
...
#endif

Sascha


-- 
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 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2020-11-02  9:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-01 21:41 Peter Mamonov
2020-11-02  9:37 ` 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=20201102093715.GV26805@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=pmamonov@gmail.com \
    /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