1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 08:28:11 +00:00

Kernel: Rename LinearAddress => VirtualAddress.

This commit is contained in:
Andreas Kling 2019-06-07 12:56:50 +02:00
parent 0ed89440f1
commit e42c3b4fd7
33 changed files with 272 additions and 272 deletions

View file

@ -258,9 +258,9 @@ InodeMetadata FileDescription::metadata() const
return {};
}
KResultOr<Region*> FileDescription::mmap(Process& process, LinearAddress laddr, size_t offset, size_t size, int prot)
KResultOr<Region*> FileDescription::mmap(Process& process, VirtualAddress vaddr, size_t offset, size_t size, int prot)
{
return m_file->mmap(process, *this, laddr, offset, size, prot);
return m_file->mmap(process, *this, vaddr, offset, size, prot);
}
KResult FileDescription::truncate(off_t length)

View file

@ -8,7 +8,7 @@
#include <Kernel/FileSystem/Inode.h>
#include <Kernel/FileSystem/InodeMetadata.h>
#include <Kernel/FileSystem/VirtualFileSystem.h>
#include <Kernel/LinearAddress.h>
#include <Kernel/VirtualAddress.h>
#include <Kernel/Net/Socket.h>
class File;
@ -67,7 +67,7 @@ public:
Custody* custody() { return m_custody.ptr(); }
const Custody* custody() const { return m_custody.ptr(); }
KResultOr<Region*> mmap(Process&, LinearAddress, size_t offset, size_t, int prot);
KResultOr<Region*> mmap(Process&, VirtualAddress, size_t offset, size_t, int prot);
bool is_blocking() const { return m_is_blocking; }
void set_blocking(bool b) { m_is_blocking = b; }

View file

@ -23,12 +23,12 @@ ssize_t InodeFile::write(FileDescription& descriptor, const byte* data, ssize_t
return m_inode->write_bytes(descriptor.offset(), count, data, &descriptor);
}
KResultOr<Region*> InodeFile::mmap(Process& process, FileDescription& descriptor, LinearAddress preferred_laddr, size_t offset, size_t size, int prot)
KResultOr<Region*> InodeFile::mmap(Process& process, FileDescription& descriptor, VirtualAddress preferred_vaddr, size_t offset, size_t size, int prot)
{
ASSERT(offset == 0);
// FIXME: If PROT_EXEC, check that the underlying file system isn't mounted noexec.
InterruptDisabler disabler;
auto* region = process.allocate_file_backed_region(preferred_laddr, size, inode(), descriptor.absolute_path(), prot);
auto* region = process.allocate_file_backed_region(preferred_vaddr, size, inode(), descriptor.absolute_path(), prot);
if (!region)
return KResult(-ENOMEM);
return region;

View file

@ -21,7 +21,7 @@ public:
virtual ssize_t read(FileDescription&, byte*, ssize_t) override;
virtual ssize_t write(FileDescription&, const byte*, ssize_t) override;
virtual KResultOr<Region*> mmap(Process&, FileDescription&, LinearAddress preferred_laddr, size_t offset, size_t size, int prot) override;
virtual KResultOr<Region*> mmap(Process&, FileDescription&, VirtualAddress preferred_vaddr, size_t offset, size_t size, int prot) override;
virtual String absolute_path(const FileDescription&) const override;

View file

@ -227,8 +227,8 @@ ByteBuffer procfs$pid_vm(InodeIdentifier identifier)
if (region->is_writable())
flags_builder.append('W');
builder.appendf("%x -- %x %x %x % 4s %s\n",
region->laddr().get(),
region->laddr().offset(region->size() - 1).get(),
region->vaddr().get(),
region->vaddr().offset(region->size() - 1).get(),
region->size(),
region->amount_resident(),
flags_builder.to_string().characters(),
@ -263,8 +263,8 @@ ByteBuffer procfs$pid_vmo(InodeIdentifier identifier)
builder.appendf("BEGIN END SIZE NAME\n");
for (auto& region : process.regions()) {
builder.appendf("%x -- %x %x %s\n",
region->laddr().get(),
region->laddr().offset(region->size() - 1).get(),
region->vaddr().get(),
region->vaddr().offset(region->size() - 1).get(),
region->size(),
region->name().characters());
builder.appendf("VMO: %s \"%s\" @ %x(%u)\n",
@ -300,7 +300,7 @@ ByteBuffer procfs$pid_stack(InodeIdentifier identifier)
builder.appendf("Thread %d:\n", thread.tid());
Vector<RecognizedSymbol, 64> recognized_symbols;
recognized_symbols.append({ thread.tss().eip, ksymbolicate(thread.tss().eip) });
for (dword* stack_ptr = (dword*)thread.frame_ptr(); process.validate_read_from_kernel(LinearAddress((dword)stack_ptr)); stack_ptr = (dword*)*stack_ptr) {
for (dword* stack_ptr = (dword*)thread.frame_ptr(); process.validate_read_from_kernel(VirtualAddress((dword)stack_ptr)); stack_ptr = (dword*)*stack_ptr) {
dword retaddr = stack_ptr[1];
recognized_symbols.append({ retaddr, ksymbolicate(retaddr) });
}