xref: /minix3/usr.bin/genassym/genassym.1 (revision 8c4cdbd3c5fbbe85c18a3f9ceb349570fc246d53)
1*8c4cdbd3SBen Gras.\"	$NetBSD: genassym.1,v 1.5 2010/04/13 09:01:10 jruoho Exp $
2*8c4cdbd3SBen Gras.\"
3*8c4cdbd3SBen Gras.\" Copyright (c) 1997 Matthias Pfaller.
4*8c4cdbd3SBen Gras.\" All rights reserved.
5*8c4cdbd3SBen Gras.\"
6*8c4cdbd3SBen Gras.\" Redistribution and use in source and binary forms, with or without
7*8c4cdbd3SBen Gras.\" modification, are permitted provided that the following conditions
8*8c4cdbd3SBen Gras.\" are met:
9*8c4cdbd3SBen Gras.\" 1. Redistributions of source code must retain the above copyright
10*8c4cdbd3SBen Gras.\"    notice, this list of conditions and the following disclaimer.
11*8c4cdbd3SBen Gras.\" 2. Redistributions in binary form must reproduce the above copyright
12*8c4cdbd3SBen Gras.\"    notice, this list of conditions and the following disclaimer in the
13*8c4cdbd3SBen Gras.\"    documentation and/or other materials provided with the distribution.
14*8c4cdbd3SBen Gras.\"
15*8c4cdbd3SBen Gras.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16*8c4cdbd3SBen Gras.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17*8c4cdbd3SBen Gras.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18*8c4cdbd3SBen Gras.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19*8c4cdbd3SBen Gras.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20*8c4cdbd3SBen Gras.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21*8c4cdbd3SBen Gras.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22*8c4cdbd3SBen Gras.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23*8c4cdbd3SBen Gras.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24*8c4cdbd3SBen Gras.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*8c4cdbd3SBen Gras.\"
26*8c4cdbd3SBen Gras.Dd April 13, 2010
27*8c4cdbd3SBen Gras.Dt GENASSYM 1
28*8c4cdbd3SBen Gras.Os
29*8c4cdbd3SBen Gras.Sh NAME
30*8c4cdbd3SBen Gras.Nm genassym
31*8c4cdbd3SBen Gras.Nd emit an assym.h file
32*8c4cdbd3SBen Gras.Sh SYNOPSIS
33*8c4cdbd3SBen Gras.Nm genassym
34*8c4cdbd3SBen Gras.Op Fl c
35*8c4cdbd3SBen Gras.Op Fl f
36*8c4cdbd3SBen Gras.Ar C compiler invocation
37*8c4cdbd3SBen Gras.Sh DESCRIPTION
38*8c4cdbd3SBen Gras.Nm
39*8c4cdbd3SBen Grasis a shell script normally used during the kernel build process to
40*8c4cdbd3SBen Grascreate an assym.h file.
41*8c4cdbd3SBen GrasThis file defines a number of cpp constants derived from the configuration
42*8c4cdbd3SBen Grasinformation
43*8c4cdbd3SBen Gras.Nm
44*8c4cdbd3SBen Grasreads from stdin. The generated file is used by kernel sources
45*8c4cdbd3SBen Graswritten in assembler to gain access to information (e.g. structure
46*8c4cdbd3SBen Grasoffsets and sizes) normally only known to the C compiler.
47*8c4cdbd3SBen Gras.Pp
48*8c4cdbd3SBen GrasArguments to
49*8c4cdbd3SBen Gras.Nm
50*8c4cdbd3SBen Grasare usually of the form
51*8c4cdbd3SBen Gras.Ar ${CC} ${CFLAGS} ${CPPFLAGS}
52*8c4cdbd3SBen Graswhere
53*8c4cdbd3SBen Gras.Ar ${CC}
54*8c4cdbd3SBen Grasis the C compiler used to compile the kernel, while
55*8c4cdbd3SBen Gras.Ar ${CFLAGS}
56*8c4cdbd3SBen Grasand
57*8c4cdbd3SBen Gras.Ar ${CPPFLAGS}
58*8c4cdbd3SBen Grasare flag arguments to the C compiler. The script creates a C source file
59*8c4cdbd3SBen Grasfrom its input. Then the C compiler is called according to the script's
60*8c4cdbd3SBen Grasarguments to compile this file.
61*8c4cdbd3SBen Gras.Pp
62*8c4cdbd3SBen GrasNormally
63*8c4cdbd3SBen Gras.Nm
64*8c4cdbd3SBen Grasinstructs the C compiler to create an assembler source from the constructed
65*8c4cdbd3SBen GrasC source. The resulting file is then processed to extract the information
66*8c4cdbd3SBen Grasneeded to create the assym.h file. The
67*8c4cdbd3SBen Gras.Fl c
68*8c4cdbd3SBen Grasflag instructs
69*8c4cdbd3SBen Gras.Nm
70*8c4cdbd3SBen Grasto create slightly different code, generate an executable from this code
71*8c4cdbd3SBen Grasand run it. In both cases the assym.h file is written to stdout.
72*8c4cdbd3SBen GrasThe
73*8c4cdbd3SBen Gras.Fl f
74*8c4cdbd3SBen Grasflag instructs
75*8c4cdbd3SBen Gras.Nm
76*8c4cdbd3SBen Grasto create forth code.
77*8c4cdbd3SBen Gras.Sh DIAGNOSTICS
78*8c4cdbd3SBen GrasEither self-explanatory, or generated by one of the programs
79*8c4cdbd3SBen Grascalled from the script.
80*8c4cdbd3SBen Gras.Sh SEE ALSO
81*8c4cdbd3SBen Gras.Xr genassym.cf 5
82*8c4cdbd3SBen Gras.Sh HISTORY
83*8c4cdbd3SBen GrasThe
84*8c4cdbd3SBen Gras.Nm
85*8c4cdbd3SBen Grascommand appeared in
86*8c4cdbd3SBen Gras.Nx 1.3
87*8c4cdbd3SBen Grasas
88*8c4cdbd3SBen Gras.Dq genassym.sh
89*8c4cdbd3SBen Grasin
90*8c4cdbd3SBen Gras.Pa /usr/src/sys/kern .
91*8c4cdbd3SBen GrasIt became a userland utility in
92*8c4cdbd3SBen Gras.Nx 4.0 .
93