]> xenbits.xensource.com Git - people/larsk/xen.git/commitdiff
xen: sched: Fix Arm build after commit f855dd9625 master
authorJulien Grall <julien.grall@arm.com>
Tue, 24 Sep 2019 17:06:22 +0000 (18:06 +0100)
committerJulien Grall <julien.grall@arm.com>
Tue, 24 Sep 2019 17:58:55 +0000 (18:58 +0100)
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>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/common/xmalloc_tlsf.c
xen/include/xen/config.h

index e98ad65455e6391f618623a393a779afb2af41a5..1e8d72dea287a3ecf77711c0802454d77dbd2196 100644 (file)
@@ -549,11 +549,6 @@ static void tlsf_init(void)
  * xmalloc()
  */
 
  * 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;
 void *_xmalloc(unsigned long size, unsigned long align)
 {
     void *p = NULL;
index a1d0f970a79b47819aaefedb15bd2524b5e192ba..a106380a23604fdc15bf6aa83fefd0058298b2dc 100644 (file)
@@ -86,4 +86,9 @@
 #define NDEBUG
 #endif
 
 #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__ */
 #endif /* __XEN_CONFIG_H__ */