From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932640AbZHYXin (ORCPT ); Tue, 25 Aug 2009 19:38:43 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932508AbZHYXil (ORCPT ); Tue, 25 Aug 2009 19:38:41 -0400 Received: from ey-out-2122.google.com ([74.125.78.25]:9814 "EHLO ey-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932533AbZHYXij (ORCPT ); Tue, 25 Aug 2009 19:38:39 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=izlQXv2YPUWKsPz4BdeAfgUX6DRyfD/JnCutOD1nwLCJTfy7bB9+STv2cSZLbKBYKx dd4TEA+0J5FiUvEkwEvxZ0aGWZXZnqPUVG5EaesUY6javH5mCYgBMHO26yoUjpnJ42eJ 78i4GSh2OvITd36SMmqqj4Vb0mDY6XeLcaH6k= Date: Wed, 26 Aug 2009 01:38:35 +0200 From: Frederic Weisbecker To: Jason Baron , "H. Peter Anwin" , Thomas Gleixner , Ingo Molnar Cc: Mathieu Desnoyers , Steven Rostedt , linux-kernel@vger.kernel.org, x86@kernel.org, lethal@linux-sh.org, laijs@cn.fujitsu.com, peterz@infradead.org, jiayingz@google.com, mbligh@google.com, lizf@cn.fujitsu.com, jistone@redhat.com Subject: Re: [PATCH 2/4] Add NR_syscalls for x86_64 Message-ID: <20090825233833.GB9953@nowhere> References: <233dfaa6fadd5aa2fa7ac8511ed9ab98a5f2619c.1251146513.git.jbaron@redhat.com> <20090824221447.GA5124@nowhere> <20090825134005.GB2656@redhat.com> <20090825184734.GE2656@redhat.com> <20090825190415.GB8474@Krystal> <20090825205829.GG2656@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090825205829.GG2656@redhat.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 25, 2009 at 04:58:29PM -0400, Jason Baron wrote: > > Ugh! My eyes hurt! > > sorry :) > > > What you are doing here is to basically put back the hardcoded > > NR_syscalls rather that using the build infrastructure already in place. > > > > no. NR_syscalls is not hardcoded by this patch. Its defined in terms of > __NR_syscall_max which is dynamically generated by the kernel build. > > > If my memory serves me well, unistd_64.h generates __NR_syscall_max > > automatically by being included multiples times. Can we generalize this > > and make the information generated available in an automaticaly > > generated header instead ? It is saved in ams-offsets.h currently as > > "__NR_syscall_max". We could also save it somewhere else meant to be > > included by C code. > > > > Mathieu > > > > The request was to define NR_syscalls in unistd.h, since that is the > historical Linux location for it. Adding another automatically generated > header does not accomplish that. Even if I include that new file in > unistd.h, I'm still going to have a circular dependency, and require a > solution similar to what I've proposed. > > thanks, > > -Jason Hmm, yeah that's not easy to deal with. May be, to lower a bit the hacky impact of this patch, __NR_syscall_max should be at least replaced by NR_syscall in every x86-64 uses (also in asm-offsets.h), to standardize this variable name. Also, may be we could have an empty asm-offsets.h stub in the very beginning that can be filled later so that we could include it unconditionnaly from unistd_64.h ? It would be nice to have the opinion of an x86 maintainer about what to do.