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