2015-03-13 17:57:51 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: GPLv2+ - See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS Virtual DOS Machine
|
2015-09-18 17:01:49 +00:00
|
|
|
* FILE: subsystems/mvdm/ntvdm/memory.h
|
2015-03-13 18:28:45 +00:00
|
|
|
* PURPOSE: Memory Management
|
2015-03-13 17:57:51 +00:00
|
|
|
* PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _MEMORY_H_
|
|
|
|
#define _MEMORY_H_
|
|
|
|
|
|
|
|
/* DEFINITIONS ****************************************************************/
|
|
|
|
|
|
|
|
#define TOTAL_PAGES (MAX_ADDRESS / PAGE_SIZE)
|
|
|
|
|
|
|
|
typedef VOID
|
2015-06-12 16:25:23 +00:00
|
|
|
(FASTCALL *PMEMORY_READ_HANDLER)
|
2015-03-13 17:57:51 +00:00
|
|
|
(
|
|
|
|
ULONG Address,
|
|
|
|
PVOID Buffer,
|
|
|
|
ULONG Size
|
|
|
|
);
|
|
|
|
|
|
|
|
typedef BOOLEAN
|
2015-06-12 16:25:23 +00:00
|
|
|
(FASTCALL *PMEMORY_WRITE_HANDLER)
|
2015-03-13 17:57:51 +00:00
|
|
|
(
|
|
|
|
ULONG Address,
|
|
|
|
PVOID Buffer,
|
|
|
|
ULONG Size
|
2015-06-15 23:43:16 +00:00
|
|
|
);
|
2015-03-13 17:57:51 +00:00
|
|
|
|
|
|
|
/* FUNCTIONS ******************************************************************/
|
|
|
|
|
|
|
|
BOOLEAN MemInitialize(VOID);
|
|
|
|
VOID MemCleanup(VOID);
|
2015-03-13 22:38:44 +00:00
|
|
|
VOID MemExceptionHandler(ULONG FaultAddress, BOOLEAN Writing);
|
2015-03-13 17:57:51 +00:00
|
|
|
|
|
|
|
VOID
|
2015-06-12 03:30:40 +00:00
|
|
|
FASTCALL
|
|
|
|
EmulatorReadMemory
|
2015-03-13 17:57:51 +00:00
|
|
|
(
|
2015-06-12 03:30:40 +00:00
|
|
|
PFAST486_STATE State,
|
2015-03-13 17:57:51 +00:00
|
|
|
ULONG Address,
|
|
|
|
PVOID Buffer,
|
|
|
|
ULONG Size
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
2015-06-12 03:30:40 +00:00
|
|
|
FASTCALL
|
|
|
|
EmulatorWriteMemory
|
2015-03-13 17:57:51 +00:00
|
|
|
(
|
2015-06-12 03:30:40 +00:00
|
|
|
PFAST486_STATE State,
|
2015-03-13 17:57:51 +00:00
|
|
|
ULONG Address,
|
|
|
|
PVOID Buffer,
|
|
|
|
ULONG Size
|
|
|
|
);
|
|
|
|
|
2015-08-26 00:37:50 +00:00
|
|
|
VOID
|
|
|
|
FASTCALL
|
|
|
|
EmulatorCopyMemory
|
|
|
|
(
|
|
|
|
PFAST486_STATE State,
|
|
|
|
ULONG DestAddress,
|
|
|
|
ULONG SrcAddress,
|
|
|
|
ULONG Size
|
|
|
|
);
|
|
|
|
|
2015-06-12 03:30:40 +00:00
|
|
|
VOID EmulatorSetA20(BOOLEAN Enabled);
|
|
|
|
BOOLEAN EmulatorGetA20(VOID);
|
|
|
|
|
2015-03-13 17:57:51 +00:00
|
|
|
BOOL
|
|
|
|
MemInstallFastMemoryHook
|
|
|
|
(
|
|
|
|
PVOID Address,
|
|
|
|
ULONG Size,
|
|
|
|
PMEMORY_READ_HANDLER ReadHandler,
|
|
|
|
PMEMORY_WRITE_HANDLER WriteHandler
|
|
|
|
);
|
|
|
|
|
|
|
|
BOOL
|
|
|
|
MemRemoveFastMemoryHook
|
|
|
|
(
|
|
|
|
PVOID Address,
|
|
|
|
ULONG Size
|
|
|
|
);
|
|
|
|
|
2015-05-09 23:48:09 +00:00
|
|
|
BOOLEAN
|
|
|
|
MemQueryMemoryZone
|
|
|
|
(
|
|
|
|
ULONG StartAddress,
|
|
|
|
PULONG Length,
|
|
|
|
PBOOLEAN Hooked
|
|
|
|
);
|
|
|
|
|
2015-10-03 21:47:46 +00:00
|
|
|
#endif /* _MEMORY_H_ */
|