From: Wolfgang Denk Date: Tue, 26 Oct 2010 21:04:58 +0200 Subject: [U-Boot] [PATCH 2/3 v2] include/asm-offsets.h: automatically generate assembler constants In-Reply-To: <1288102798-5475-1-git-send-email-wd@denx.de> References: <1288101601-24871-3-git-send-email-wd@denx.de> <1288102798-5475-1-git-send-email-wd@denx.de> Message-ID: <20101026190458.1FB28152451@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de In message <1288102798-5475-1-git-send-email-wd@denx.de> you wrote: > A recurrent issue is that certain C level constructs like sizeof() or > offsetof() cannot be used in assembler files, which is inconvenient > when such constructs are used in the definition of macro names etc. > > To avoid duplication of such definitions (and thus another cause of > problems), we adapt the Linux way to automatically generate the > respective definitions from the respective C header files. > > In Linux, this is implemented in include/linux/kbuild.h, Kbuild, and > arch/*/kernel/asm-offsets.c; we adapt the code from the Linux v2.6.36 > kernel tree. > > We also copy the concept of the include/generated/ directory which can > be used to hold other automatically generated files as well. > > We start with an architecture-independent lib/asm-offsets.c which > generates include/generated/generic-asm-offsets.h (included by > include/asm-offsets.h, which is what will be referred to in the actual > source code). Later this may be extended by architecture-specific > arch/*/lib/asm-offsets.c files that will generate a > include/generated/asm-offsets.h. > > Signed-off-by: Wolfgang Denk > --- > v2: fix typo > add SoB line Aplied. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de e-credibility: the non-guaranteeable likelihood that the electronic data you're seeing is genuine rather than somebody's made-up crap. - Karl Lehenbauer