// Allocate those pages so that I only ever need to update the mapping once when I create a new process or port.
// TODO: Not an emergency, but adapt in case we need multiple PML4Es. (*NOT* the case right now.)
- static_assert(sizeof(os::processes) > 1024 * 1024 * 1024, "Error: processes array too big.");
+ static_assert(sizeof(os::processes) <= 1024 * 1024 * 1024, "Error: processes array too big.");
{
const auto index = os::paging::calc_page_table_indices(&os::processes).pml4e;
PML4T.contents[index] = {.P = 1, .R_W = 1, .U_S = 0, .PWT = 0, .PCD = 0, .base_address = 0, .NX = 0};
std::uint64_t r15;
std::uint64_t rip;
incrementing_int64_map<port> ports;
- // char test[65536];
};
static_assert(0xFFFF'C000'0000'0000 + sizeof(incrementing_int64_map<process>) < 0xFFFF'FFFF'8000'0000);
}
T& get(std::int64_t index) {
os::assert(present(index), "Tried getting non-existant element of incrementing_int64_map.");
- return *reinterpret_cast<T*>(&elems[index].buffer[0]);
+ return *std::launder(reinterpret_cast<T*>(&elems[index].buffer[0]));
}
const T& get(std::int64_t index) const {
os::assert(present(index), "Tried getting non-existant element of incrementing_int64_map.");
- return *reinterpret_cast<T*>(&elems[index].buffer[0]);
+ return *std::launder(reinterpret_cast<T*>(&elems[index].buffer[0]));
}
private: