summaryrefslogtreecommitdiffstats
path: root/src/usr/targeting/attrrp.C
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2014-01-14 18:58:57 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-02-06 17:40:11 -0600
commit6454fc5ee6f30a98202f1595c458f32b26393f70 (patch)
tree1453ff26f498b46009e44baf5103ec365a2988ed /src/usr/targeting/attrrp.C
parent6155c62ab8eae064a0160bf8c042953637113d66 (diff)
downloadtalos-hostboot-6454fc5ee6f30a98202f1595c458f32b26393f70.tar.gz
talos-hostboot-6454fc5ee6f30a98202f1595c458f32b26393f70.zip
HBRT: Support full targeting in Sapphire.
Change-Id: Ib8119e3c11cfa1171b76f2260871d2de5e99d502 RTC: 87716 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/8145 Tested-by: Jenkins Server Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@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.C49
1 files changed, 42 insertions, 7 deletions
diff --git a/src/usr/targeting/attrrp.C b/src/usr/targeting/attrrp.C
index bb1f82eee..d51dcc422 100644
--- a/src/usr/targeting/attrrp.C
+++ b/src/usr/targeting/attrrp.C
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2011,2013 */
+/* COPYRIGHT International Business Machines Corp. 2011,2014 */
/* */
/* p1 */
/* */
@@ -51,12 +51,6 @@ using namespace ERRORLOG;
namespace TARGETING
{
- void AttrRP::init(errlHndl_t &io_taskRetErrl)
- {
- // Call startup on singleton instance.
- Singleton<AttrRP>::instance().startup(io_taskRetErrl);
- }
-
void* AttrRP::getBaseAddress(const NODE_ID i_nodeIdUnused)
{
return reinterpret_cast<void*>(VMM_VADDR_ATTR_RP);
@@ -478,4 +472,45 @@ namespace TARGETING
return l_errl;
}
+ void* AttrRP::save(uint64_t& io_addr)
+ {
+ // Call save on singleton instance.
+ return Singleton<AttrRP>::instance()._save(io_addr);
+ }
+
+ void* AttrRP::_save(uint64_t& io_addr)
+ {
+ TRACDCOMP(g_trac_targeting, "AttrRP::save: top @ 0x%lx", io_addr);
+ io_addr = ALIGN_PAGE_DOWN(io_addr);
+
+ // Find total size of the sections.
+ uint64_t l_size = 0;
+ for(size_t i = 0; i < iv_sectionCount; ++i)
+ {
+ l_size += ALIGN_PAGE(iv_sections[i].size);
+ }
+
+ // Determine bottom of the address region.
+ io_addr = io_addr - l_size;
+
+
+ // Map in region.
+ void* region = mm_block_map(reinterpret_cast<void*>(io_addr),
+ l_size);
+ uint8_t* pointer = reinterpret_cast<uint8_t*>(region);
+
+ // Copy content.
+ for (size_t i = 0; i < iv_sectionCount; ++i)
+ {
+ memcpy(pointer,
+ reinterpret_cast<void*>(iv_sections[i].vmmAddress),
+ iv_sections[i].size);
+
+ pointer = &pointer[ALIGN_PAGE(iv_sections[i].size)];
+ }
+
+ TRACFCOMP(g_trac_targeting, "AttrRP::save: bottom @ 0x%lx", io_addr);
+ return region;
+ }
+
};
OpenPOWER on IntegriCloud