<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/include/compiler.h, branch v2021.04</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>compiler.h: add host_build()</title>
<updated>2020-12-26T11:37:28+00:00</updated>
<author>
<name>Sebastian Reichel</name>
<email>sebastian.reichel@collabora.com</email>
</author>
<published>2020-12-14T23:41:53+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=db43c0b72d1eb0dcf2778413743fcf355b5632a1'/>
<id>db43c0b72d1eb0dcf2778413743fcf355b5632a1</id>
<content type='text'>
Add a host_build() function, so that it's possible to
check for software being build with USE_HOSTCC without
relying on preprocessor conditions. In other words

 #ifdef USE_HOSTCC
 	host_only_code();
 #endif

can be written like this instead:

 if (host_build())
 	host_only_code();

This improves code readability and test coverage and
compiler will eleminate this unreachable code.

Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a host_build() function, so that it's possible to
check for software being build with USE_HOSTCC without
relying on preprocessor conditions. In other words

 #ifdef USE_HOSTCC
 	host_only_code();
 #endif

can be written like this instead:

 if (host_build())
 	host_only_code();

This improves code readability and test coverage and
compiler will eleminate this unreachable code.

Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Update MEM_SUPPORT_64BIT_DATA to be always defined</title>
<updated>2020-07-08T21:21:46+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2020-06-03T01:26:44+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=3428faf23af5079e80c53d0d8473af30d3c19fca'/>
<id>3428faf23af5079e80c53d0d8473af30d3c19fca</id>
<content type='text'>
Define this macro always so we don't need the preprocessor to check it.
Convert the users to #if instead of #ifdef.

Note that '#if MEM_SUPPORT_64BIT_DATA' does not give an error if the
macro is not define. It just assumes zero.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Stefan Roese &lt;sr@denx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Define this macro always so we don't need the preprocessor to check it.
Convert the users to #if instead of #ifdef.

Note that '#if MEM_SUPPORT_64BIT_DATA' does not give an error if the
macro is not define. It just assumes zero.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Stefan Roese &lt;sr@denx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>common: Move and rename CONFIG_SYS_SUPPORT_64BIT_DATA</title>
<updated>2020-01-17T22:53:52+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2019-12-28T17:45:10+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=4d979bfdbc9dd9c4fcfc824754c9bd2109261a2b'/>
<id>4d979bfdbc9dd9c4fcfc824754c9bd2109261a2b</id>
<content type='text'>
This is not really a CONFIG since it is not intended to be set by boards.
Move it into the compiler header with other similar defines, and rename
it.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is not really a CONFIG since it is not intended to be set by boards.
Move it into the compiler header with other similar defines, and rename
it.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>include: fix 'ulong' definition on musl targets</title>
<updated>2020-01-03T14:47:10+00:00</updated>
<author>
<name>Sergei Trofimovich</name>
<email>slyfox@gentoo.org</email>
</author>
<published>2019-12-30T15:53:41+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=d11fa9c16b8f50788c07e22bd742177d14e435b2'/>
<id>d11fa9c16b8f50788c07e22bd742177d14e435b2</id>
<content type='text'>
The build failure was originally reported on arm64-musl
target at https://bugs.gentoo.org/703132. Here is the amd64-musl
variant:

```
$ LANG=C make CROSS_COMPILE=x86_64-gentoo-linux-musl- tools-only_defconfig -j$(nproc)
$ LANG=C make CROSS_COMPILE=x86_64-gentoo-linux-musl- tools-all            -j$(nproc)
...
In file included from tools/env/../../env/flags.c:7,
                 from tools/env/env_flags.c:1:
include/env.h:159:1: error: unknown type name 'ulong'; did you mean 'long'?
  159 | ulong env_get_ulong(const char *name, int base, ulong default_val);
      | ^~~~~
      | long
```

Note: 'ulong' is not defined there.

On glibc 'ulong' comes from &lt;sys/types.h&gt;:

```c
/* Old compatibility names for C types.  */
typedef unsigned long int ulong;
```

On musl it comes from &lt;sys/types.h&gt; as well but from under different guards:

```c
typedef unsigned long u_long, ulong;
```

The change inlines 'ulong' define similar to 'uint' define.

Bug: https://bugs.gentoo.org/703132
Signed-off-by: Sergei Trofimovich &lt;slyfox@gentoo.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The build failure was originally reported on arm64-musl
target at https://bugs.gentoo.org/703132. Here is the amd64-musl
variant:

```
$ LANG=C make CROSS_COMPILE=x86_64-gentoo-linux-musl- tools-only_defconfig -j$(nproc)
$ LANG=C make CROSS_COMPILE=x86_64-gentoo-linux-musl- tools-all            -j$(nproc)
...
In file included from tools/env/../../env/flags.c:7,
                 from tools/env/env_flags.c:1:
include/env.h:159:1: error: unknown type name 'ulong'; did you mean 'long'?
  159 | ulong env_get_ulong(const char *name, int base, ulong default_val);
      | ^~~~~
      | long
```

Note: 'ulong' is not defined there.

On glibc 'ulong' comes from &lt;sys/types.h&gt;:

```c
/* Old compatibility names for C types.  */
typedef unsigned long int ulong;
```

On musl it comes from &lt;sys/types.h&gt; as well but from under different guards:

```c
typedef unsigned long u_long, ulong;
```

The change inlines 'ulong' define similar to 'uint' define.

Bug: https://bugs.gentoo.org/703132
Signed-off-by: Sergei Trofimovich &lt;slyfox@gentoo.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove CONFIG_USE_STDINT</title>
<updated>2018-09-11T00:48:16+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2018-08-06T11:47:38+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=9865543ae65d7c9a435eedfc6a0ba23efb291121'/>
<id>9865543ae65d7c9a435eedfc6a0ba23efb291121</id>
<content type='text'>
You do not need to use the typedefs provided by compiler.

Our compilers are either IPL32 or LP64.  Hence, U-Boot can/should
always use int-ll64.h typedefs like Linux kernel, whatever the
typedefs the compiler internally uses.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
You do not need to use the typedefs provided by compiler.

Our compilers are either IPL32 or LP64.  Hence, U-Boot can/should
always use int-ll64.h typedefs like Linux kernel, whatever the
typedefs the compiler internally uses.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix FreeBSD endian checks</title>
<updated>2018-02-06T01:58:11+00:00</updated>
<author>
<name>Justin Hibbits</name>
<email>chmeeedalf@gmail.com</email>
</author>
<published>2018-01-30T04:23:36+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=f29aa23b54e26d212cc61c07bcbb66ed5d6f9704'/>
<id>f29aa23b54e26d212cc61c07bcbb66ed5d6f9704</id>
<content type='text'>
FreeBSD, like OpenBSD, uses BIG_ENDIAN, LITTLE_ENDIAN, and BYTE_ORDER,
whereas Linux and compatibles use __-prefixed names.  Define the names
the same as the OpenBSD block below it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
FreeBSD, like OpenBSD, uses BIG_ENDIAN, LITTLE_ENDIAN, and BYTE_ORDER,
whereas Linux and compatibles use __-prefixed names.  Define the names
the same as the OpenBSD block below it.
</pre>
</div>
</content>
</entry>
<entry>
<title>compiler.h: use u-boot endian macros on OpenBSD</title>
<updated>2016-12-03T02:32:38+00:00</updated>
<author>
<name>Jonathan Gray</name>
<email>jsg@jsg.id.au</email>
</author>
<published>2016-11-26T04:18:00+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=fd184b9c8003811d797dfc64af6375ecb43cc79d'/>
<id>fd184b9c8003811d797dfc64af6375ecb43cc79d</id>
<content type='text'>
When building u-boot on sparc64 and powerpc hosts it became clear that
u-boot expects endian conversion defines to be macros:

lib/crc32.c:87: error: braced-group within expression allowed only inside a function

For OpenBSD switch from using system definitions equivalent to the u-boot ones
and define glibc __BYTE_ORDER __BIG_ENDIAN __LITTLE_ENDIAN names, as at least
some parts of the non-cross build assumes those names are present (ie crc32.c).

Signed-off-by: Jonathan Gray &lt;jsg@jsg.id.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When building u-boot on sparc64 and powerpc hosts it became clear that
u-boot expects endian conversion defines to be macros:

lib/crc32.c:87: error: braced-group within expression allowed only inside a function

For OpenBSD switch from using system definitions equivalent to the u-boot ones
and define glibc __BYTE_ORDER __BIG_ENDIAN __LITTLE_ENDIAN names, as at least
some parts of the non-cross build assumes those names are present (ie crc32.c).

Signed-off-by: Jonathan Gray &lt;jsg@jsg.id.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>compiler.h: use system endian macros on OpenBSD</title>
<updated>2016-09-07T12:49:06+00:00</updated>
<author>
<name>Jonathan Gray</name>
<email>jsg@jsg.id.au</email>
</author>
<published>2016-09-02T22:26:55+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=3715a540c49335532fb0f75f5b18bc9e269f4471'/>
<id>3715a540c49335532fb0f75f5b18bc9e269f4471</id>
<content type='text'>
The u-boot endian macros map directly to system endian
macros on OpenBSD.

Signed-off-by: Jonathan Gray &lt;jsg@jsg.id.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The u-boot endian macros map directly to system endian
macros on OpenBSD.

Signed-off-by: Jonathan Gray &lt;jsg@jsg.id.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "include/linux: move typdef for uintptr_t"</title>
<updated>2015-12-16T12:11:15+00:00</updated>
<author>
<name>York Sun</name>
<email>yorksun@freescale.com</email>
</author>
<published>2015-12-16T06:12:24+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=2e680f92b888b4cb2fde2b0c77cbde22b48933f5'/>
<id>2e680f92b888b4cb2fde2b0c77cbde22b48933f5</id>
<content type='text'>
This reverts commit e8f954a756a825130d11b9c8fca70101dd8b3ac5, which
causes compiling errors on 32-bit hosts.

Acked-by: Aneesh Bansal &lt;aneesh.bansal@freescale.com&gt;
Signed-off-by: York Sun &lt;yorksun@freescale.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit e8f954a756a825130d11b9c8fca70101dd8b3ac5, which
causes compiling errors on 32-bit hosts.

Acked-by: Aneesh Bansal &lt;aneesh.bansal@freescale.com&gt;
Signed-off-by: York Sun &lt;yorksun@freescale.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>include/linux: move typdef for uintptr_t</title>
<updated>2015-12-15T00:57:34+00:00</updated>
<author>
<name>Aneesh Bansal</name>
<email>aneesh.bansal@freescale.com</email>
</author>
<published>2015-12-08T08:24:28+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=e8f954a756a825130d11b9c8fca70101dd8b3ac5'/>
<id>e8f954a756a825130d11b9c8fca70101dd8b3ac5</id>
<content type='text'>
uintptr_t which is a typdef for unsigned long is needed for creating
pointers (32 or 64 bit depending on Core) from 32 bit variables
storing the address.
If a 32 bit variable (u32) is typecasted to a pointer (void *),
compiler gives a warning in case size of pointer on the core is 64 bit.

The typdef has been moved from include/compiler.h to include/linux/types.h

Signed-off-by: Aneesh Bansal &lt;aneesh.bansal@freescale.com&gt;
Reviewed-by: York Sun &lt;yorksun@freescale.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
uintptr_t which is a typdef for unsigned long is needed for creating
pointers (32 or 64 bit depending on Core) from 32 bit variables
storing the address.
If a 32 bit variable (u32) is typecasted to a pointer (void *),
compiler gives a warning in case size of pointer on the core is 64 bit.

The typdef has been moved from include/compiler.h to include/linux/types.h

Signed-off-by: Aneesh Bansal &lt;aneesh.bansal@freescale.com&gt;
Reviewed-by: York Sun &lt;yorksun@freescale.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
