00001 /* 00002 Copyright (C) 2000-2003, Intel Corporation 00003 All rights reserved. 00004 00005 Redistribution and use in source and binary forms, with or without modification, 00006 are permitted provided that the following conditions are met: 00007 00008 Redistributions of source code must retain the above copyright notice, this list 00009 of conditions and the following disclaimer. 00010 00011 Redistributions in binary form must reproduce the above copyright notice, this list 00012 of conditions and the following disclaimer in the documentation and/or other materials 00013 provided with the distribution. 00014 00015 Neither the name of the owner nor the names of its contributors may be used to endorse or 00016 promote products derived from this software without specific prior written permission. 00017 00018 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 00019 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 00020 FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR 00021 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 00022 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 00023 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00024 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00025 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00026 */ 00027 00028 //-*-c++-*- 00029 //============================================================================= 00030 // 00031 // Module : ekapi_subset.cxx 00032 // $Date : $ 00033 // $Author: marcel $ 00034 // $Source: /proj/osprey/CVS/open64/osprey1.0/common/ipfec_targ_info/access/ekapi_subset.cxx,v $ 00035 // 00036 // Description: 00037 // ============ 00038 // access subset info from knobs file, and encapsulate KAPI 00039 // first layer subset info of access layer. 00040 //============================================================================= 00041 00042 #include <string.h> 00043 #include <stdio.h> 00044 #include <assert.h> 00045 #include <stdlib.h> 00046 00047 #include "ekapi_ia64.h" 00048 #include "ekapi_util.h" 00049 00050 char *EKAPI_Op2SubSet( void *pknobs, int index) 00051 { 00052 char *str_knob, *str_subset, *buf; 00053 00054 str_knob = KAPI_attribute4index( pknobs, "opcode", index); 00055 00056 //get the fourth field from whole attribute string str_knob. 00057 strtok( str_knob, "," ); 00058 strtok( NULL, "," ); 00059 strtok( NULL, "," ); 00060 buf = strtok( NULL, "," ); 00061 str_subset = strdup(StrTrim(buf)); 00062 free(str_knob); 00063 00064 return str_subset; 00065 } 00066 00067 int EKAPI_SubsetCount(void *pknobs) 00068 { 00069 return KAPI_EnumCardinality(pknobs, "ISA_SUBSET"); 00070 } 00071 00072 char *EKAPI_SubsetName4id(void *pknobs, int index) 00073 { 00074 return KAPI_EnumName(pknobs, index, "ISA_SUBSET"); 00075 }
1.5.6