📄 pm.c
字号:
return bankPtr;}/****************************************************************************REMARKS:Map a physical address to a linear address in the callers process.****************************************************************************/void * PMAPI PM_mapPhysicalAddr( ulong base, ulong limit, ibool isCached){ // TODO: Map a physical memory address to a linear address return NULL;}/****************************************************************************REMARKS:Free a physical address mapping allocated by PM_mapPhysicalAddr.****************************************************************************/void PMAPI PM_freePhysicalAddr( void *ptr, ulong limit){ // TODO: Free the physical address mapping}ulong PMAPI PM_getPhysicalAddr(void *p){ // TODO: This function should find the physical address of a linear // address. return 0xFFFFFFFFUL;}void PMAPI PM_sleep(ulong milliseconds){ Sleep(milliseconds);}int PMAPI PM_getCOMPort(int port){ // TODO: Re-code this to determine real values using the Plug and Play // manager for the OS. switch (port) { case 0: return 0x3F8; case 1: return 0x2F8; } return 0;}int PMAPI PM_getLPTPort(int port){ // TODO: Re-code this to determine real values using the Plug and Play // manager for the OS. switch (port) { case 0: return 0x3BC; case 1: return 0x378; case 2: return 0x278; } return 0;}/****************************************************************************REMARKS:Allocate a block of (unnamed) shared memory.****************************************************************************/void * PMAPI PM_mallocShared( long size){ return malloc(size);}/****************************************************************************REMARKS:Map the (unnamed) shared memory block into the process address space.****************************************************************************/int PMAPI PM_mapShared( void *ptr){ return 0;}/****************************************************************************REMARKS:Free a block of shared memory.****************************************************************************/void PMAPI PM_freeShared( void *ptr){ free(ptr);}/****************************************************************************REMARKS:Map a linear memory address to the calling process address space. Theaddress will have been allocated in another process using thePM_mapPhysicalAddr function.****************************************************************************/void * PMAPI PM_mapToProcess( void *base, ulong limit){ return base;}/****************************************************************************REMARKS:Map a real mode pointer to a protected mode pointer.****************************************************************************/void * PMAPI PM_mapRealPointer( uint r_seg, uint r_off){ /* Not used for RTTarget-32 */ return NULL;}/****************************************************************************REMARKS:Allocate a block of real mode memory****************************************************************************/void * PMAPI PM_allocRealSeg( uint size, uint *r_seg, uint *r_off){ /* Not used for RTTarget-32 */ return NULL;}/****************************************************************************REMARKS:Free a block of real mode memory.****************************************************************************/void PMAPI PM_freeRealSeg( void *mem){ /* Not used for RTTarget-32 */}/****************************************************************************REMARKS:Issue a real mode interrupt (parameters in DPMI compatible structure)****************************************************************************/void PMAPI DPMI_int86( int intno, DPMI_regs *regs){ /* Not used for RTTarget-32 */}/****************************************************************************REMARKS:Issue a real mode interrupt.****************************************************************************/int PMAPI PM_int86( int intno, RMREGS *in, RMREGS *out){ /* Not used for RTTarget-32 */ return 0;}/****************************************************************************REMARKS:Issue a real mode interrupt.****************************************************************************/int PMAPI PM_int86x( int intno, RMREGS *in, RMREGS *out, RMSREGS *sregs){ /* Not used for RTTarget-32 */ return 0;}/****************************************************************************REMARKS:Call a real mode far function.****************************************************************************/void PMAPI PM_callRealMode( uint seg, uint off, RMREGS *in, RMSREGS *sregs){ /* Not used for RTTarget-32 */}/****************************************************************************REMARKS:Return the amount of available memory.****************************************************************************/void PMAPI PM_availableMemory( ulong *physical, ulong *total){ // TODO: Figure out how to determine the available memory. Not entirely // critical so returning 0 is OK. *physical = *total = 0;}/****************************************************************************REMARKS:Allocate a block of locked, physical memory for DMA operations.****************************************************************************/void * PMAPI PM_allocLockedMem( uint size, ulong *physAddr){ // TODO: Allocate a block of locked, phsyically contigous memory for DMA return 0;}/****************************************************************************REMARKS:Free a block of locked physical memory.****************************************************************************/void PMAPI PM_freeLockedMem( void *p, uint size){ // TODO: Free a locked memory buffer}/****************************************************************************REMARKS:Call the VBE/Core software interrupt to change display banks.****************************************************************************/void PMAPI PM_setBankA( int bank){ /* Not used for RTTarget-32 */}/****************************************************************************REMARKS:Call the VBE/Core software interrupt to change display banks.****************************************************************************/void PMAPI PM_setBankAB( int bank){ /* Not used for RTTarget-32 */}/****************************************************************************REMARKS:Call the VBE/Core software interrupt to change display start address.****************************************************************************/void PMAPI PM_setCRTStart( int x, int y, int waitVRT){ /* Not used for RTTarget-32 */}/****************************************************************************REMARKS:Execute the POST on the secondary BIOS for a controller.****************************************************************************/ibool PMAPI PM_doBIOSPOST( ushort axVal, ulong BIOSPhysAddr, void *mappedBIOS){ /* Not used for RTTarget-32 */ return false;}PM_MODULE PMAPI PM_loadLibrary( const char *szDLLName){ // TODO: Implement this to load shared libraries! (void)szDLLName; return NULL;}void * PMAPI PM_getProcAddress( PM_MODULE hModule, const char *szProcName){ // TODO: Implement this! (void)hModule; (void)szProcName; return NULL;}void PMAPI PM_freeLibrary( PM_MODULE hModule){ // TODO: Implement this! (void)hModule;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -