From fdcb470b27bba6782bf6b6a9a60be3e54446f506 Mon Sep 17 00:00:00 2001 From: Matthew Barth Date: Thu, 1 Dec 2011 11:47:33 -0600 Subject: Complete virtual memory write path during shutdown sequence Change-Id: I93a6305b88539d8cf1b41cfc4cde713fd7c19494 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/522 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III --- src/usr/initservice/baseinitsvc/initservice.H | 47 ++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) (limited to 'src/usr/initservice/baseinitsvc/initservice.H') diff --git a/src/usr/initservice/baseinitsvc/initservice.H b/src/usr/initservice/baseinitsvc/initservice.H index a31d108c8..4d15ffeec 100644 --- a/src/usr/initservice/baseinitsvc/initservice.H +++ b/src/usr/initservice/baseinitsvc/initservice.H @@ -45,8 +45,8 @@ #include #include #include - #include +#include namespace INITSERVICE { @@ -181,6 +181,27 @@ public: errlHndl_t dispatchTask( const TaskInfo *i_ptask, TaskArgs *io_pargs ) const; + /** + * @brief Registry a block/range of vitual memory to be handled during a + * shutdown. + * + * @param[in] i_vaddr - Base virtual address + * @param[in] i_size - Size of virtual memory from base address + * @param[in] i_priority - Order to handle given block(0-Lowest Priority) + * + * @return Nothing + */ + void registerBlock(void* i_vaddr, uint64_t i_size, BlockPriority i_priority); + + /** + * @brief Perform necessary steps, such as FLUSHing, to registered blocks. + * + * @param[in] i_status - Shutdown status to be passed along on shutdown + * + * @return Nothing + */ + void doShutdown(uint64_t i_status); + protected: @@ -202,6 +223,30 @@ private: InitService(const InitService& i_right); InitService& operator=(const InitService& i_right); + /** + * @struct regBlock_t + * @brief Attributes stored for virtual memory ranges that must be handled + * during a shutdown. + */ + struct regBlock_t + { + //Base virtual address + void* vaddr; + //Size of virtual memory from base address + uint64_t size; + //Priority order in which to handle the given block + uint64_t priority; + + /** + * @brief Constructor to initialize a registered block object + */ + regBlock_t(void* i_vaddr, uint64_t i_size, uint64_t i_priority) : + vaddr(i_vaddr), size(i_size), priority(i_priority) {} + }; + + //Store a list of registered blocks + std::vector iv_regBlock; + }; // class InitService } // namespace INITSERVICE -- cgit v1.2.1