1*f21271deSjruoho.\" $NetBSD: genassym.1,v 1.5 2010/04/13 09:01:10 jruoho Exp $ 25ecc953bSthorpej.\" 35ecc953bSthorpej.\" Copyright (c) 1997 Matthias Pfaller. 45ecc953bSthorpej.\" All rights reserved. 55ecc953bSthorpej.\" 65ecc953bSthorpej.\" Redistribution and use in source and binary forms, with or without 75ecc953bSthorpej.\" modification, are permitted provided that the following conditions 85ecc953bSthorpej.\" are met: 95ecc953bSthorpej.\" 1. Redistributions of source code must retain the above copyright 105ecc953bSthorpej.\" notice, this list of conditions and the following disclaimer. 115ecc953bSthorpej.\" 2. Redistributions in binary form must reproduce the above copyright 125ecc953bSthorpej.\" notice, this list of conditions and the following disclaimer in the 135ecc953bSthorpej.\" documentation and/or other materials provided with the distribution. 145ecc953bSthorpej.\" 155ecc953bSthorpej.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 165ecc953bSthorpej.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 175ecc953bSthorpej.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 185ecc953bSthorpej.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 195ecc953bSthorpej.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 205ecc953bSthorpej.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 215ecc953bSthorpej.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 225ecc953bSthorpej.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 235ecc953bSthorpej.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 245ecc953bSthorpej.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 255ecc953bSthorpej.\" 26*f21271deSjruoho.Dd April 13, 2010 2788d9def4Swiz.Dt GENASSYM 1 285ecc953bSthorpej.Os 295ecc953bSthorpej.Sh NAME 305ecc953bSthorpej.Nm genassym 315ecc953bSthorpej.Nd emit an assym.h file 325ecc953bSthorpej.Sh SYNOPSIS 335ecc953bSthorpej.Nm genassym 345ecc953bSthorpej.Op Fl c 355ecc953bSthorpej.Op Fl f 365ecc953bSthorpej.Ar C compiler invocation 375ecc953bSthorpej.Sh DESCRIPTION 385ecc953bSthorpej.Nm 395ecc953bSthorpejis a shell script normally used during the kernel build process to 405ecc953bSthorpejcreate an assym.h file. 415ecc953bSthorpejThis file defines a number of cpp constants derived from the configuration 425ecc953bSthorpejinformation 435ecc953bSthorpej.Nm 445ecc953bSthorpejreads from stdin. The generated file is used by kernel sources 455ecc953bSthorpejwritten in assembler to gain access to information (e.g. structure 465ecc953bSthorpejoffsets and sizes) normally only known to the C compiler. 47*f21271deSjruoho.Pp 485ecc953bSthorpejArguments to 495ecc953bSthorpej.Nm 505ecc953bSthorpejare usually of the form 515ecc953bSthorpej.Ar ${CC} ${CFLAGS} ${CPPFLAGS} 525ecc953bSthorpejwhere 535ecc953bSthorpej.Ar ${CC} 545ecc953bSthorpejis the C compiler used to compile the kernel, while 555ecc953bSthorpej.Ar ${CFLAGS} 565ecc953bSthorpejand 575ecc953bSthorpej.Ar ${CPPFLAGS} 585ecc953bSthorpejare flag arguments to the C compiler. The script creates a C source file 595ecc953bSthorpejfrom its input. Then the C compiler is called according to the script's 60*f21271deSjruohoarguments to compile this file. 61*f21271deSjruoho.Pp 62*f21271deSjruohoNormally 635ecc953bSthorpej.Nm 645ecc953bSthorpejinstructs the C compiler to create an assembler source from the constructed 655ecc953bSthorpejC source. The resulting file is then processed to extract the information 665ecc953bSthorpejneeded to create the assym.h file. The 675ecc953bSthorpej.Fl c 685ecc953bSthorpejflag instructs 695ecc953bSthorpej.Nm 705ecc953bSthorpejto create slightly different code, generate an executable from this code 715ecc953bSthorpejand run it. In both cases the assym.h file is written to stdout. 725ecc953bSthorpejThe 735ecc953bSthorpej.Fl f 745ecc953bSthorpejflag instructs 755ecc953bSthorpej.Nm 765ecc953bSthorpejto create forth code. 775ecc953bSthorpej.Sh DIAGNOSTICS 785ecc953bSthorpejEither self-explanatory, or generated by one of the programs 795ecc953bSthorpejcalled from the script. 805ecc953bSthorpej.Sh SEE ALSO 815ecc953bSthorpej.Xr genassym.cf 5 825ecc953bSthorpej.Sh HISTORY 835ecc953bSthorpejThe 845ecc953bSthorpej.Nm 855ecc953bSthorpejcommand appeared in 865ecc953bSthorpej.Nx 1.3 87*f21271deSjruohoas 88*f21271deSjruoho.Dq genassym.sh 89*f21271deSjruohoin 9070d95a4dSrpaulo.Pa /usr/src/sys/kern . 915ecc953bSthorpejIt became a userland utility in 925ecc953bSthorpej.Nx 4.0 . 93