2022-08-10 11:12:36 +00:00
|
|
|
/***
|
|
|
|
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
|
2022-12-17 20:14:19 +00:00
|
|
|
File: AuProcessSectionFileMapView.Unix.hpp
|
2022-08-10 11:12:36 +00:00
|
|
|
Date: 2022-08-09
|
|
|
|
Author: Reece
|
|
|
|
***/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace Aurora::Process
|
|
|
|
{
|
|
|
|
struct ProcessSectionView;
|
|
|
|
|
|
|
|
struct ProcessSectionFileMapView : IProcessSectionMapView
|
|
|
|
{
|
|
|
|
ProcessSectionFileMapView(AuUInt uAddress, AuUInt uLength, bool bShouldUnmap, int optFd = -1);
|
|
|
|
virtual ~ProcessSectionFileMapView();
|
|
|
|
|
2023-04-17 14:55:51 +00:00
|
|
|
void Unmap() override;
|
2022-08-10 11:12:36 +00:00
|
|
|
|
2023-04-17 14:55:51 +00:00
|
|
|
bool Flush(AuUInt offset, AuUInt length) override;
|
2022-08-10 11:12:36 +00:00
|
|
|
|
|
|
|
AuUInt GetBaseAddress() override;
|
|
|
|
AuUInt GetAddress(AuUInt offset) override;
|
|
|
|
|
|
|
|
AuUInt8 *GetBasePointer() override;
|
|
|
|
AuUInt8 *GetPointer(AuUInt offset) override;
|
|
|
|
|
2022-12-16 00:41:01 +00:00
|
|
|
AuSPtr<IProcessSectionView> pSharedSectionHint {};
|
2023-04-17 14:55:51 +00:00
|
|
|
|
|
|
|
bool LockSwap() override;
|
|
|
|
bool UnlockSwap() override;
|
2022-12-16 00:41:01 +00:00
|
|
|
|
2022-08-10 11:12:36 +00:00
|
|
|
private:
|
|
|
|
AuUInt uAddress {};
|
|
|
|
AuUInt uLength_ {};
|
|
|
|
bool bShouldUnmap_ {};
|
|
|
|
int optFd_ {-1};
|
|
|
|
bool bIsDead_ {};
|
|
|
|
};
|
|
|
|
}
|