From patchwork Sun Sep 27 21:25:08 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Abbott X-Patchwork-Id: 50349 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8RLPdBG016238 for ; Sun, 27 Sep 2009 21:25:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751421AbZI0VZa (ORCPT ); Sun, 27 Sep 2009 17:25:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752221AbZI0VZa (ORCPT ); Sun, 27 Sep 2009 17:25:30 -0400 Received: from BISCAYNE-ONE-STATION.MIT.EDU ([18.7.7.80]:54752 "EHLO biscayne-one-station.mit.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750955AbZI0VZ3 (ORCPT ); Sun, 27 Sep 2009 17:25:29 -0400 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by biscayne-one-station.mit.edu (8.13.6/8.9.2) with ESMTP id n8RLP9rO001857; Sun, 27 Sep 2009 17:25:09 -0400 (EDT) Received: from localhost (DR-WILY.MIT.EDU [18.181.0.233]) (authenticated bits=0) (User authenticated as tabbott@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id n8RLP8rP002594; Sun, 27 Sep 2009 17:25:08 -0400 (EDT) Date: Sun, 27 Sep 2009 17:25:08 -0400 (EDT) From: Tim Abbott X-X-Sender: tabbott@dr-wily.mit.edu To: Helge Deller cc: linux-parisc@vger.kernel.org, Kyle McMartin , Linux Kernel Mailing List , Sam Ravnborg Subject: Re: [PATCH v2 0/2] Linker script cleanup patches for parisc In-Reply-To: <4ABFD2D3.5050606@gmx.de> Message-ID: References: <1253306078-7066-1-git-send-email-tabbott@ksplice.com> <4ABFD2D3.5050606@gmx.de> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.42 X-Spam-Flag: NO X-Spam-Score: 0.00 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org On Sun, 27 Sep 2009, Helge Deller wrote: > Tim, thanks for your work! > > Sadly it broke the parisc build in two places: > a) THREAD_SIZE can't be used in the vmlinux.lds.S file > b) It generates linker errors like "local symbol 0: discarded in section > `.exit.text' from kernel/built-in.o". Sorry about that -- I should have tried harder to get someone to test this one, since parisc is one of the architectures for which I don't have a cross-compiler. > Attached patch below fixes both issues. Tested with 32- and 64-bit parisc > kernel. The .exit.text change looks fine. [...] > b/arch/parisc/kernel/asm-offsets.c > index 699cf8e..7e76f03 100644 > --- a/arch/parisc/kernel/asm-offsets.c > +++ b/arch/parisc/kernel/asm-offsets.c > @@ -287,6 +287,8 @@ int main(void) > DEFINE(ASM_PFN_PTE_SHIFT, PFN_PTE_SHIFT); > DEFINE(ASM_PT_INITIAL, PT_INITIAL); > BLANK(); > + DEFINE(ASM_THREAD_SIZE, THREAD_SIZE); > + BLANK(); > DEFINE(EXCDATA_IP, offsetof(struct exception_data, fault_ip)); > DEFINE(EXCDATA_SPACE, offsetof(struct exception_data, fault_space)); > DEFINE(EXCDATA_ADDR, offsetof(struct exception_data, fault_addr)); Rather than adding a new definition in asm-offsets.c, I think it'll be better to do something like the following to make the normal THREAD_SIZE definition available in the linker script and other assembly files: -Tim Abbott parisc: Make THREAD_SIZE available to assembly files and linker scripts. Signed-off-by: Tim Abbott --- arch/parisc/include/asm/thread_info.h | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/parisc/include/asm/thread_info.h b/arch/parisc/include/asm/thread_info.h index ac775a7..51bca20 100644 --- a/arch/parisc/include/asm/thread_info.h +++ b/arch/parisc/include/asm/thread_info.h @@ -32,6 +32,11 @@ struct thread_info { #define init_thread_info (init_thread_union.thread_info) #define init_stack (init_thread_union.stack) +/* how to get the thread information struct from C */ +#define current_thread_info() ((struct thread_info *)mfctl(30)) + +#endif /* !__ASSEMBLY */ + /* thread information allocation */ #define THREAD_SIZE_ORDER 2 @@ -40,11 +45,6 @@ struct thread_info { #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) #define THREAD_SHIFT (PAGE_SHIFT + THREAD_SIZE_ORDER) -/* how to get the thread information struct from C */ -#define current_thread_info() ((struct thread_info *)mfctl(30)) - -#endif /* !__ASSEMBLY */ - #define PREEMPT_ACTIVE_BIT 28 #define PREEMPT_ACTIVE (1 << PREEMPT_ACTIVE_BIT)