From e860d319c4e54ca061283fcd2342e4deb38c467d Mon Sep 17 00:00:00 2001 From: Brian Stegmiller Date: Mon, 22 Feb 2016 16:20:20 -0600 Subject: Support HB runtime data for adjunct partition Change-Id: I7249f2b195dd02a0ab5a88b53d63cc4a1663cf9d RTC: 138638 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/25373 Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Reviewed-by: Elizabeth K. Liner Reviewed-by: Brian J. Stegmiller Reviewed-by: Daniel M. Crowell --- src/usr/targeting/attrrp.C | 47 +++++++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 13 deletions(-) (limited to 'src/usr/targeting/attrrp.C') diff --git a/src/usr/targeting/attrrp.C b/src/usr/targeting/attrrp.C index 780de9568..86cd1b748 100755 --- a/src/usr/targeting/attrrp.C +++ b/src/usr/targeting/attrrp.C @@ -496,29 +496,50 @@ namespace TARGETING return Singleton::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); + uint64_t AttrRP::maxSize( ) + { // Find total size of the sections. uint64_t l_size = 0; - for(size_t i = 0; i < iv_sectionCount; ++i) + for( size_t i = 0; + i < Singleton::instance().iv_sectionCount; + ++i) { - l_size += ALIGN_PAGE(iv_sections[i].size); + l_size += ALIGN_PAGE(Singleton:: + instance().iv_sections[i].size); } - // Determine bottom of the address region. - io_addr = io_addr - l_size; - // Align to 64KB for Opal - io_addr = ALIGN_DOWN_X(io_addr,64*KILOBYTE); + return(l_size); + } // end maxSize - // Map in region. - void* region = mm_block_map(reinterpret_cast(io_addr), - l_size); + + void* AttrRP::_save(uint64_t& io_addr) + { + TRACDCOMP(g_trac_targeting, "AttrRP::save: top @ 0x%lx", io_addr); + + // Find total size of the sections. + uint64_t l_size = maxSize(); + + void* region = reinterpret_cast(io_addr); uint8_t* pointer = reinterpret_cast(region); + // For PHYP adjunct partition, use HDAT ptr as is + bool l_isPhyp = TARGETING::is_phyp_load(); + if (!l_isPhyp) + { + io_addr = ALIGN_PAGE_DOWN(io_addr); + // Determine bottom of the address region. + io_addr = io_addr - l_size; + // Align to 64KB for Opal + io_addr = ALIGN_DOWN_X(io_addr,64*KILOBYTE); + + // Map in region. + region = mm_block_map(reinterpret_cast(io_addr),l_size); + pointer = reinterpret_cast(region); + + } // end if NOT PHYP + // Copy content. for (size_t i = 0; i < iv_sectionCount; ++i) { -- cgit v1.2.1