xref: /titanic_51/usr/src/cmd/avs/errgen/errgen.help.txt (revision 1e49577a7fcde812700ded04431b49d67cc57d6d)
1# CDDL HEADER START
2#
3# The contents of this file are subject to the terms of the
4# Common Development and Distribution License (the "License").
5# You may not use this file except in compliance with the License.
6#
7# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
8# or http://www.opensolaris.org/os/licensing.
9# See the License for the specific language governing permissions
10# and limitations under the License.
11#
12# When distributing Covered Code, include this CDDL HEADER in each
13# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
14# If applicable, add the following below this CDDL HEADER, with the
15# fields enclosed by brackets "[]" replaced with your own identifying
16# information: Portions Copyright [yyyy] [name of copyright owner]
17#
18# CDDL HEADER END
19#
20# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
21# Use is subject to license terms.
22#
23/*
24 * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
25 * Use is subject to license terms.
26 */
27Usage: errgen [-c | -j | -e | -m | -t] <module_code>
28Options:
29    -c   Generate C header file
30    -j   Generate Java resource file
31    -e   Generate libspcs exception class body
32    -m   Generate error message text header file
33    -t   Genrate  libspcs JNI exception trinket string table
34    -x   Genrate  libspcs JNI exception trinket defines
35The module_code values are case insensitive:
36
37    SPCS	Storage Product Controller Software (general errors)
38    DSW		DataShadow Module
39    SV		Storage Volume Module
40    RDC		Remote Dual Copy Module
41    SDBC	Storage Device Block Cache Module
42    STE		SCSI Target Emulation Module
43    SDCTL	Storage Device Control Module
44    MC		Memory Channel Module
45    SIMCKD	CKD Simulation (SIMCKD) Module
46
47The format of the resource file is as follows:
48
49<message_key> = <message text>
50
51The message_key will become the #define or static final name of the message
52definition with a module error prefix. The message_text will become a
53inline comment depending on usage
54
55EXAMPLE resource input file. NOTE that only the %s format spec is supported
56for supplying supplemental data for ioctl status. If a line ends with "@@" it
57it indicates that a byte address and length will be supplied with the status
58code to provide arbitrary data for shipment to userspace (a "bytestream").
59Bytestreams are intended for asynchronous status output from coresw and are
60not supported for ioctl status.
61
62NOMINOR = No more minor numbers available
63ARRBOUNDS = Array bounds check exceeded %s size limit
64INTERNALDUMP = Internal state dump @@
65
66EXAMPLE C header file generated with "errgen -c SV":
67
68#define SV_ENOMINOR   0x00030001 /* No more minor numbers available */
69#define SV_EARRBOUNDS 0x01030002 /*Array bounds over %s size limit */
70#define SV_EINTERNALDUMP 0x09030003 /* Internal state dump */
71
72EXAMPLE Java resource file generated by "errgen -j SV":
73
74`SV_ENOMINOR` =  No more minor numbers available
75`SV_EARRBOUNDS` = Array bounds check exceeded {0} size limit
76`SV_EINTERNALDUMP` = Internal state dump
77
78EXAMPLE libspcs exception class body generated by "errgen -e SV":
79
80    /**
81     * No more minor numbers available
82    **/
83    public static final String SV_ENOMINOR = `SV_ENOMINOR`;
84
85    /**
86     * Array bounds check exceeded %s size limit
87    **/
88    public static final String SV_EARRBOUND = `SV_EARRBOUND`;
89
90    /**
91     * Internal state dump
92    **/
93    public static final String SV_EINTERNALDUMP = `SV_EINTERNALDUMP`;
94
95EXAMPLE msg text data generated by "errgen -m SV":
96
97    static char *SPCS_L_NTOM_SV[]={
98	    "",
99	    "No more minor numbers available",
100	    "Array bounds check exceeded %s size limit",
101	    "Internal State dump",
102    };
103    #define SPCS_M_CNT_SV 3	/* total codes */
104
105EXAMPLE libspcs JNI exception "trinket" table generated by "errgen -t SV":
106
107    static char *SPCS_TRINKET_SV[]={
108	     "",
109	     "`SV_ENOMINOR`",
110	     "`SV_EARRBOUNDS`",
111	     "`SV_EINTERNALDUMP`",
112    }
113
114EXAMPLE libspcs JNI exception "trinket" defines generated by "errgen -x SV":
115
116#define T_SV_ENOMINOR   "`SV_ENOMINOR`"
117#define T_SV_EARRBOUNDS "`SV_EARRBOUNDS`"
118#define T_SV_EARRBOUNDS "`SV_EINTERNALDUMP`"
119