2007-05-21 21:27:16 +02:00
|
|
|
/**
|
|
|
|
* =========================================================================
|
|
|
|
* File : mahaf.h
|
|
|
|
* Project : 0 A.D.
|
|
|
|
* Description : user-mode interface to Aken driver
|
|
|
|
* =========================================================================
|
|
|
|
*/
|
|
|
|
|
|
|
|
// license: GPL; see lib/license.txt
|
|
|
|
|
|
|
|
// Mahaf - ferryman in Egyptian mythology that wakes up Aken,
|
|
|
|
// and the interface to the Aken driver.
|
|
|
|
|
|
|
|
#ifndef INCLUDED_MAHAF
|
|
|
|
#define INCLUDED_MAHAF
|
|
|
|
|
2007-09-07 22:17:57 +02:00
|
|
|
/**
|
|
|
|
* @return whether mapping physical memory is known to be dangerous
|
|
|
|
* on this platform.
|
|
|
|
*
|
|
|
|
* callable before or after mahaf_Init.
|
|
|
|
*
|
|
|
|
* note: mahaf_MapPhysicalMemory will complain if it
|
|
|
|
* is called despite this function having returned true.
|
|
|
|
**/
|
|
|
|
extern bool mahaf_IsPhysicalMappingDangerous();
|
|
|
|
|
|
|
|
|
2007-05-26 17:34:10 +02:00
|
|
|
extern bool mahaf_Init();
|
|
|
|
extern void mahaf_Shutdown();
|
2007-05-21 21:27:16 +02:00
|
|
|
|
2007-05-26 17:34:10 +02:00
|
|
|
extern u8 mahaf_ReadPort8 (u16 port);
|
|
|
|
extern u16 mahaf_ReadPort16(u16 port);
|
|
|
|
extern u32 mahaf_ReadPort32(u16 port);
|
|
|
|
extern void mahaf_WritePort8 (u16 port, u8 value);
|
|
|
|
extern void mahaf_WritePort16(u16 port, u16 value);
|
|
|
|
extern void mahaf_WritePort32(u16 port, u32 value);
|
2007-05-21 21:27:16 +02:00
|
|
|
|
2007-06-13 01:29:27 +02:00
|
|
|
extern volatile void* mahaf_MapPhysicalMemory(uintptr_t physicalAddress, size_t numBytes);
|
|
|
|
extern void mahaf_UnmapPhysicalMemory(volatile void* virtualAddress);
|
2007-06-10 15:25:09 +02:00
|
|
|
|
2007-05-21 21:27:16 +02:00
|
|
|
#endif // INCLUDED_MAHAF
|