diff --git a/include/paging.h b/include/paging.h index 1366babb..3880c1d5 100644 --- a/include/paging.h +++ b/include/paging.h @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: paging.h,v 1.12 2004-10-12 10:45:10 harekiet Exp $ */ +/* $Id: paging.h,v 1.13 2004-12-22 19:49:24 harekiet Exp $ */ #ifndef _PAGING_H_ #define _PAGING_H_ @@ -117,7 +117,8 @@ struct PagingBlock { Bitu used; Bit32u entries[PAGING_LINKS]; } links; - bool enabled; + Bit32u firstmb[LINK_START]; + bool enabled; }; extern PagingBlock paging; diff --git a/src/cpu/paging.cpp b/src/cpu/paging.cpp index 6198bafa..fa2ccfa3 100644 --- a/src/cpu/paging.cpp +++ b/src/cpu/paging.cpp @@ -31,7 +31,8 @@ #define LINK_TOTAL (64*1024) PagingBlock paging; -static Bit32u mapfirstmb[LINK_START]; + + Bitu PageHandler::readb(PhysPt addr) { E_Exit("No byte handler for read from %d",addr); @@ -191,7 +192,7 @@ public: phys_writed(entry_addr,entry.load); phys_page=entry.block.base; } else { - if (lin_page> 12; + if (page < LINK_START) + page = paging.firstmb[page]; + *write++=phys_readb(page*4096 + (pt & 4095)); + } +} + +static void DMA_BlockWrite(PhysPt pt,void * data,Bitu size) { + Bit8u * read=(Bit8u *) data; + for ( ; size ; size--, pt++) { + Bitu page = pt >> 12; + if (page < LINK_START) + page = paging.firstmb[page]; + phys_writeb(page*4096 + (pt & 4095), *read++); + } +} + static void DMA_WriteControllerReg(DmaController * cont,Bitu reg,Bitu val,Bitu len) { DmaChannel * chan;Bitu i; Bitu base=cont->chanbase; @@ -121,7 +142,8 @@ static Bitu DMA_ReadControllerReg(DmaController * cont,Bitu reg,Bitu len) { } return ret; default: - LOG_MSG("Trying to read undefined DMA Red %x",reg); + LOG_MSG("Trying to read undefined DMA port %x",reg); + break; } return 0xffffffff; } @@ -180,12 +202,12 @@ Bitu DmaChannel::Read(Bitu want, Bit8u * buffer) { again: Bitu left=(currcnt+1); if (want