diff --git a/sys/sys/pcpu.h b/sys/sys/pcpu.h index 1ee7717..4655cb4 100644 --- a/sys/sys/pcpu.h +++ b/sys/sys/pcpu.h @@ -44,24 +44,10 @@ /* * Define a set for pcpu data. - * - * We don't use SET_DECLARE because it defines the set as 'a' when we - * want 'aw'. gcc considers uninitialized data in a separate section - * writable, and there is no generic zero initializer that works for - * structs and scalars. */ extern uintptr_t *__start_set_pcpu; extern uintptr_t *__stop_set_pcpu; -__asm__( -#ifdef __arm__ - ".section set_pcpu, \"aw\", %progbits\n" -#else - ".section set_pcpu, \"aw\", @progbits\n" -#endif - "\t.p2align " __XSTRING(CACHE_LINE_SHIFT) "\n" - "\t.previous"); - /* * Array of dynamic pcpu base offsets. Indexed by id. */ @@ -82,7 +68,9 @@ extern uintptr_t dpcpu_off[]; */ #define DPCPU_NAME(n) pcpu_entry_##n #define DPCPU_DECLARE(t, n) extern t DPCPU_NAME(n) -#define DPCPU_DEFINE(t, n) t DPCPU_NAME(n) __section("set_pcpu") __used +#define DPCPU_DEFINE(t, n) \ + t DPCPU_NAME(n) __section("set_pcpu") \ + __aligned(CACHE_LINE_SIZE) __used /* * Accessors with a given base.