1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:48:11 +00:00

Kernel: Let's say that everything < 3GB is user virtual memory

Technically the bottom 2MB is still identity-mapped for the kernel and
not made available to userspace at all, but for simplicity's sake we
can just ignore that and make "address < 0xc0000000" the canonical
check for user/kernel.
This commit is contained in:
Andreas Kling 2020-01-19 08:58:07 +01:00
parent 5ce9382e98
commit 2cd212e5df
3 changed files with 3 additions and 3 deletions

View file

@ -62,7 +62,7 @@ Profile::Profile(const JsonArray& json)
continue;
u32 innermost_frame_address = frames_array.at(1).as_object().get("address").to_number<u32>();
sample.in_kernel = innermost_frame_address >= 0xc0000000 || innermost_frame_address < (8 * MB);
sample.in_kernel = innermost_frame_address >= 0xc0000000;
for (int i = frames_array.size() - 1; i >= 1; --i) {
auto& frame_value = frames_array.at(i);

View file

@ -118,7 +118,7 @@ GVariant ProfileModel::data(const GModelIndex& index, Role role) const
auto* node = static_cast<ProfileNode*>(index.internal_data());
if (role == Role::Icon) {
if (index.column() == Column::StackFrame) {
if (node->address() < (8 * MB) || node->address() >= 0xc0000000)
if (node->address() >= 0xc0000000)
return m_kernel_frame_icon;
return m_user_frame_icon;
}

View file

@ -212,5 +212,5 @@ void VMObject::for_each_region(Callback callback)
inline bool is_user_address(VirtualAddress vaddr)
{
return vaddr.get() >= (8 * MB) && vaddr.get() < 0xc0000000;
return vaddr.get() < 0xc0000000;
}