2022-08-10 11:12:36 +00:00
|
|
|
/***
|
|
|
|
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
|
|
|
|
File: ProcessSectionView.Unix.hpp
|
|
|
|
Date: 2022-08-10
|
|
|
|
Author: Reece
|
|
|
|
***/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace Aurora::Process
|
|
|
|
{
|
2022-12-16 00:41:01 +00:00
|
|
|
struct ProcessSectionView : IProcessSectionView, AuEnableSharedFromThis<ProcessSectionView>
|
2022-08-10 11:12:36 +00:00
|
|
|
{
|
2022-12-17 20:14:19 +00:00
|
|
|
AuUInt GetStart() override;
|
|
|
|
|
|
|
|
AuUInt GetEnd() override;
|
|
|
|
|
2022-08-10 11:12:36 +00:00
|
|
|
AuSPtr<IProcessSectionMapView> Allocate(AuUInt length) override;
|
|
|
|
|
|
|
|
AuSPtr<IProcessSectionMapView> MapFileByPath(const AuString &str,
|
|
|
|
AuUInt64 offset,
|
|
|
|
AuUInt length,
|
|
|
|
AuFS::EFileOpenMode mode,
|
|
|
|
AuFS::EFileAdvisoryLockLevel sectionLock) override;
|
|
|
|
|
2023-08-11 15:51:42 +00:00
|
|
|
AuSPtr<IProcessSectionMapView> MapFileByObject(const AuSPtr<IO::IIOHandle> &pIOHandle,
|
2022-08-10 11:12:36 +00:00
|
|
|
AuUInt64 offset,
|
|
|
|
AuUInt length,
|
|
|
|
Aurora::IO::FS::EFileOpenMode mode,
|
|
|
|
AuFS::EFileAdvisoryLockLevel processLockLevel) override;
|
|
|
|
|
|
|
|
AuSPtr<IProcessSectionMapView> MapIPCMemory(const AuString &handle,
|
|
|
|
AuUInt64 offset,
|
2022-08-14 23:41:43 +00:00
|
|
|
AuUInt length,
|
2022-08-10 11:12:36 +00:00
|
|
|
AuFS::EFileOpenMode mode) override;
|
|
|
|
|
2022-12-16 00:41:01 +00:00
|
|
|
AuSPtr<IProcessSectionMapView> AllocateEx(AuUInt uLength, AuUInt uOffset) override;
|
|
|
|
|
|
|
|
AuSPtr<IProcessSectionMapView> AllocateEx2(AuUInt uLength, AuUInt uOffset, PageTable permissions) override;
|
|
|
|
|
|
|
|
AuSPtr<IProcessSectionMapView> MapFileByPathEx(AuUInt viewOffset,
|
|
|
|
const AuString &str,
|
|
|
|
AuUInt64 uOffset,
|
|
|
|
AuUInt uLength,
|
|
|
|
Aurora::IO::FS::EFileOpenMode mode,
|
|
|
|
Aurora::IO::FS::EFileAdvisoryLockLevel processLockLevel) override;
|
|
|
|
|
|
|
|
AuSPtr<IProcessSectionMapView> MapFileByObjectEx(AuUInt viewOffset,
|
2023-08-11 15:51:42 +00:00
|
|
|
const AuSPtr<IO::IIOHandle> &pIOHandle,
|
2022-12-16 00:41:01 +00:00
|
|
|
AuUInt64 uOffset,
|
|
|
|
AuUInt uLength,
|
|
|
|
Aurora::IO::FS::EFileOpenMode mode,
|
|
|
|
Aurora::IO::FS::EFileAdvisoryLockLevel processLockLevel) override;
|
|
|
|
|
|
|
|
AuSPtr<IProcessSectionMapView> MapIPCMemoryEx(AuUInt viewOffset,
|
|
|
|
const AuString &handle,
|
|
|
|
AuUInt64 uOffset,
|
|
|
|
AuUInt uLength,
|
|
|
|
Aurora::IO::FS::EFileOpenMode mode) override;
|
|
|
|
|
|
|
|
AuList<AuPair<AuUInt, AuUInt>> GetAllocations() override;
|
|
|
|
|
|
|
|
AuThreadPrimitives::SpinLock spinlock;
|
|
|
|
AuList<AuPair<AuUInt, AuUInt>> allocations;
|
|
|
|
void *MapAddress(AuUInt uOffset, AuUInt uLength,
|
|
|
|
AuUInt prot, AuUInt share, int fd, AuUInt offset);
|
|
|
|
|
2022-08-10 11:12:36 +00:00
|
|
|
};
|
|
|
|
}
|