20#include "Iso9660File.h"
21#include "pedigree/kernel/machine/Disk.h"
22#include "pedigree/kernel/processor/types.h"
23#include "pedigree/kernel/syscallError.h"
24#include "pedigree/kernel/utilities/utility.h"
28 if (!destination || location % pageSize || !m_pFs || !m_pFs->
m_pDisk)
30 const size_t size = getSize();
31 if (location >= size) {
32 ByteSet(
reinterpret_cast<void*
>(destination), 0, pageSize);
35 const size_t remaining = size - location;
36 const size_t amount = remaining < pageSize ? remaining : pageSize;
37 const uint64_t extent =
static_cast<uint64_t
>(LITTLE_TO_HOST32(m_Dir.ExtentLocation_LE)) * 2048;
38 if (location > ~uint64_t(0) - extent ||
39 !m_pFs->
m_pDisk->
readInto(extent + location,
reinterpret_cast<void*
>(destination), amount))
41 ByteSet(
reinterpret_cast<void*
>(destination + amount), 0, pageSize - amount);
45bool Iso9660File::prepareWrite(uint64_t, uint64_t) {
46 SYSCALL_ERROR(ReadOnlyFilesystem);
51 SYSCALL_ERROR(ReadOnlyFilesystem);
60 const uint64_t diskLocation =
61 (
static_cast<uint64_t
>(LITTLE_TO_HOST32(m_Dir.ExtentLocation_LE)) * 2048) + location;
66 const uint64_t diskLocation =
67 (
static_cast<uint64_t
>(LITTLE_TO_HOST32(m_Dir.ExtentLocation_LE)) * 2048) + location;
virtual void unpin(uint64_t location)=0
virtual MUST_USE_RESULT bool readInto(uint64_t location, void *buffer, size_t length)
virtual MUST_USE_RESULT bool pin(uint64_t location)=0
Pins a cache page.
uintptr_t readBlock(uint64_t location) override
void unpinBlock(uint64_t location) override
bool pinBlock(uint64_t location) override
bool readPage(uint64_t location, uintptr_t destination) override
bool prepareSharedMapping(size_t offset, size_t length) override
static constexpr size_t getPageSize() noexcept