dvfs_handler.cc (10249:6bbb7ae309ac) dvfs_handler.cc (10395:77b9f96786c1)
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();
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());
84 }
85 UpdateEvent::dvfsHandler = this;
86}
87
88DVFSHandler *DVFSHandler::UpdateEvent::dvfsHandler;
89
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
90bool
91DVFSHandler::validDomainID(DomainID domain_id) const
92{
93 assert(isEnabled());
94 // This is ensure that the domain id as requested by the software is
95 // availabe in the handler.
96 if (domains.find(domain_id) != domains.end())
97 return true;

--- 83 unchanged lines hidden (view full) ---

181 arrayParamOut(os, "domain_ids", domain_ids);
182 arrayParamOut(os, "perf_levels", perf_levels);
183 arrayParamOut(os, "whens", whens);
184}
185
186void
187DVFSHandler::unserialize(Checkpoint *cp, const std::string &section)
188{
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 &section)
202{
203 bool temp = enableHandler;
204
189 UNSERIALIZE_SCALAR(enableHandler);
190
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
191 // Reconstruct the map of domain IDs and their scheduled events
192 std::vector<DomainID> domain_ids;
193 std::vector<PerfLevel> perf_levels;
194 std::vector<Tick> whens;
195 arrayParamIn(cp, section, "domain_ids", domain_ids);
196 arrayParamIn(cp, section, "perf_levels", perf_levels);
197 arrayParamIn(cp, section, "whens", whens);
198

--- 18 unchanged lines hidden ---
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 ---