From 1b501e53f31162b977a0eff8cca3f9d75c8847aa Mon Sep 17 00:00:00 2001 From: "Bjoern A. Zeeb" Date: Wed, 12 Aug 2009 10:26:03 +0000 Subject: [PATCH] Put minimum alignment on the dpcpu and vnet section so that ld when adding the __start_ symbol knows the expected section alignment and can place the __start_ symbol correctly. These sections will not support symbols with super-cache line alignment requirements. For full details, see posting to freebsd-current, 2009-08-10, Message-ID: <20090810133111.C93661@maildrop.int.zabbadoz.net>. Debugging and testing patches by: Kamigishi Rei (spambox haruhiism.net), np, lstewart, jhb, kib, rwatson Tested by: Kamigishi Rei, lstewart Reviewed by: kib Approved by: re --- sys/net/vnet.h | 8 +++++--- sys/sys/pcpu.h | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/sys/net/vnet.h b/sys/net/vnet.h index 01d824d68b26..d441af199703 100644 --- a/sys/net/vnet.h +++ b/sys/net/vnet.h @@ -185,12 +185,14 @@ extern struct sx vnet_sxlock; * Virtual network stack memory allocator, which allows global variables to * be automatically instantiated for each network stack instance. */ +__asm__( #if defined(__arm__) -__asm__(".section " VNET_SETNAME ", \"aw\", %progbits"); + ".section " VNET_SETNAME ", \"aw\", %progbits\n" #else -__asm__(".section " VNET_SETNAME ", \"aw\", @progbits"); + ".section " VNET_SETNAME ", \"aw\", @progbits\n" #endif -__asm__(".previous"); + "\t.p2align " __XSTRING(CACHE_LINE_SHIFT) "\n" + "\t.previous"); #define VNET_NAME(n) vnet_entry_##n #define VNET_DECLARE(t, n) extern t VNET_NAME(n) diff --git a/sys/sys/pcpu.h b/sys/sys/pcpu.h index 8c0e0d55a950..ae6cc0953ba5 100644 --- a/sys/sys/pcpu.h +++ b/sys/sys/pcpu.h @@ -56,12 +56,14 @@ struct thread; extern uintptr_t *__start_set_pcpu; extern uintptr_t *__stop_set_pcpu; +__asm__( #if defined(__arm__) -__asm__(".section set_pcpu, \"aw\", %progbits"); + ".section set_pcpu, \"aw\", %progbits\n" #else -__asm__(".section set_pcpu, \"aw\", @progbits"); + ".section set_pcpu, \"aw\", @progbits\n" #endif -__asm__(".previous"); + "\t.p2align " __XSTRING(CACHE_LINE_SHIFT) "\n" + "\t.previous"); /* * Array of dynamic pcpu base offsets. Indexed by id.