@@ -181,7 +181,7 @@ static INLINE void InitPageCheckPresence(PhysPt lin_addr,bool writing,X86PageEnt
181181 Bitu lin_page=lin_addr >> 12 ;
182182 Bitu d_index=lin_page >> 10 ;
183183 Bitu t_index=lin_page & 0x3ff ;
184- Bitu table_addr=(paging.base .page <<12 )+( d_index<< 2 ) ;
184+ Bitu table_addr=(paging.base .page <<12 )+d_index* 4 ;
185185 table.load =phys_readd (table_addr);
186186 if (!table.block .p ) {
187187 LOG (LOG_PAGING,LOG_NORMAL)(" NP Table" );
@@ -191,7 +191,7 @@ static INLINE void InitPageCheckPresence(PhysPt lin_addr,bool writing,X86PageEnt
191191 if (GCC_UNLIKELY (!table.block .p ))
192192 E_Exit (" Pagefault didn't correct table" );
193193 }
194- Bitu entry_addr=(table.block .base <<12 )+( t_index<< 2 ) ;
194+ Bitu entry_addr=(table.block .base <<12 )+t_index* 4 ;
195195 entry.load =phys_readd (entry_addr);
196196 if (!entry.block .p ) {
197197// LOG(LOG_PAGING,LOG_NORMAL)("NP Page");
@@ -207,15 +207,15 @@ static INLINE bool InitPageCheckPresence_CheckOnly(PhysPt lin_addr,bool writing,
207207 Bitu lin_page=lin_addr >> 12 ;
208208 Bitu d_index=lin_page >> 10 ;
209209 Bitu t_index=lin_page & 0x3ff ;
210- Bitu table_addr=(paging.base .page <<12 )+( d_index<< 2 ) ;
210+ Bitu table_addr=(paging.base .page <<12 )+d_index* 4 ;
211211 table.load =phys_readd (table_addr);
212212 if (!table.block .p ) {
213213 paging.cr2 =lin_addr;
214214 cpu.exception .which =EXCEPTION_PF;
215215 cpu.exception .error =(writing?0x02 :0x00 ) | (((cpu.cpl &cpu.mpl )==0 )?0x00 :0x04 );
216216 return false ;
217217 }
218- Bitu entry_addr=(table.block .base <<12 )+( t_index<< 2 ) ;
218+ Bitu entry_addr=(table.block .base <<12 )+t_index* 4 ;
219219 entry.load =phys_readd (entry_addr);
220220 if (!entry.block .p ) {
221221 paging.cr2 =lin_addr;
@@ -370,13 +370,13 @@ class InitPageHandler : public PageHandler {
370370 if (priv_check==3 ) {
371371 LOG (LOG_PAGING,LOG_NORMAL)(" Page access denied: cpl=%i, %x:%x:%x:%x" ,
372372 cpu.cpl ,entry.block .us ,table.block .us ,entry.block .wr ,table.block .wr );
373- PAGING_PageFault (lin_addr,(table.block .base <<12 )+(lin_page & 0x3ff )<< 2 ,0x05 | (writing?0x02 :0x00 ));
373+ PAGING_PageFault (lin_addr,(table.block .base <<12 )+(lin_page & 0x3ff )* 4 ,0x05 | (writing?0x02 :0x00 ));
374374 priv_check=0 ;
375375 }
376376
377377 if (!table.block .a ) {
378378 table.block .a =1 ; // set page table accessed
379- phys_writed ((paging.base .page <<12 )+(lin_page >> 10 )<< 2 ,table.load );
379+ phys_writed ((paging.base .page <<12 )+(lin_page >> 10 )* 4 ,table.load );
380380 }
381381 if ((!entry.block .a ) || (!entry.block .d )) {
382382 entry.block .a =1 ; // set page accessed
@@ -385,7 +385,7 @@ class InitPageHandler : public PageHandler {
385385 // page will be fully linked so we can't track later writes
386386 if (writing || (priv_check==0 )) entry.block .d =1 ; // mark page as dirty
387387
388- phys_writed ((table.block .base <<12 )+(lin_page & 0x3ff )<< 2 ,entry.load );
388+ phys_writed ((table.block .base <<12 )+(lin_page & 0x3ff )* 4 ,entry.load );
389389 }
390390
391391 phys_page=entry.block .base ;
@@ -455,11 +455,11 @@ class InitPageHandler : public PageHandler {
455455
456456 if (!table.block .a ) {
457457 table.block .a =1 ; // Set access
458- phys_writed ((paging.base .page <<12 )+(( lin_page >> 10 )<< 2 ) ,table.load );
458+ phys_writed ((paging.base .page <<12 )+(lin_page >> 10 )* 4 ,table.load );
459459 }
460460 if (!entry.block .a ) {
461461 entry.block .a =1 ; // Set access
462- phys_writed ((table.block .base <<12 )+(( lin_page & 0x3ff )<< 2 ) ,entry.load );
462+ phys_writed ((table.block .base <<12 )+(lin_page & 0x3ff )* 4 ,entry.load );
463463 }
464464 phys_page=entry.block .base ;
465465 // maybe use read-only page here if possible
@@ -533,16 +533,16 @@ class InitPageUserROHandler : public PageHandler {
533533
534534 LOG (LOG_PAGING,LOG_NORMAL)(" Page access denied: cpl=%i, %x:%x:%x:%x" ,
535535 cpu.cpl ,entry.block .us ,table.block .us ,entry.block .wr ,table.block .wr );
536- PAGING_PageFault (lin_addr,(table.block .base <<12 )+(( lin_page & 0x3ff )<< 2 ) ,0x07 );
536+ PAGING_PageFault (lin_addr,(table.block .base <<12 )+(lin_page & 0x3ff )* 4 ,0x07 );
537537
538538 if (!table.block .a ) {
539539 table.block .a =1 ; // Set access
540- phys_writed ((paging.base .page <<12 )+(( lin_page >> 10 )<< 2 ) ,table.load );
540+ phys_writed ((paging.base .page <<12 )+(lin_page >> 10 )* 4 ,table.load );
541541 }
542542 if ((!entry.block .a ) || (!entry.block .d )) {
543543 entry.block .a =1 ; // Set access
544544 entry.block .d =1 ; // Set dirty
545- phys_writed ((table.block .base <<12 )+(( lin_page & 0x3ff )<< 2 ) ,entry.load );
545+ phys_writed ((table.block .base <<12 )+(lin_page & 0x3ff )* 4 ,entry.load );
546546 }
547547 phys_page=entry.block .base ;
548548 PAGING_LinkPage (lin_page,phys_page);
@@ -588,11 +588,11 @@ class InitPageUserROHandler : public PageHandler {
588588
589589 if (!table.block .a ) {
590590 table.block .a =1 ; // Set access
591- phys_writed ((paging.base .page <<12 )+(( lin_page >> 10 )<< 2 ) ,table.load );
591+ phys_writed ((paging.base .page <<12 )+(lin_page >> 10 )* 4 ,table.load );
592592 }
593593 if (!entry.block .a ) {
594594 entry.block .a =1 ; // Set access
595- phys_writed ((table.block .base <<12 )+(( lin_page & 0x3ff )<< 2 ) ,entry.load );
595+ phys_writed ((table.block .base <<12 )+(lin_page & 0x3ff )* 4 ,entry.load );
596596 }
597597 phys_page=entry.block .base ;
598598 } else {
@@ -609,10 +609,10 @@ bool PAGING_MakePhysPage(Bitu & page) {
609609 Bitu d_index=page >> 10 ;
610610 Bitu t_index=page & 0x3ff ;
611611 X86PageEntry table;
612- table.load =phys_readd ((paging.base .page <<12 )+( d_index<< 2 ) );
612+ table.load =phys_readd ((paging.base .page <<12 )+d_index* 4 );
613613 if (!table.block .p ) return false ;
614614 X86PageEntry entry;
615- entry.load =phys_readd ((table.block .base <<12 )+( t_index<< 2 ) );
615+ entry.load =phys_readd ((table.block .base <<12 )+t_index* 4 );
616616 if (!entry.block .p ) return false ;
617617 page=entry.block .base ;
618618 } else {
0 commit comments