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.
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.
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]
20 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
21 # Use is subject to license terms.
24 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
25 * Use is subject to license terms.
27 Usage: errgen [-c | -j | -e | -m | -t] <module_code>
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
35 The module_code values are case insensitive:
37 SPCS Storage Product Controller Software (general errors)
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
47 The format of the resource file is as follows:
49 <message_key> = <message text>
51 The message_key will become the #define or static final name of the message
52 definition with a module error prefix. The message_text will become a
53 inline comment depending on usage
55 EXAMPLE resource input file. NOTE that only the %s format spec is supported
56 for supplying supplemental data for ioctl status. If a line ends with "@@" it
57 it indicates that a byte address and length will be supplied with the status
58 code to provide arbitrary data for shipment to userspace (a "bytestream").
59 Bytestreams are intended for asynchronous status output from coresw and are
60 not supported for ioctl status.
62 NOMINOR = No more minor numbers available
63 ARRBOUNDS = Array bounds check exceeded %s size limit
64 INTERNALDUMP = Internal state dump @@
66 EXAMPLE C header file generated with "errgen -c SV":
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 */
72 EXAMPLE Java resource file generated by "errgen -j SV":
74 `SV_ENOMINOR` = No more minor numbers available
75 `SV_EARRBOUNDS` = Array bounds check exceeded {0} size limit
76 `SV_EINTERNALDUMP` = Internal state dump
78 EXAMPLE libspcs exception class body generated by "errgen -e SV":
81 * No more minor numbers available
83 public static final String SV_ENOMINOR = `SV_ENOMINOR`;
86 * Array bounds check exceeded %s size limit
88 public static final String SV_EARRBOUND = `SV_EARRBOUND`;
93 public static final String SV_EINTERNALDUMP = `SV_EINTERNALDUMP`;
95 EXAMPLE msg text data generated by "errgen -m SV":
97 static char *SPCS_L_NTOM_SV[]={
99 "No more minor numbers available",
100 "Array bounds check exceeded %s size limit",
101 "Internal State dump",
103 #define SPCS_M_CNT_SV 3 /* total codes */
105 EXAMPLE libspcs JNI exception "trinket" table generated by "errgen -t SV":
107 static char *SPCS_TRINKET_SV[]={
111 "`SV_EINTERNALDUMP`",
114 EXAMPLE libspcs JNI exception "trinket" defines generated by "errgen -x SV":
116 #define T_SV_ENOMINOR "`SV_ENOMINOR`"
117 #define T_SV_EARRBOUNDS "`SV_EARRBOUNDS`"
118 #define T_SV_EARRBOUNDS "`SV_EINTERNALDUMP`"