diff options
author | Richard J. Knight <rjknight@us.ibm.com> | 2012-08-06 14:09:37 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-08-13 13:16:54 -0500 |
commit | 5023b07888935148844de78239f07d6fa371d9e8 (patch) | |
tree | b5295ced4bdf6ada2a778c196ec3c7bf75910df8 /src/usr/targeting/attrrp.C | |
parent | 11c8a7dc6e0ec3c31f081d1e30a04a6e7038f918 (diff) | |
download | talos-hostboot-5023b07888935148844de78239f07d6fa371d9e8.tar.gz talos-hostboot-5023b07888935148844de78239f07d6fa371d9e8.zip |
Implement attribute sync from hostboot to fsp
RTC: 41245
Change-Id: Icb7eac8cdcc6a9bc4d19bd2e307f352b835f2df9
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1485
Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com>
Tested-by: Jenkins Server
Reviewed-by: Richard J. Knight <rjknight@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/targeting/attrrp.C')
-rw-r--r-- | src/usr/targeting/attrrp.C | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/src/usr/targeting/attrrp.C b/src/usr/targeting/attrrp.C index 4e54d4f8a..1c5bbab7b 100644 --- a/src/usr/targeting/attrrp.C +++ b/src/usr/targeting/attrrp.C @@ -43,6 +43,7 @@ #include <targeting/attrrp.H> #include <targeting/common/trace.H> #include <initservice/initserviceif.H> +#include <util/align.H> using namespace INITSERVICE; using namespace ERRORLOG; @@ -495,4 +496,65 @@ namespace TARGETING return l_errl; } + void AttrRP::writeSectionData( + const std::vector<TARGETING::sectionRefData>& i_pages) + { + // $TODO RTC Story 46672 + assert(0); + } + + void AttrRP::readSectionData( + std::vector<TARGETING::sectionRefData>& o_pages, + const TARGETING::SECTION_TYPE i_sectionId) + { + sectionRefData sectionData = {0}; + uint16_t count = 0; + uint16_t pages = 0; + + // search for the section we need + for (size_t i = 0; i < iv_sectionCount; i++ ) + { + if ( iv_sections[i].type == i_sectionId ) + { + // found it.. + // now figure out how many pages - rounding up to the + // the next full page and dividing by the page size + pages = ALIGN_PAGE( iv_sections[i].size )/PAGESIZE; + + TRACFCOMP(g_trac_targeting, + "Reading Attribute Section: ID: %d, \ + address: 0x%lx size: 0x%lx pages: %d", + iv_sections[i].type, + iv_sections[i].vmmAddress, + iv_sections[i].size, + pages); + + // populate and push the structure for each page + while( count != pages ) + { + // duplicate the same section id in each structure + sectionData.sectionId = i_sectionId; + + // update the current page number + sectionData.pageNumber = count; + + // addjust the pointer out by page size * count each + // iteration + sectionData.dataPtr = + reinterpret_cast<uint8_t *> + (iv_sections[i].vmmAddress) + (count * PAGESIZE ); + + count++; + + // pushing the actual structure to the vector + o_pages.push_back( sectionData ); + + } + + break; + } + } + // $TODO what if we dont find it?? + } + }; |