Skip to content

Commit

Permalink
Merge pull request #240 from sifive/l2pf-mc-maxout-fix
Browse files Browse the repository at this point in the history
Fix l2pf base address defines.
  • Loading branch information
bsousi5 committed Oct 5, 2020
2 parents 9a06281 + 6c1f2a2 commit 32de312
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions metal_header/sifive_l2pf0.c++
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,18 @@ void sifive_l2pf0::include_headers() {
}

void sifive_l2pf0::create_defines() {
uint32_t count = 0;
std::string l2pf_base = "{ ";
uint32_t count = 0, index = 0;
std::string l2pf_base = "{\\\n\t\t\t\t";

dtb.match(std::regex("cpu"), [&](node n) {
if (n.field_exists("sifive,l2pf")) {
node t = n.get_fields<node>("sifive,l2pf")[0];
l2pf_base += std::to_string(t.get_fields<uint32_t>("reg")[0]);
l2pf_base += "UL, ";
l2pf_base +=
platform_define_offset(t, std::to_string(index) + "_BASE_ADDRESS");
l2pf_base += ",\\\n\t\t\t\t";
index++;
} else {
l2pf_base += "0, ";
l2pf_base += "0UL,\\\n\t\t\t\t";
}
});
l2pf_base += "}";
Expand Down

0 comments on commit 32de312

Please sign in to comment.