* [Xen-devel] [PATCH for-4.13] xen: sched: Fix Arm build after commit f855dd9625
@ 2019-09-24 17:17 Julien Grall
2019-09-24 17:18 ` Julien Grall
0 siblings, 1 reply; 2+ messages in thread
From: Julien Grall @ 2019-09-24 17:17 UTC (permalink / raw)
To: xen-devel; +Cc: jgross, Julien Grall
Commit f855dd9625 "sched: add minimalistic idle scheduler for free cpus"
introduce the use of ZERO_BLOCK_PTR in the scheduler code. However, the
define does not exist outside of xmalloc_tsf.c for non-x86 architecture.
This will result to a compilation error on Arm:
schedule.c: In function ‘sched_idle_alloc_vdata’:
schedule.c:100:12: error: ‘ZERO_BLOCK_PTR’ undeclared (first use in this function)
return ZERO_BLOCK_PTR;
^~~~~~~~~~~~~~
schedule.c:100:12: note: each undeclared identifier is reported only once for each function it appears in
schedule.c:101:1: error: control reaches end of non-void function [-Werror=return-type]
}
^
cc1: all warnings being treated as errors
To avoid the compilation error, the default definition for
ZERO_BLOCK_PTR is now moved in xen/config.h allowing all the code to use
the define.
Fixes: f855dd9625 ('sched: add minimalistic idle scheduler for free cpus')
Signed-off-by: Julien Grall <julien.grall@arm.com>
---
xen/common/xmalloc_tlsf.c | 5 -----
xen/include/xen/config.h | 5 +++++
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/xen/common/xmalloc_tlsf.c b/xen/common/xmalloc_tlsf.c
index e98ad65455..1e8d72dea2 100644
--- a/xen/common/xmalloc_tlsf.c
+++ b/xen/common/xmalloc_tlsf.c
@@ -549,11 +549,6 @@ static void tlsf_init(void)
* xmalloc()
*/
-#ifndef ZERO_BLOCK_PTR
-/* Return value for zero-size allocation, distinguished from NULL. */
-#define ZERO_BLOCK_PTR ((void *)-1L)
-#endif
-
void *_xmalloc(unsigned long size, unsigned long align)
{
void *p = NULL;
diff --git a/xen/include/xen/config.h b/xen/include/xen/config.h
index a1d0f970a7..a106380a23 100644
--- a/xen/include/xen/config.h
+++ b/xen/include/xen/config.h
@@ -86,4 +86,9 @@
#define NDEBUG
#endif
+#ifndef ZERO_BLOCK_PTR
+/* Return value for zero-size allocation, distinguished from NULL. */
+#define ZERO_BLOCK_PTR ((void *)-1L)
+#endif
+
#endif /* __XEN_CONFIG_H__ */
--
2.11.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Xen-devel] [PATCH for-4.13] xen: sched: Fix Arm build after commit f855dd9625
2019-09-24 17:17 [Xen-devel] [PATCH for-4.13] xen: sched: Fix Arm build after commit f855dd9625 Julien Grall
@ 2019-09-24 17:18 ` Julien Grall
0 siblings, 0 replies; 2+ messages in thread
From: Julien Grall @ 2019-09-24 17:18 UTC (permalink / raw)
To: xen-devel; +Cc: jgross
Hi,
I forgot to CC the maintainers on it :/. Please ignore this e-mail.
Sorry for the noise.
Cheers,
On 9/24/19 6:17 PM, Julien Grall wrote:
> Commit f855dd9625 "sched: add minimalistic idle scheduler for free cpus"
> introduce the use of ZERO_BLOCK_PTR in the scheduler code. However, the
> define does not exist outside of xmalloc_tsf.c for non-x86 architecture.
>
> This will result to a compilation error on Arm:
>
> schedule.c: In function ‘sched_idle_alloc_vdata’:
> schedule.c:100:12: error: ‘ZERO_BLOCK_PTR’ undeclared (first use in this function)
> return ZERO_BLOCK_PTR;
> ^~~~~~~~~~~~~~
> schedule.c:100:12: note: each undeclared identifier is reported only once for each function it appears in
> schedule.c:101:1: error: control reaches end of non-void function [-Werror=return-type]
> }
> ^
> cc1: all warnings being treated as errors
>
> To avoid the compilation error, the default definition for
> ZERO_BLOCK_PTR is now moved in xen/config.h allowing all the code to use
> the define.
>
> Fixes: f855dd9625 ('sched: add minimalistic idle scheduler for free cpus')
> Signed-off-by: Julien Grall <julien.grall@arm.com>
> ---
> xen/common/xmalloc_tlsf.c | 5 -----
> xen/include/xen/config.h | 5 +++++
> 2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/xen/common/xmalloc_tlsf.c b/xen/common/xmalloc_tlsf.c
> index e98ad65455..1e8d72dea2 100644
> --- a/xen/common/xmalloc_tlsf.c
> +++ b/xen/common/xmalloc_tlsf.c
> @@ -549,11 +549,6 @@ static void tlsf_init(void)
> * xmalloc()
> */
>
> -#ifndef ZERO_BLOCK_PTR
> -/* Return value for zero-size allocation, distinguished from NULL. */
> -#define ZERO_BLOCK_PTR ((void *)-1L)
> -#endif
> -
> void *_xmalloc(unsigned long size, unsigned long align)
> {
> void *p = NULL;
> diff --git a/xen/include/xen/config.h b/xen/include/xen/config.h
> index a1d0f970a7..a106380a23 100644
> --- a/xen/include/xen/config.h
> +++ b/xen/include/xen/config.h
> @@ -86,4 +86,9 @@
> #define NDEBUG
> #endif
>
> +#ifndef ZERO_BLOCK_PTR
> +/* Return value for zero-size allocation, distinguished from NULL. */
> +#define ZERO_BLOCK_PTR ((void *)-1L)
> +#endif
> +
> #endif /* __XEN_CONFIG_H__ */
>
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-09-24 17:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-24 17:17 [Xen-devel] [PATCH for-4.13] xen: sched: Fix Arm build after commit f855dd9625 Julien Grall
2019-09-24 17:18 ` Julien Grall
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.