From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keith Owens Date: Mon, 30 Apr 2001 23:20:33 +0000 Subject: Re: [Linux-ia64] Cleanup include/asm-ia64/offsets.h - take 2 Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-ia64@vger.kernel.org On Mon, 30 Apr 2001 16:51:46 -0600, Don Dugger wrote: >The number of defines is not the issue. This issue is that with >the current system these defines are only defined once. If you >create two different definitions that must match then I can >guarantee that some time in the future the definitions will get >out of sync and we'll spend an inordinate amount of time tracking >down a glitch that never would have occurred if we'd kept with >the current scheme of generating `offsets.h'. Why is defining a field twice an issue? Both the C and asm definitions are defined as offsets of fields within a structure by name. Neither the structure name nor the field names are ever going to change, switch_stack is as critical a structure as you can get. Do you really expect this definition to change? #define IA64_SWITCH_STACK_B0_OFFSET (offsetof(struct switch_stack, b0)) Other architectures accept that they need different definitions for C and asm. In fact ix86 is even worse, it has these hard coded lines in arch/i386/kernel/entry.S and everybody lives with it. /* * these are offsets into the task-struct. */ state = 0 flags = 4 sigpending = 8 addr_limit = 12 exec_domain = 16 need_resched = 20 tsk_ptrace = 24 processor = 52 >If the only solution you can come up with is to create multiple >definitions then I'm with David, let's just keep the current scheme. The current scheme relies on users manually running make dep after any change that might affect the offsets of the fields generated by print-offsets. Make any change that affects the size of struct task_struct (including config changes), forget to run make dep and your kernel build is useless. Relying on *every* user to manually run make dep after any patch or config change that *might* affect offsets.h is unacceptable. You have a choice between a clean kbuild that requires 11 #defines that will never change or the existing method which relies on human intervention. The current scheme is an bomb waiting to go off.