xen: sched: Fix Arm build after commit f855dd9625
PATCH 1/1 xen: sched: Fix Arm build after commit f855dd9625
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.
--- xen/common/xmalloc_tlsf.c | 5 ----- xen/include/xen/config.h | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-)
xen/common/xmalloc_tlsf.c +0 -5
@@ -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 ;
xen/include/xen/config.h +5 -0
@@ -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__ */
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Hi,
I forgot to CC the maintainers on it :/. Please ignore this e-mail.
Sorry for the noise.
Cheers,
Quoted 58 lines · Julien Grall
Commit
f855dd9625"sched: add minimalistic idle scheduler for free cpus" introduce the use ofZERO_BLOCK_PTRin the scheduler code. However, the define does not exist outside ofxmalloc_tsf.cfor 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 errorsTo avoid the compilation error, the default definition for
ZERO_BLOCK_PTRis now moved inxen/config.hallowing all the code to use the define.Fixes f855dd9625 ('sched: add minimalistic idle scheduler for free cpus')Signed-off-by Julien Grall <[email protected]>--- xen/common/xmalloc_tlsf.c | 5 ----- xen/include/xen/config.h | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-)xen/common/xmalloc_tlsf.c +0
-5@@ -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 ;xen/include/xen/config.h +5
-0@@ -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__ */
Signature · 6 lines
Julien Grall _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel