Allow PERCPU array types
authorBarret Rhoden <brho@cs.berkeley.edu>
Fri, 27 Apr 2018 16:22:33 +0000 (12:22 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Mon, 30 Apr 2018 18:38:29 +0000 (14:38 -0400)
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/include/percpu.h

index 483b31b..2397a0f 100644 (file)
@@ -64,9 +64,9 @@
 #define PERCPU_VAR(var) (*__PERCPU_VARPTR(PERCPU_VARNAME(var), core_id()))
 
 #define DEFINE_PERCPU(type, var)                                               \
-       type PERCPU_VARNAME(var) __attribute__ ((section (PERCPU_SECTION_STR)))
+       __typeof__(type) PERCPU_VARNAME(var) __attribute__ ((section (PERCPU_SECTION_STR)))
 #define DECLARE_PERCPU(type, var)                                                              \
-       extern type PERCPU_VARNAME(var)                                                         \
+       extern __typeof__(type) PERCPU_VARNAME(var)                                     \
                __attribute__ ((section (PERCPU_SECTION_STR)))
 
 #define PERCPU_INIT_SECTION __percpu_init