From 84f49a31edbf1f4dbdca4397194a498c97d4244c Mon Sep 17 00:00:00 2001 From: Santosh Puranik Date: Mon, 12 Sep 2016 11:55:14 -0500 Subject: FAPI Plat Cleanup - II -- Changed names of some generated files -- Names in line with the ones use in EKB Change-Id: Id14e97e3b3a062246596eaed9e008f5dc3570d77 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/29495 Tested-by: Jenkins Server Reviewed-by: Sachin Gupta Tested-by: FSP CI Jenkins Reviewed-by: Shakeeb A. Pasha B K Reviewed-by: Santosh S. Puranik --- src/tools/scripts/ppeCreateAttrGetSetMacros.pl | 4 +- src/tools/scripts/ppeCreateIfAttrService.pl | 241 ---- src/tools/scripts/ppeParseAttrGetSetMacros.pl | 13 - src/tools/scripts/ppeParseAttributeInfo.pl | 14 +- src/tools/scripts/ppeSetFixed.pl | 17 +- src/tools/scripts/src/fapi2PlatAttributeService.H | 1417 --------------------- 6 files changed, 16 insertions(+), 1690 deletions(-) delete mode 100755 src/tools/scripts/ppeCreateIfAttrService.pl delete mode 100644 src/tools/scripts/src/fapi2PlatAttributeService.H (limited to 'src/tools/scripts') diff --git a/src/tools/scripts/ppeCreateAttrGetSetMacros.pl b/src/tools/scripts/ppeCreateAttrGetSetMacros.pl index 487d84d0..990a394a 100755 --- a/src/tools/scripts/ppeCreateAttrGetSetMacros.pl +++ b/src/tools/scripts/ppeCreateAttrGetSetMacros.pl @@ -55,8 +55,8 @@ my %targetMacros; -my $fapiAttributeIdsFile = "fapi2AttributeIds.H"; -my $fapiPlatAttributeServiceFile= "fapi2PlatAttributeService.H"; +my $fapiAttributeIdsFile = "attribute_ids.H"; +my $fapiPlatAttributeServiceFile= "plat_attribute_service.H"; my $includePath = "./"; diff --git a/src/tools/scripts/ppeCreateIfAttrService.pl b/src/tools/scripts/ppeCreateIfAttrService.pl deleted file mode 100755 index e27a05d1..00000000 --- a/src/tools/scripts/ppeCreateIfAttrService.pl +++ /dev/null @@ -1,241 +0,0 @@ -#!/usr/bin/perl -# IBM_PROLOG_BEGIN_TAG -# This is an automatically generated prolog. -# -# $Source: src/tools/scripts/ppeCreateIfAttrService.pl $ -# -# OpenPOWER sbe Project -# -# Contributors Listed Below - COPYRIGHT 2016 -# [+] International Business Machines Corp. -# -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -# implied. See the License for the specific language governing -# permissions and limitations under the License. -# -# IBM_PROLOG_END_TAG -# Purpose: This perl script will parse HWP Attribute XML files and -# initfile attr files and create the fapiGetInitFileAttr() function -# in a file called fapi2AttributeService.C - -use strict; - -#------------------------------------------------------------------------------ -# Print Command Line Help -#------------------------------------------------------------------------------ -my $numArgs = $#ARGV + 1; -if ($numArgs < 3) -{ - print ("Usage: fapi2CreateIfAttrService.pl \n"); - print (" [ ...]\n"); - print (" -a [ ...]\n"); - print (" This perl script will parse if-attr files (containing the\n"); - print (" attributes used by the initfile) and attribute XML files\n"); - print (" (containing all HWPF attributes) and create the\n"); - print (" fapiGetInitFileAttr() function in a file called\n"); - print (" fapiAttributeService.C. Only the attributes specified in\n"); - print (" the if-attr files are supported. If no if-attr files are\n"); - print (" specified then all attributes are supported\n"); - exit(1); -} - -#------------------------------------------------------------------------------ -# Specify perl modules to use -#------------------------------------------------------------------------------ -use XML::Simple; -my $xml = new XML::Simple (KeyAttr=>[]); - -# Uncomment to enable debug output -#use Data::Dumper; - -#------------------------------------------------------------------------------ -# Open output file for writing -#------------------------------------------------------------------------------ -my $asFile = $ARGV[0]; -$asFile .= "/"; -$asFile .= "fapi2AttributeService.C"; -open(ASFILE, ">", $asFile); - -#------------------------------------------------------------------------------ -# Print Start of file information to fapiAttributeService.C -#------------------------------------------------------------------------------ -print ASFILE "// fapi2AttributeService.C\n"; -print ASFILE "// This file is generated by perl script fapi2CreateIfAttrService.pl\n\n"; -print ASFILE "#include \n"; -print ASFILE "//#include \n"; -print ASFILE "//#include \n\n"; -print ASFILE "namespace fapi2\n"; -print ASFILE "{\n\n"; -print ASFILE "ReturnCode fapiGetInitFileAttr(const AttributeId i_id,\n"; -print ASFILE " const Target * i_pTarget,\n"; -print ASFILE " uint64_t & o_val,\n"; -print ASFILE " const uint32_t i_arrayIndex1,\n"; -print ASFILE " const uint32_t i_arrayIndex2,\n"; -print ASFILE " const uint32_t i_arrayIndex3,\n"; -print ASFILE " const uint32_t i_arrayIndex4)\n"; -print ASFILE "{\n"; -print ASFILE " ReturnCode l_rc;\n\n"; - -my $xmlFiles = 0; -my $attCount = 0; -my $numIfAttrFiles = 0; -my @attrIds; - -#------------------------------------------------------------------------------ -# Element names -#------------------------------------------------------------------------------ -my $attribute = 'attribute'; - -#------------------------------------------------------------------------------ -# For each argument -#------------------------------------------------------------------------------ -my $argfile = $ARGV[1]; -my $entries = $xml->XMLin($argfile, ForceArray => ['entry']); -foreach my $entr (@{$entries->{entry}}) { - - my $inname = $entr->{name}; - - # read XML file. The ForceArray option ensures that there is an array of - # elements even if there is only one such element in the file - - foreach my $argnum (2 .. $#ARGV) - { - my $infile = $ARGV[$argnum]; - - my $attributes = $xml->XMLin($infile, ForceArray => ['attribute']); - - # Uncomment to get debug output of all attributes - #print "\nFile: ", $infile, "\n", Dumper($attributes), "\n"; - - #-------------------------------------------------------------------------- - # For each Attribute - #-------------------------------------------------------------------------- - foreach my $attr (@{$attributes->{attribute}}) - { - - - - if($attr->{id} eq $inname) { - - #------------------------------------------------------------------ - # Check that the AttributeId exists - #------------------------------------------------------------------ - if (! exists $attr->{id}) - { - print ("fapiParseAttributeInfo.pl ERROR. Att 'id' missing\n"); - exit(1); - } - - - #------------------------------------------------------------------ - # Figure out the number of attribute array dimensions - #------------------------------------------------------------------ - my $numArrayDimensions = 0; - if ($attr->{array}) - { - # Remove leading whitespace - my $dimText = $attr->{array}; - $dimText =~ s/^\s+//; - - # Split on commas or whitespace - my @vals = split(/\s*,\s*|\s+/, $dimText); - - $numArrayDimensions=@vals; - } - - #------------------------------------------------------------------ - # Print the attribute get code to fapiAttributeService.C - #------------------------------------------------------------------ - if ($attCount > 0) - { - print ASFILE " else "; - } - else - { - print ASFILE " "; - } - $attCount++; - - print ASFILE "if (i_id == $attr->{id})\n"; - print ASFILE " {\n"; - print ASFILE " $attr->{id}_Type l_attr;\n"; - - if (exists $attr->{privileged}) - { - print ASFILE " l_rc = FAPI_ATTR_GET_PRIVILEGED($attr->{id}, i_pTarget, l_attr);\n"; - } - else - { - print ASFILE " l_rc = FAPI_ATTR_GET($attr->{id}, i_pTarget, l_attr);\n"; - } - print ASFILE " o_val = l_attr"; - - if ($numArrayDimensions >= 5) - { - print ("fapiParseAttributeInfo.pl ERROR. More than 4 array dimensions!!\n"); - exit(1); - } - else - { - for (my $i = 0; $i < $numArrayDimensions; $i++) - { - print ASFILE "[i_arrayIndex"; - print ASFILE $i+1; - print ASFILE "]"; - } - } - - print ASFILE ";\n"; - print ASFILE " }\n"; - - - - } - } - } - -} - -#------------------------------------------------------------------------------ -# Print End of file information to fapiAttributeService.C -#-------------------------------------------------------------------------- -if ($attCount > 0) -{ - print ASFILE " else\n"; -} -print ASFILE " {\n"; -print ASFILE " FAPI_ERR(\"fapiGetInitFileAttr: Unrecognized attr ID: 0x%x\", i_id);\n"; -print ASFILE " l_rc.setFapiError(FAPI_RC_INVALID_ATTR_GET);\n"; -print ASFILE " l_rc.addEIFfdc(0, &i_id, sizeof(i_id));\n"; -print ASFILE " }\n\n"; -print ASFILE " if (l_rc)\n"; -print ASFILE " {\n"; -print ASFILE " if (i_pTarget)\n"; -print ASFILE " {\n"; -print ASFILE " FAPI_ERR(\"fapiGetInitFileAttr: Error getting attr ID 0x%x from targType 0x%x\",\n"; -print ASFILE " i_id, i_pTarget->getType());\n"; -print ASFILE " }\n"; -print ASFILE " else\n"; -print ASFILE " {\n"; -print ASFILE " FAPI_ERR(\"fapiGetInitFileAttr: Error getting attr ID 0x%x from system target\",\n"; -print ASFILE " i_id);\n"; -print ASFILE " }\n"; -print ASFILE " }\n\n"; -print ASFILE " return l_rc;\n"; -print ASFILE "}\n\n"; -print ASFILE "}\n"; - - -#------------------------------------------------------------------------------ -# Close output file -#------------------------------------------------------------------------------ -close(ASFILE); diff --git a/src/tools/scripts/ppeParseAttrGetSetMacros.pl b/src/tools/scripts/ppeParseAttrGetSetMacros.pl index 3c8095ec..016d6db4 100644 --- a/src/tools/scripts/ppeParseAttrGetSetMacros.pl +++ b/src/tools/scripts/ppeParseAttrGetSetMacros.pl @@ -85,19 +85,6 @@ $pervFile .= "/"; $pervFile .= "proc_sbe_fixed_perv.H"; open(PEFILE, ">", $pervFile); - -#------------------------------------------------------------------------------ -# Print Start of file information to fapiAttributeService.C -#------------------------------------------------------------------------------ -#print ASFILE "// proc_sbe_func.H\n"; -#print ASFILE "// This file is generated by perl script fapi2ParseProcSbeFixed.pl\n\n"; -#print ASFILE "#ifndef __PROC_SBE_FIXED_H__\n"; -#print ASFILE "#define __PROC_SBE_FIXED_H__\n"; -#print ASFILE "#include \"p9_sbe.H\"\n"; -#print ASFILE "#include \"plat_target_parms.H\"\n"; -#print ASFILE "#include \"fapi2AttributeIds.H\"\n\n"; - - my $xmlFiles = 0; my $attCount = 0; my $numIfAttrFiles = 0; diff --git a/src/tools/scripts/ppeParseAttributeInfo.pl b/src/tools/scripts/ppeParseAttributeInfo.pl index 95873c29..a2568937 100755 --- a/src/tools/scripts/ppeParseAttributeInfo.pl +++ b/src/tools/scripts/ppeParseAttributeInfo.pl @@ -24,14 +24,14 @@ # # IBM_PROLOG_END_TAG # Purpose: This perl script will parse HWP Attribute XML files -# and add attribute information to a file called fapi2AttributeIds.H +# and add attribute information to a file called attribute_ids.H use strict; sub help { print ("Usage: ppeParseAttributeInfo.pl [ ...]\n"); print (" This perl script will parse attribute XML files and create the following files:\n"); - print (" - fapi2AttributeIds.H. Contains IDs, type, value enums and other information\n"); + print (" - attribute_ids.H. Contains IDs, type, value enums and other information\n"); print (" - fapi2ChipEcFeature.C. Contains a function to query chip EC features\n"); print (" - fapi2AttributePlatCheck.H. Contains compile time checks that all attributes are\n"); print (" handled by the platform\n"); @@ -94,12 +94,12 @@ $XML::Simple::PREFERRED_PARSER = 'XML::Parser'; #------------------------------------------------------------------------------ my $aiFile = $ARGV[0]; $aiFile .= "/"; -$aiFile .= "fapi2AttributeIds.H"; +$aiFile .= "attribute_ids.H"; open(AIFILE, ">", $aiFile); my $echFile = $ARGV[0]; $echFile .= "/"; -$echFile .= "fapi2ChipEcFeature.H"; +$echFile .= "fapi2_chip_ec_feature.H"; open(ECHFILE, ">", $echFile); my $acFile = $ARGV[0]; @@ -125,7 +125,7 @@ open(ETFILE, ">", $etFile); #------------------------------------------------------------------------------ # Print Start of file information to fapiAttributeIds.H #------------------------------------------------------------------------------ -print AIFILE "// fapi2AttributeIds.H\n"; +print AIFILE "// attribute_ids.H\n"; print AIFILE "// This file is generated by perl script fapiParseAttributeInfo.pl\n\n"; print AIFILE "#ifndef FAPI2ATTRIBUTEIDS_H_\n"; print AIFILE "#define FAPI2ATTRIBUTEIDS_H_\n\n"; @@ -146,8 +146,8 @@ print ECHFILE "// This file is generated by perl script parseAttributeInfo.pl\n" print ECHFILE "// It implements the fapi2_chip_ec_feature function\n\n"; print ECHFILE "#ifndef __FAPI2_CHIP_EC_FEATURE_H_\n"; print ECHFILE "#define __FAPI2_CHIP_EC_FEATURE_H_\n"; -print ECHFILE "#include \n"; -print ECHFILE "#include \n"; +print ECHFILE "#include \n"; +print ECHFILE "#include \n"; print ECHFILE "namespace fapi2\n"; print ECHFILE "{\n\n"; print ECHFILE "// create a unique type from an int ( or attribute id) \n"; diff --git a/src/tools/scripts/ppeSetFixed.pl b/src/tools/scripts/ppeSetFixed.pl index 52880258..a562469d 100755 --- a/src/tools/scripts/ppeSetFixed.pl +++ b/src/tools/scripts/ppeSetFixed.pl @@ -28,9 +28,6 @@ use strict; -my $attrpath = "../../importtemp/xml"; -my $sbedefaultpath = "../../../images"; - #------------------------------------------------------------------------------ # Print Command Line Help #------------------------------------------------------------------------------ @@ -45,13 +42,13 @@ if ($numArgs < 3) print ("./ppeSetFixed.pl \\\n" ); print (". \\\n" ); print (" ../../obj/seeprom_main.bin \\\n" ); - print ("$attrpath/p9_ppe_attributes.xml \\\n" ); - print ("$attrpath/attribute_info/perv_attributes.xml \\\n" ); - print ("$attrpath/attribute_info/proc_attributes.xml \\\n" ); - print ("$attrpath/attribute_info/ex_attributes.xml \\\n" ); - print ("$attrpath/attribute_info/eq_attributes.xml \\\n" ); - print ("$attrpath/attribute_info/core_attributes.xml \\ \n"); - print ("$attrpath/attribute_info/nest_attributes.xml \n"); + print ("p9_ppe_attributes.xml \\\n" ); + print ("perv_attributes.xml \\\n" ); + print ("proc_attributes.xml \\\n" ); + print ("ex_attributes.xml \\\n" ); + print ("eq_attributes.xml \\\n" ); + print ("core_attributes.xml \\ \n"); + print ("nest_attributes.xml \n"); exit(1); } diff --git a/src/tools/scripts/src/fapi2PlatAttributeService.H b/src/tools/scripts/src/fapi2PlatAttributeService.H deleted file mode 100644 index 69976a3e..00000000 --- a/src/tools/scripts/src/fapi2PlatAttributeService.H +++ /dev/null @@ -1,1417 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/tools/scripts/src/fapi2PlatAttributeService.H $ */ -/* */ -/* OpenPOWER sbe Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2015,2016 */ -/* [+] International Business Machines Corp. */ -/* */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ -/** - * @file fapiPlatAttributeService.H - * - * @brief Defines the PLAT attribute access macros and defines which macro - * handles each attribute. - * - */ - - -#ifndef FAPI2PLATATTRIBUTESERVICE_H_ -#define FAPI2PLATATTRIBUTESERVICE_H_ - -#include -#include -#include -#include -#include -#include -#include "proc_sbe_fixed.H" -#include "plat_target_parms.H" - -#define PLAT_GET_CHIP_EC_FEATURE_OVERRIDE(ID, PTARGET, VAL) \ - _getEcFeatureOverride(ID, PTARGET, VAL) - -/* INSERT NEW ATTRIBUTES HERE */ - - -/******************************************************************************/ -/* * Global macros * */ -/* These macros are called by the macros above to invoke the appropriate API. */ -/* These macros do not need to change when a new attribute is introduced. */ -/******************************************************************************/ - -/* global get uint8_t 1D array macro */ -#define PLAT_ATTR_GET_UINT8_1D_ARRAY(ID, PTARGET, VAL) \ - _getAttributeArrayShort(ID##_TargetTypes), ID> \ - (ID, PTARGET, VAL) - -/* global set uint8_t 1D array macro */ -#define PLAT_ATTR_SET_UINT8_1D_ARRAY(ID, PTARGET, VAL) \ - _setAttributeArrayShort(ID##_TargetTypes), ID> \ - (ID, PTARGET, VAL) - -/* global get uint8_t 2D array macro */ -#define PLAT_ATTR_GET_UINT8_2D_ARRAY(ID, PTARGET, VAL) \ - _getAttributeArrayShort(ID, PTARGET, VAL[0]) -/* global set uint8_t 2D array macro */ -#define PLAT_ATTR_SET_UINT8_2D_ARRAY(ID, PTARGET, VAL) \ - _setAttributeArrayShort(ID, PTARGET, VAL[0]) - -/* global get uint8_t 3D array macro */ -#define PLAT_ATTR_GET_UINT8_3D_ARRAY(ID, PTARGET, VAL) \ - _getAttributeArrayShort(ID, PTARGET, VAL[0][0]) -/* global set uint8_t 3D array macro */ -#define PLAT_ATTR_SET_UINT8_3D_ARRAY(ID, PTARGET, VAL) \ - _setAttributeArrayShort(ID, PTARGET, VAL[0][0]) - -/* global get uint8_t 4D array macro */ -#define PLAT_ATTR_GET_UINT8_4D_ARRAY(ID, PTARGET, VAL) \ - _getAttributeArrayShort(ID, PTARGET, VAL[0][0][0]) -/* global set uint8_t 4D array macro */ -#define PLAT_ATTR_SET_UINT8_4D_ARRAY(ID, PTARGET, VAL) \ - _setAttributeArrayShort(ID, PTARGET, VAL[0][0][0]) - -/* global get uint32_t 1D array macro */ -#define PLAT_ATTR_GET_UINT32_1D_ARRAY(ID, PTARGET, VAL) \ - _getAttributeArrayWord(ID, PTARGET, VAL) -/* global set uint32_t 1D array macro */ -#define PLAT_ATTR_SET_UINT32_1D_ARRAY(ID, PTARGET, VAL) \ - _setAttributeArrayWord(ID, PTARGET, VAL) - -/* global get uint32_t 2D array macro */ -#define PLAT_ATTR_GET_UINT32_2D_ARRAY(ID, PTARGET, VAL) \ - _getAttributeArrayWord(ID, PTARGET, VAL[0]) -/* global set uint32_t 2D array macro */ -#define PLAT_ATTR_SET_UINT32_2D_ARRAY(ID, PTARGET, VAL) \ - _setAttributeArrayWord(ID, PTARGET, VAL[0]) - -/* global get uint32_t 3D array macro */ -#define PLAT_ATTR_GET_UINT32_3D_ARRAY(ID, PTARGET, VAL) \ - _getAttributeArrayWord(ID, PTARGET, VAL[0][0]) -/* global set uint32_t 3D array macro */ -#define PLAT_ATTR_SET_UINT32_3D_ARRAY(ID, PTARGET, VAL) \ - _setAttributeArrayWord(ID, PTARGET, VAL[0][0]) - -/* global get uint32_t 4D array macro */ -#define PLAT_ATTR_GET_UINT32_4D_ARRAY(ID, PTARGET, VAL) \ - _getAttributeArrayWord(ID, PTARGET, VAL[0][0][0]) -/* global set uint32_t 4D array macro */ -#define PLAT_ATTR_SET_UINT32_4D_ARRAY(ID, PTARGET, VAL) \ - _setAttributeArrayWord(ID, PTARGET, VAL[0][0][0]) - - -/* global get uint64_t 1D array macro */ -#define PLAT_ATTR_GET_UINT64_1D_ARRAY(ID, PTARGET, VAL) \ - _getAttributeArrayDoubleWord(ID, PTARGET, VAL) -/* global set uint64_t 1D array macro */ -#define PLAT_ATTR_SET_UINT64_1D_ARRAY(ID, PTARGET, VAL) \ - _setAttributeArrayDoubleWord(ID, PTARGET, VAL) - -/* global get uint64_t 2D array macro */ -#define PLAT_ATTR_GET_UINT64_2D_ARRAY(ID, PTARGET, VAL) \ - _getAttributeArrayDoubleWord(ID, PTARGET, VAL[0]) -/* global set uint64_t 2D array macro */ -#define PLAT_ATTR_SET_UINT64_2D_ARRAY(ID, PTARGET, VAL) \ - _setAttributeArrayDoubleWord(ID, PTARGET, VAL[0]) - -/* global get uint64_t 3D array macro */ -#define PLAT_ATTR_GET_UINT64_3D_ARRAY(ID, PTARGET, VAL) \ - _getAttributeArrayDoubleWord(ID, PTARGET, VAL[0][0]) -/* global set uint64_t 3D array macro */ -#define PLAT_ATTR_SET_UINT64_3D_ARRAY(ID, PTARGET, VAL) \ - _setAttributeArrayDoubleWord(ID, PTARGET, VAL[0][0]) - -/* global get uint64_t 4D array macro */ -#define PLAT_ATTR_GET_UINT64_4D_ARRAY(ID, PTARGET, VAL) \ - _getAttributeArrayDoubleWord(ID, PTARGET, VAL[0][0][0]) -/* global set uint64_t 4D array macro */ -#define PLAT_ATTR_SET_UINT64_4D_ARRAY(ID, PTARGET, VAL) \ - _setAttributeArrayDoubleWord(ID, PTARGET, VAL[0][0][0]) - -/* global get int macro (uint8_t, 16, 32 and 64) */ -#define PLAT_ATTR_GET_GLOBAL_INT(ID, PTARGET, VAL) \ - _get(ID##_TargetTypes), ID> \ - (ID, PTARGET, VAL) - -/* global set int macro (uint8_t, 16, 32 and 64) */ -#define PLAT_ATTR_SET_GLOBAL_INT(ID, PTARGET, VAL) \ - _set(ID##_TargetTypes), ID> \ - (ID, PTARGET, VAL) - - -//here - -/******************************************************************************/ -// Get Override Macros -/******************************************************************************/ -/* global get override uint8_t 1D array macro */ -#define PLAT_ATTR_GET_OVERRIDE_UINT8_1D_ARRAY(ID, PTARGET, VAL) \ - _getAttributeOverrideArrayShort(ID, PTARGET, VAL) -/* global get override uint8_t 2D array macro */ -#define PLAT_ATTR_GET_OVERRIDE_UINT8_2D_ARRAY(ID, PTARGET, VAL) \ - _getAttributeOverrideArrayShort(ID, PTARGET, VAL[0]) -/* global get override uint8_t 3D array macro */ -#define PLAT_ATTR_GET_OVERRIDE_UINT8_3D_ARRAY(ID, PTARGET, VAL) \ - _getAttributeOverrideArrayShort(ID, PTARGET, VAL[0][0]) -/* global get override uint8_t 4D array macro */ -#define PLAT_ATTR_GET_OVERRIDE_UINT8_4D_ARRAY(ID, PTARGET, VAL) \ - _getAttributeOverrideArrayShort(ID, PTARGET, VAL[0][0][0]) - - -/* global get override uint32_t 1D array macro */ -#define PLAT_ATTR_GET_OVERRIDE_UINT32_1D_ARRAY(ID, PTARGET, VAL) \ - _getAttributeOverrideArrayWord(ID, PTARGET, VAL) -/* global get override uint32_t 2D array macro */ -#define PLAT_ATTR_GET_OVERRIDE_UINT32_2D_ARRAY(ID, PTARGET, VAL) \ - _getAttributeOverrideArrayWord(ID, PTARGET, VAL[0]) -/* global get override uint32_t 3D array macro */ -#define PLAT_ATTR_GET_OVERRIDE_UINT32_3D_ARRAY(ID, PTARGET, VAL) \ - _getAttributeOverrideArrayWord(ID, PTARGET, VAL[0][0]) -/* global get override uint32_t 4D array macro */ -#define PLAT_ATTR_GET_OVERRIDE_UINT32_4D_ARRAY(ID, PTARGET, VAL) \ - _getAttributeOverrideArrayWord(ID, PTARGET, VAL[0][0][0]) - - -/* global get override uint64_t 1D array macro */ -#define PLAT_ATTR_GET_OVERRIDE_UINT64_1D_ARRAY(ID, PTARGET, VAL) \ - _getAttributeOverrideArrayDoubleWord(ID, PTARGET, VAL) -/* global get override uint64_t 2D array macro */ -#define PLAT_ATTR_GET_OVERRIDE_UINT64_2D_ARRAY(ID, PTARGET, VAL) \ - _getAttributeOverrideArrayDoubleWord(ID, PTARGET, VAL[0]) -/* global get override uint64_t 3D array macro */ -#define PLAT_ATTR_GET_OVERRIDE_UINT64_3D_ARRAY(ID, PTARGET, VAL) \ - _getAttributeOverrideArrayDoubleWord(ID, PTARGET, VAL[0][0]) -/* global get override uint64_t 4D array macro */ -#define PLAT_ATTR_GET_OVERRIDE_UINT64_4D_ARRAY(ID, PTARGET, VAL) \ - _getAttributeOverrideArrayDoubleWord(ID, PTARGET, VAL[0][0][0]) - -/* global get override int macro (uint8_t, 32 and 64) */ -#define PLAT_ATTR_GET_OVERRIDE_GLOBAL_INT(ID, PTARGET, VAL) \ - _getOverride(ID, PTARGET, VAL) - -/******************************************************************************/ -// Get string -/******************************************************************************/ - -extern "C" -{ - extern fapi2attr::SystemAttributes_t G_system_attributes asm("G_system_attributes") __attribute__ ((section (".fixed"))); - extern fapi2attr::ProcChipAttributes_t G_proc_chip_attributes asm("G_proc_chip_attributes") __attribute__ ((section (".fixed"))); - extern fapi2attr::PervAttributes_t G_perv_attributes asm("G_perv_attributes") __attribute__ ((section (".fixed"))); - extern fapi2attr::CoreAttributes_t G_core_attributes asm("G_core_attributes") __attribute__ ((section (".fixed"))); - extern fapi2attr::EQAttributes_t G_eq_attributes asm("G_eq_attributes") __attribute__ ((section (".fixed"))); - extern fapi2attr::EXAttributes_t G_ex_attributes asm("G_ex_attributes") __attribute__ ((section (".fixed"))); - - extern fapi2attr::SystemAttributes_t* G_system_attributes_ptr; - extern fapi2attr::ProcChipAttributes_t* G_proc_chip_attributes_ptr; - extern fapi2attr::PervAttributes_t* G_perv_attributes_ptr; - extern fapi2attr::CoreAttributes_t* G_core_attributes_ptr; - extern fapi2attr::EQAttributes_t* G_eq_attributes_ptr; - extern fapi2attr::EXAttributes_t* G_ex_attributes_ptr; - -} - -namespace fapi2 -{ - - -// Parameters are done as pointers (vs references) to allow the attribute -// storage to be relocated -template -void __set( const Target& i_ptarget, TAttrStruct* object, const AttributeId attrid, const TValue& value ); - -template -void __get( const Target& i_ptarget, const TAttrStruct* object, const AttributeId attrid, TValue* value ); - - -/* INSERT NEW GETTER AND SETTER FUNCTIONS HERE */ - - - -//****************************************************************************** -// Get base template -//****************************************************************************** -template -ReturnCode _get(const AttributeId i_id, - const Target & i_pTarget, - T& o_value) -{ - return FAPI2_RC_SUCCESS; -} - -//****************************************************************************** -// Get uint8_t -//****************************************************************************** -template -ReturnCode _get(const AttributeId i_id, - const Target & i_pTarget, - uint8_t& o_value) -{ - static_assert(std::is_same::value, "Attribute type mismatch"); - - if(K & TARGET_TYPE_SYSTEM) - { - __get( i_pTarget, G_system_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_PROC_CHIP) - { - __get( i_pTarget, G_proc_chip_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_PERV) - { - __get( i_pTarget, G_perv_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_CORE) - { - __get( i_pTarget, G_core_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_EQ) - { - __get( i_pTarget, G_eq_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_EX) - { - __get( i_pTarget, G_ex_attributes_ptr, i_id, &o_value ); - } - - return FAPI2_RC_SUCCESS; -} - -//****************************************************************************** -// Get uint16_t -//****************************************************************************** -template -ReturnCode _get(const AttributeId i_id, - const Target & i_pTarget, - uint16_t& o_value) -{ - static_assert(std::is_same::value, "Attribute type mismatch"); - - if(K & TARGET_TYPE_SYSTEM) - { - __get( i_pTarget, G_system_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_PROC_CHIP) - { - __get( i_pTarget, G_proc_chip_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_PERV) - { - __get( i_pTarget, G_perv_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_CORE) - { - __get( i_pTarget, G_core_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_EQ) - { - __get( i_pTarget, G_eq_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_EX) - { - __get( i_pTarget, G_ex_attributes_ptr, i_id, &o_value ); - } - - return FAPI2_RC_SUCCESS; -} - - -//****************************************************************************** -// Get uint32_t -//****************************************************************************** -template -ReturnCode _get(const AttributeId i_id, - const Target & i_pTarget, - uint32_t& o_value) -{ - static_assert(std::is_same::value, "Attribute type mismatch"); - - if(K & TARGET_TYPE_SYSTEM) - { - __get( i_pTarget, G_system_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_PROC_CHIP) - { - __get( i_pTarget, G_proc_chip_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_PERV) - { - __get( i_pTarget, G_perv_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_CORE) - { - __get( i_pTarget, G_core_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_EQ) - { - __get( i_pTarget, G_eq_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_EX) - { - __get( i_pTarget, G_ex_attributes_ptr, i_id, &o_value ); - } - - return FAPI2_RC_SUCCESS; -} - - -//****************************************************************************** -// Get uint64_t -//****************************************************************************** -template -ReturnCode _get(const AttributeId i_id, - const Target & i_pTarget, - uint64_t& o_value) -{ - static_assert(std::is_same::value, "Attribute type mismatch"); - - if(K & TARGET_TYPE_SYSTEM) - { - __get( i_pTarget, G_system_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_PROC_CHIP) - { - __get( i_pTarget, G_proc_chip_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_PERV) - { - __get( i_pTarget, G_perv_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_CORE) - { - __get( i_pTarget, G_core_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_EQ) - { - __get( i_pTarget, G_eq_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_EX) - { - __get( i_pTarget, G_ex_attributes_ptr, i_id, &o_value ); - } - - return FAPI2_RC_SUCCESS; -} - - -//****************************************************************************** -// Get Override uint8_t -//****************************************************************************** -template -ReturnCode _getOverride(const AttributeId i_id, - const Target & i_pTarget, - uint8_t& o_value) -{ - static_assert(std::is_same::value, "Attribute type mismatch"); - - return FAPI2_RC_SUCCESS; -} - - -//****************************************************************************** -// Get Override uint16_t -//****************************************************************************** -template -ReturnCode _getOverride(const AttributeId i_id, - const Target & i_pTarget, - uint16_t& o_value) -{ - static_assert(std::is_same::value, "Attribute type mismatch"); - - return FAPI2_RC_SUCCESS; -} - - -//****************************************************************************** -// Get Override uint32_t -//****************************************************************************** -template -ReturnCode _getOverride(const AttributeId i_id, - const Target & i_pTarget, - uint32_t& o_value) -{ - static_assert(std::is_same::value, "Attribute type mismatch"); - - return FAPI2_RC_SUCCESS; -} - - -//****************************************************************************** -// Get Override uint64_t -//****************************************************************************** -template -ReturnCode _getOverride(const AttributeId i_id, - const Target & i_pTarget, - uint64_t& o_value) -{ - static_assert(std::is_same::value, "Attribute type mismatch"); - - return FAPI2_RC_SUCCESS; -} - - -//****************************************************************************** -// Get override EC Feature (uint8_t) -//****************************************************************************** -template -ReturnCode _getEcFeatureOverride(const AttributeId i_id, - const Target & i_pTarget, - uint8_t& o_value) -{ - static_assert(std::is_same::value, "Attribute type mismatch"); - - // The way this is implemented, we want to return a non-zero return code if we found an override. - // Return 0 if there was an error. - // This is how it's implemented: - // PLAT_GET_CHIP_EC_FEATURE_OVERRIDE(ID, PTARGET, VAL) ? fapi::FAPI_RC_SUCCESS : fapi::fapiQueryChipEcFeature(fapi::ID, PTARGET, VAL) - - return FAPI2_RC_SUCCESS; -} - - -//****************************************************************************** -// Get uint8_t array -//****************************************************************************** -template -ReturnCode _getAttributeArrayShort(const AttributeId i_id, - const Target & i_pTarget, - uint8_t * o_pValues) -{ -// fapi2::Attributeta o_data; -// fapi2::ReturnCode l_fapi_rc(FAPI2_RC_SUCCESS); -// uint32_t l_ecmd_rc = ECMD_SUCCESS; -// -// ecmdChipTarget l_ecmd_target; -// fapiTargetPointerToEcmdTarget(i_pTarget, l_ecmd_target); -// -// o_data.faValidMask = FAPI_ATTRIBUTE_TYPE_UINT8ARY; -// o_data.faUint8ary = o_pValues; -// -// l_ecmd_rc = fapi2GetAttribute(l_ecmd_target, i_id, o_data); -// if (l_ecmd_rc) -// { -// l_fapi_rc = (ReturnCodes) l_ecmd_rc; -// } -// return l_fapi_rc; - return FAPI2_RC_SUCCESS; -} - -//****************************************************************************** -// Set uint8_t array -//****************************************************************************** -template -ReturnCode _setAttributeArrayShort(const AttributeId i_id, - const Target & i_pTarget, - uint8_t * i_pValues) -{ - if(K & TARGET_TYPE_SYSTEM) - { - __set( i_pTarget, G_system_attributes_ptr, i_id, *i_pValues ); - } - - if(K & TARGET_TYPE_PROC_CHIP) - { - __set( i_pTarget, G_proc_chip_attributes_ptr, *i_pValues ); - } - - if(K & TARGET_TYPE_PERV) - { - __set( i_pTarget, G_perv_attributes_ptr, *i_pValues ); - } - - if(K & TARGET_TYPE_CORE) - { - __set( i_pTarget, G_core_attributes_ptr, *i_pValues ); - } - - if(K & TARGET_TYPE_EQ) - { - __set( i_pTarget, G_eq_attributes_ptr, *i_pValues ); - } - - if(K & TARGET_TYPE_EX) - { - __set( i_pTarget, G_ex_attributes_ptr, *i_pValues ); - } - - return FAPI2_RC_SUCCESS; -} - -//****************************************************************************** -// Get uint16_t array -//****************************************************************************** -template -ReturnCode _getAttributeArrayWord(const AttributeId i_id, - const Target & i_pTarget, - uint16_t * o_pValues) -{ - return FAPI2_RC_SUCCESS; -} - -//****************************************************************************** -// Set uint16_t array -//****************************************************************************** -template -ReturnCode _setAttributeArrayWord(const AttributeId i_id, - const Target & i_pTarget, - uint16_t * i_pValues) -{ - return FAPI2_RC_SUCCESS; -} - -//****************************************************************************** -// Get uint32_t array -//****************************************************************************** -template -ReturnCode _getAttributeArrayWord(const AttributeId i_id, - const Target & i_pTarget, - uint32_t * o_pValues) -{ - return FAPI2_RC_SUCCESS; -} - -//****************************************************************************** -// Set uint32_t array -//****************************************************************************** -template -ReturnCode _setAttributeArrayWord(const AttributeId i_id, - const Target & i_pTarget, - uint32_t * i_pValues) -{ - return FAPI2_RC_SUCCESS; -} - - -//****************************************************************************** -// Get uint64_t array -//****************************************************************************** -template -ReturnCode _getAttributeArrayDoubleWord(const AttributeId i_id, - const Target & i_pTarget, - uint64_t * o_pValues) -{ - return FAPI2_RC_SUCCESS; -} - -//****************************************************************************** -// Set uint64_t array -//****************************************************************************** -template -ReturnCode _setAttributeArrayDoubleWord(const AttributeId i_id, - const Target & i_pTarget, - uint64_t * i_pValues) -{ - return FAPI2_RC_SUCCESS; -} - -//****************************************************************************** -// Get Override uint8_t array -//****************************************************************************** -template -ReturnCode _getAttributeOverrideArrayShort(const AttributeId i_id, - const Target & i_pTarget, - uint8_t * o_pValues) -{ - return FAPI2_RC_SUCCESS; -} - -//****************************************************************************** -// Get Override uint16_t array -//****************************************************************************** -template -ReturnCode _getAttributeOverrideArrayWord(const AttributeId i_id, - const Target & i_pTarget, - uint16_t * o_pValues) -{ - return FAPI2_RC_SUCCESS; -} - -//****************************************************************************** -// Get Override uint32_t array -//****************************************************************************** -template -ReturnCode _getAttributeOverrideArrayWord(const AttributeId i_id, - const Target & i_pTarget, - uint32_t * o_pValues) -{ - return FAPI2_RC_SUCCESS; -} - -//****************************************************************************** -// Get Override uint64_t array -//****************************************************************************** -template -ReturnCode _getAttributeOverrideArrayDoubleWord(const AttributeId i_id, - const Target & i_pTarget, - uint64_t * o_pValues) -{ - return FAPI2_RC_SUCCESS; -} - - -//****************************************************************************** -// Set base template -//****************************************************************************** -template -ReturnCode _set(const AttributeId i_id, - const Target & i_pTarget, - const T& i_value) -{ - return FAPI2_RC_SUCCESS; -} - - - -//****************************************************************************** -// Set uint8_t -//****************************************************************************** -template -ReturnCode _set(const AttributeId i_id, - const Target & i_pTarget, - const uint8_t& i_value) -{ - static_assert(std::is_same::value, "Attribute type mismatch"); // May need to remove - - if(K & TARGET_TYPE_SYSTEM) - { - __set( i_pTarget, G_system_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_PROC_CHIP) - { - __set( i_pTarget, G_proc_chip_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_PERV) - { - __set( i_pTarget, G_perv_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_CORE) - { - __set( i_pTarget, G_core_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_EQ) - { - __set( i_pTarget, G_eq_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_EX) - { - __set( i_pTarget, G_ex_attributes_ptr, i_id, i_value ); - } - - return FAPI2_RC_SUCCESS; -} - - -//****************************************************************************** -// Set uint16_t -//****************************************************************************** -template -ReturnCode _set(const AttributeId i_id, - const Target & i_pTarget, - const uint16_t& i_value) -{ - static_assert(std::is_same::value, "Attribute type mismatch"); // May need to remove - - if(K & TARGET_TYPE_SYSTEM) - { - __set( i_pTarget, G_system_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_PROC_CHIP) - { - __set( i_pTarget, G_proc_chip_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_PERV) - { - __set( i_pTarget, G_perv_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_CORE) - { - __set( i_pTarget, G_core_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_EQ) - { - __set( i_pTarget, G_eq_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_EX) - { - __set( i_pTarget, G_ex_attributes_ptr, i_id, i_value ); - } - - return FAPI2_RC_SUCCESS; -} - -//****************************************************************************** -// Set uint32_t -//****************************************************************************** -template -ReturnCode _set(const AttributeId i_id, - const Target & i_pTarget, - const uint32_t& i_value) -{ - static_assert(std::is_same::value, "Attribute type mismatch"); // May need to remove - - if(K & TARGET_TYPE_SYSTEM) - { - __set( i_pTarget, G_system_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_PROC_CHIP) - { - __set( i_pTarget, G_proc_chip_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_PERV) - { - __set( i_pTarget, G_perv_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_CORE) - { - __set( i_pTarget, G_core_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_EQ) - { - __set( i_pTarget, G_eq_attributes_ptr, i_id,i_value ); - } - - if(K & TARGET_TYPE_EX) - { - __set( i_pTarget, G_ex_attributes_ptr, i_id, i_value ); - } - - return FAPI2_RC_SUCCESS; -} - - -//****************************************************************************** -// Set uint64_t -//****************************************************************************** - -template -ReturnCode _set(const AttributeId i_id, - const Target & i_pTarget, - const uint64_t & i_value) -{ - static_assert(std::is_same::value, "Attribute type mismatch"); // May need to remove - - if(K & TARGET_TYPE_SYSTEM) - { - __set( i_pTarget, G_system_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_PROC_CHIP) - { - __set( i_pTarget, G_proc_chip_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_PERV) - { - __set( i_pTarget, G_perv_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_CORE) - { - __set( i_pTarget, G_core_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_EQ) - { - __set( i_pTarget, G_eq_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_EX) - { - __set( i_pTarget, G_ex_attributes_ptr, i_id, i_value ); - } - - return FAPI2_RC_SUCCESS; -} - - -//****************************************************************************** -// Get int8_t -//****************************************************************************** -template -ReturnCode _get(const AttributeId i_id, - const Target & i_pTarget, - int8_t& o_value) -{ - static_assert(std::is_same::value, "Attribute type mismatch"); - - if(K & TARGET_TYPE_SYSTEM) - { - __get( i_pTarget, G_system_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_PROC_CHIP) - { - __get( i_pTarget, G_proc_chip_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_PERV) - { - __get( i_pTarget, G_perv_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_CORE) - { - __get( i_pTarget, G_core_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_EQ) - { - __get( i_pTarget, G_eq_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_EX) - { - __get( i_pTarget, G_ex_attributes_ptr, i_id, &o_value ); - } - - return FAPI2_RC_SUCCESS; -} - -//****************************************************************************** -// Get int16_t -//****************************************************************************** -template -ReturnCode _get(const AttributeId i_id, - const Target & i_pTarget, - int16_t& o_value) -{ - static_assert(std::is_same::value, "Attribute type mismatch"); - - if(K & TARGET_TYPE_SYSTEM) - { - __get( i_pTarget, G_system_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_PROC_CHIP) - { - __get( i_pTarget, G_proc_chip_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_PERV) - { - __get( i_pTarget, G_perv_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_CORE) - { - __get( i_pTarget, G_core_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_EQ) - { - __get( i_pTarget, G_eq_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_EX) - { - __get( i_pTarget, G_ex_attributes_ptr, i_id, &o_value ); - } - - return FAPI2_RC_SUCCESS; -} - - -//****************************************************************************** -// Get int32_t -//****************************************************************************** -template -ReturnCode _get(const AttributeId i_id, - const Target & i_pTarget, - int32_t& o_value) -{ - static_assert(std::is_same::value, "Attribute type mismatch"); - - if(K & TARGET_TYPE_SYSTEM) - { - __get( i_pTarget, G_system_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_PROC_CHIP) - { - __get( i_pTarget, G_proc_chip_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_PERV) - { - __get( i_pTarget, G_perv_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_CORE) - { - __get( i_pTarget, G_core_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_EQ) - { - __get( i_pTarget, G_eq_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_EX) - { - __get( i_pTarget, G_ex_attributes_ptr, i_id, &o_value ); - } - - return FAPI2_RC_SUCCESS; -} - - -//****************************************************************************** -// Get int64_t -//****************************************************************************** -template -ReturnCode _get(const AttributeId i_id, - const Target & i_pTarget, - int64_t& o_value) -{ - static_assert(std::is_same::value, "Attribute type mismatch"); - - if(K & TARGET_TYPE_SYSTEM) - { - __set( i_pTarget, G_system_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_PROC_CHIP) - { - __get( i_pTarget, G_proc_chip_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_PERV) - { - __get( i_pTarget, G_perv_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_CORE) - { - __get( i_pTarget, G_core_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_EQ) - { - __get( i_pTarget, G_eq_attributes_ptr, i_id, &o_value ); - } - - if(K & TARGET_TYPE_EX) - { - __get( i_pTarget, G_ex_attributes_ptr, i_id, &o_value ); - } - - return FAPI2_RC_SUCCESS; -} - - -//****************************************************************************** -// Get Override int8_t -//****************************************************************************** -template -ReturnCode _getOverride(const AttributeId i_id, - const Target & i_pTarget, - int8_t& o_value) -{ - static_assert(std::is_same::value, "Attribute type mismatch"); - - return FAPI2_RC_SUCCESS; -} - -//****************************************************************************** -// Get Override int16_t -//****************************************************************************** -template -ReturnCode _getOverride(const AttributeId i_id, - const Target & i_pTarget, - int16_t& o_value) -{ - static_assert(std::is_same::value, "Attribute type mismatch"); - - return FAPI2_RC_SUCCESS; -} - -//****************************************************************************** -// Get Override int32_t -//****************************************************************************** -template -ReturnCode _getOverride(const AttributeId i_id, - const Target & i_pTarget, - int32_t& o_value) -{ - static_assert(std::is_same::value, "Attribute type mismatch"); - - return FAPI2_RC_SUCCESS; -} - -//****************************************************************************** -// Get Override int64_t -//****************************************************************************** -template -ReturnCode _getOverride(const AttributeId i_id, - const Target & i_pTarget, - int64_t& o_value) -{ - static_assert(std::is_same::value, "Attribute type mismatch"); - - return FAPI2_RC_SUCCESS; -} - - -//****************************************************************************** -// Get int8_t array -//****************************************************************************** -template -ReturnCode _getAttributeArraySignedShort(const AttributeId i_id, - const Target & i_pTarget, - int8_t * o_pValues) -{ - return FAPI2_RC_SUCCESS; -} - - -//****************************************************************************** -// Set int8_t array -//****************************************************************************** -template -ReturnCode _setAttributeArraySignedShort(const AttributeId i_id, - const Target & i_pTarget, - int8_t * i_pValues) -{ - return FAPI2_RC_SUCCESS; -} - -//****************************************************************************** -// Get int16_t array -//****************************************************************************** -template -ReturnCode _getAttributeArraySignedWord(const AttributeId i_id, - const Target & i_pTarget, - int16_t * o_pValues) -{ - return FAPI2_RC_SUCCESS; -} - - -//****************************************************************************** -// Set int16_t array -//****************************************************************************** -template -ReturnCode _setAttributeArraySignedWord(const AttributeId i_id, - const Target & i_pTarget, - int16_t * i_pValues) -{ - return FAPI2_RC_SUCCESS; -} - -//****************************************************************************** -// Get int32_t array -//****************************************************************************** -template -ReturnCode _getAttributeArraySignedWord(const AttributeId i_id, - const Target & i_pTarget, - int32_t * o_pValues) -{ - return FAPI2_RC_SUCCESS; -} - - -//****************************************************************************** -// Set int32_t array -//****************************************************************************** -template -ReturnCode _setAttributeArraySignedWord(const AttributeId i_id, - const Target & i_pTarget, - int32_t * i_pValues) -{ - return FAPI2_RC_SUCCESS; -} - - -//****************************************************************************** -// Get int64_t array -//****************************************************************************** -template -ReturnCode _getAttributeArraySignedDoubleWord(const AttributeId i_id, - const Target & i_pTarget, - int64_t * o_pValues) -{ - return FAPI2_RC_SUCCESS; -} - -//****************************************************************************** -// Set int64_t array -//****************************************************************************** -template -ReturnCode _setAttributeArraySignedDoubleWord(const AttributeId i_id, - const Target & i_pTarget, - int64_t * i_pValues) -{ - return FAPI2_RC_SUCCESS; -} - -//****************************************************************************** -// Get Override int8_t array -//****************************************************************************** -template -ReturnCode _getAttributeOverrideArraySignedShort(const AttributeId i_id, - const Target & i_pTarget, - int8_t * o_pValues) -{ - return FAPI2_RC_SUCCESS; -} - -//****************************************************************************** -// Get Override int16_t array -//****************************************************************************** -template -ReturnCode _getAttributeOverrideArraySignedWord(const AttributeId i_id, - const Target & i_pTarget, - int16_t * o_pValues) -{ - return FAPI2_RC_SUCCESS; -} - -//****************************************************************************** -// Get Override int32_t array -//****************************************************************************** -template -ReturnCode _getAttributeOverrideArraySignedWord(const AttributeId i_id, - const Target & i_pTarget, - int32_t * o_pValues) -{ - return FAPI2_RC_SUCCESS; -} - - -//****************************************************************************** -// Get Override int64_t array -//****************************************************************************** -template -ReturnCode _getAttributeOverrideArraySignedDoubleWord(const AttributeId i_id, - const Target & i_pTarget, - int64_t * o_pValues) -{ - return FAPI2_RC_SUCCESS; -} - - -//****************************************************************************** -// Set int8_t -//****************************************************************************** -template -ReturnCode _set(const AttributeId i_id, - const Target & i_pTarget, - const int8_t& i_value) -{ - static_assert(std::is_same::value, "Attribute type mismatch"); // May need to remove - - if(K & TARGET_TYPE_SYSTEM) - { - __set( i_pTarget, G_system_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_PROC_CHIP) - { - __set( i_pTarget, G_proc_chip_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_PERV) - { - __set( i_pTarget, G_perv_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_CORE) - { - __set( i_pTarget, G_core_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_EQ) - { - __set( i_pTarget, G_eq_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_EX) - { - __set( i_pTarget, G_ex_attributes_ptr, i_id, i_value ); - } - - return FAPI2_RC_SUCCESS; -} - -//****************************************************************************** -// Set int16_t -//****************************************************************************** -template -ReturnCode _set(const AttributeId i_id, - const Target & i_pTarget, - const int16_t& i_value) -{ - static_assert(std::is_same::value, "Attribute type mismatch"); // May need to remove - - if(K & TARGET_TYPE_SYSTEM) - { - __set( i_pTarget, G_system_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_PROC_CHIP) - { - __set( i_pTarget, G_proc_chip_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_PERV) - { - __set( i_pTarget, G_perv_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_CORE) - { - __set( i_pTarget, G_core_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_EQ) - { - __set( i_pTarget, G_eq_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_EX) - { - __set( i_pTarget, G_ex_attributes_ptr, i_id, i_value ); - } - - return FAPI2_RC_SUCCESS; -} - -//****************************************************************************** -// Set int32_t -//****************************************************************************** -template -ReturnCode _set(const AttributeId i_id, - const Target & i_pTarget, - const int32_t& i_value) -{ - static_assert(std::is_same::value, "Attribute type mismatch"); // May need to remove - - if(K & TARGET_TYPE_SYSTEM) - { - __set( i_pTarget, G_system_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_PROC_CHIP) - { - __set( i_pTarget, G_proc_chip_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_PERV) - { - __set( i_pTarget, G_perv_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_CORE) - { - __set( i_pTarget, G_core_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_EQ) - { - __set( i_pTarget, G_eq_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_EX) - { - __set( i_pTarget, G_ex_attributes_ptr, i_id, i_value ); - } - - return FAPI2_RC_SUCCESS; -} - - -//****************************************************************************** -// Set int64_t -//****************************************************************************** -template -ReturnCode _set(const AttributeId i_id, - const Target & i_pTarget, - const int64_t & i_value) -{ - static_assert(std::is_same::value, "Attribute type mismatch"); // May need to remove - - if(K & TARGET_TYPE_SYSTEM) - { - __set( i_pTarget, G_system_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_PROC_CHIP) - { - __set( i_pTarget, G_proc_chip_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_PERV) - { - __set( i_pTarget, G_perv_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_CORE) - { - __set( i_pTarget, G_core_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_EQ) - { - __set( i_pTarget, G_eq_attributes_ptr, i_id, i_value ); - } - - if(K & TARGET_TYPE_EX) - { - __set( i_pTarget, G_ex_attributes_ptr, i_id, i_value ); - } - - return FAPI2_RC_SUCCESS; -} - - -} // namespace fapi2 -#endif // FAPIPLATATTRIBUTESERVICE_H_ -- cgit v1.2.1