1/* 2 * Copyright (c) 2013-2014 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 67 unchanged lines hidden (view full) --- 76 auto entry = std::make_pair(domain_id, d); 77 bool new_elem = domains.insert(entry).second; 78 fatal_if(!new_elem, "DVFS: Domain %s with ID %d does not have a "\ 79 "unique ID.\n", d->name(), domain_id); 80 81 // Create a dedicated event slot per known domain ID 82 UpdateEvent *event = &updatePerfLevelEvents[domain_id]; 83 event->domainIDToSet = d->domainID(); |
84 85 // Add domain ID to the list of domains 86 domainIDList.push_back(d->domainID()); |
87 } 88 UpdateEvent::dvfsHandler = this; 89} 90 91DVFSHandler *DVFSHandler::UpdateEvent::dvfsHandler; 92 |
93DVFSHandler::DomainID 94DVFSHandler::domainID(uint32_t index) const 95{ 96 fatal_if(index >= numDomains(), "DVFS: Requested index out of "\ 97 "bound, max value %d\n", (domainIDList.size() - 1)); 98 99 assert(domains.find(domainIDList[index]) != domains.end()); 100 101 return domainIDList[index]; 102} 103 |
104bool 105DVFSHandler::validDomainID(DomainID domain_id) const 106{ 107 assert(isEnabled()); 108 // This is ensure that the domain id as requested by the software is 109 // availabe in the handler. 110 if (domains.find(domain_id) != domains.end()) 111 return true; --- 83 unchanged lines hidden (view full) --- 195 arrayParamOut(os, "domain_ids", domain_ids); 196 arrayParamOut(os, "perf_levels", perf_levels); 197 arrayParamOut(os, "whens", whens); 198} 199 200void 201DVFSHandler::unserialize(Checkpoint *cp, const std::string §ion) 202{ |
203 bool temp = enableHandler; 204 |
205 UNSERIALIZE_SCALAR(enableHandler); 206 |
207 if(temp != enableHandler) { 208 warn("DVFS: Forcing enable handler status to unserialized value of %d", 209 enableHandler); 210 } 211 |
212 // Reconstruct the map of domain IDs and their scheduled events 213 std::vector<DomainID> domain_ids; 214 std::vector<PerfLevel> perf_levels; 215 std::vector<Tick> whens; 216 arrayParamIn(cp, section, "domain_ids", domain_ids); 217 arrayParamIn(cp, section, "perf_levels", perf_levels); 218 arrayParamIn(cp, section, "whens", whens); 219 --- 18 unchanged lines hidden --- |