Add compiler testing for always_inline attribute
Add compiler testing for fastcall attribute Add the FASTCALL define to visual c Remove some overkill inline routines Make sure that all the inline routines in headers are static Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3355
This commit is contained in:
parent
5f6236ee35
commit
88caf1dc71
20 changed files with 182 additions and 147 deletions
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: paging.h,v 1.31 2008-01-05 21:04:43 c2woody Exp $ */
|
||||
/* $Id: paging.h,v 1.32 2009-04-25 16:25:03 harekiet Exp $ */
|
||||
|
||||
#ifndef DOSBOX_PAGING_H
|
||||
#define DOSBOX_PAGING_H
|
||||
|
@ -197,25 +197,25 @@ bool mem_unalignedwrited_checked(PhysPt address,Bit32u val);
|
|||
|
||||
#if defined(USE_FULL_TLB)
|
||||
|
||||
INLINE HostPt get_tlb_read(PhysPt address) {
|
||||
static INLINE HostPt get_tlb_read(PhysPt address) {
|
||||
return paging.tlb.read[address>>12];
|
||||
}
|
||||
INLINE HostPt get_tlb_write(PhysPt address) {
|
||||
static INLINE HostPt get_tlb_write(PhysPt address) {
|
||||
return paging.tlb.write[address>>12];
|
||||
}
|
||||
INLINE PageHandler* get_tlb_readhandler(PhysPt address) {
|
||||
static INLINE PageHandler* get_tlb_readhandler(PhysPt address) {
|
||||
return paging.tlb.readhandler[address>>12];
|
||||
}
|
||||
INLINE PageHandler* get_tlb_writehandler(PhysPt address) {
|
||||
static INLINE PageHandler* get_tlb_writehandler(PhysPt address) {
|
||||
return paging.tlb.writehandler[address>>12];
|
||||
}
|
||||
|
||||
/* Use these helper functions to access linear addresses in readX/writeX functions */
|
||||
INLINE PhysPt PAGING_GetPhysicalPage(PhysPt linePage) {
|
||||
static INLINE PhysPt PAGING_GetPhysicalPage(PhysPt linePage) {
|
||||
return (paging.tlb.phys_page[linePage>>12]<<12);
|
||||
}
|
||||
|
||||
INLINE PhysPt PAGING_GetPhysicalAddress(PhysPt linAddr) {
|
||||
static INLINE PhysPt PAGING_GetPhysicalAddress(PhysPt linAddr) {
|
||||
return (paging.tlb.phys_page[linAddr>>12]<<12)|(linAddr&0xfff);
|
||||
}
|
||||
|
||||
|
@ -223,7 +223,7 @@ INLINE PhysPt PAGING_GetPhysicalAddress(PhysPt linAddr) {
|
|||
|
||||
void PAGING_InitTLBBank(tlb_entry **bank);
|
||||
|
||||
INLINE tlb_entry *get_tlb_entry(PhysPt address) {
|
||||
static INLINE tlb_entry *get_tlb_entry(PhysPt address) {
|
||||
Bitu index=(address>>12);
|
||||
if (TLB_BANKS && (index > TLB_SIZE)) {
|
||||
Bitu bank=(address>>BANK_SHIFT) - 1;
|
||||
|
@ -234,26 +234,26 @@ INLINE tlb_entry *get_tlb_entry(PhysPt address) {
|
|||
return &paging.tlbh[index];
|
||||
}
|
||||
|
||||
INLINE HostPt get_tlb_read(PhysPt address) {
|
||||
static INLINE HostPt get_tlb_read(PhysPt address) {
|
||||
return get_tlb_entry(address)->read;
|
||||
}
|
||||
INLINE HostPt get_tlb_write(PhysPt address) {
|
||||
static INLINE HostPt get_tlb_write(PhysPt address) {
|
||||
return get_tlb_entry(address)->write;
|
||||
}
|
||||
INLINE PageHandler* get_tlb_readhandler(PhysPt address) {
|
||||
static INLINE PageHandler* get_tlb_readhandler(PhysPt address) {
|
||||
return get_tlb_entry(address)->readhandler;
|
||||
}
|
||||
INLINE PageHandler* get_tlb_writehandler(PhysPt address) {
|
||||
static INLINE PageHandler* get_tlb_writehandler(PhysPt address) {
|
||||
return get_tlb_entry(address)->writehandler;
|
||||
}
|
||||
|
||||
/* Use these helper functions to access linear addresses in readX/writeX functions */
|
||||
INLINE PhysPt PAGING_GetPhysicalPage(PhysPt linePage) {
|
||||
static INLINE PhysPt PAGING_GetPhysicalPage(PhysPt linePage) {
|
||||
tlb_entry *entry = get_tlb_entry(linePage);
|
||||
return (entry->phys_page<<12);
|
||||
}
|
||||
|
||||
INLINE PhysPt PAGING_GetPhysicalAddress(PhysPt linAddr) {
|
||||
static INLINE PhysPt PAGING_GetPhysicalAddress(PhysPt linAddr) {
|
||||
tlb_entry *entry = get_tlb_entry(linAddr);
|
||||
return (entry->phys_page<<12)|(linAddr&0xfff);
|
||||
}
|
||||
|
@ -261,13 +261,13 @@ INLINE PhysPt PAGING_GetPhysicalAddress(PhysPt linAddr) {
|
|||
|
||||
/* Special inlined memory reading/writing */
|
||||
|
||||
INLINE Bit8u mem_readb_inline(PhysPt address) {
|
||||
static INLINE Bit8u mem_readb_inline(PhysPt address) {
|
||||
HostPt tlb_addr=get_tlb_read(address);
|
||||
if (tlb_addr) return host_readb(tlb_addr+address);
|
||||
else return (Bit8u)(get_tlb_readhandler(address))->readb(address);
|
||||
}
|
||||
|
||||
INLINE Bit16u mem_readw_inline(PhysPt address) {
|
||||
static INLINE Bit16u mem_readw_inline(PhysPt address) {
|
||||
if ((address & 0xfff)<0xfff) {
|
||||
HostPt tlb_addr=get_tlb_read(address);
|
||||
if (tlb_addr) return host_readw(tlb_addr+address);
|
||||
|
@ -275,7 +275,7 @@ INLINE Bit16u mem_readw_inline(PhysPt address) {
|
|||
} else return mem_unalignedreadw(address);
|
||||
}
|
||||
|
||||
INLINE Bit32u mem_readd_inline(PhysPt address) {
|
||||
static INLINE Bit32u mem_readd_inline(PhysPt address) {
|
||||
if ((address & 0xfff)<0xffd) {
|
||||
HostPt tlb_addr=get_tlb_read(address);
|
||||
if (tlb_addr) return host_readd(tlb_addr+address);
|
||||
|
@ -283,13 +283,13 @@ INLINE Bit32u mem_readd_inline(PhysPt address) {
|
|||
} else return mem_unalignedreadd(address);
|
||||
}
|
||||
|
||||
INLINE void mem_writeb_inline(PhysPt address,Bit8u val) {
|
||||
static INLINE void mem_writeb_inline(PhysPt address,Bit8u val) {
|
||||
HostPt tlb_addr=get_tlb_write(address);
|
||||
if (tlb_addr) host_writeb(tlb_addr+address,val);
|
||||
else (get_tlb_writehandler(address))->writeb(address,val);
|
||||
}
|
||||
|
||||
INLINE void mem_writew_inline(PhysPt address,Bit16u val) {
|
||||
static INLINE void mem_writew_inline(PhysPt address,Bit16u val) {
|
||||
if ((address & 0xfff)<0xfff) {
|
||||
HostPt tlb_addr=get_tlb_write(address);
|
||||
if (tlb_addr) host_writew(tlb_addr+address,val);
|
||||
|
@ -297,7 +297,7 @@ INLINE void mem_writew_inline(PhysPt address,Bit16u val) {
|
|||
} else mem_unalignedwritew(address,val);
|
||||
}
|
||||
|
||||
INLINE void mem_writed_inline(PhysPt address,Bit32u val) {
|
||||
static INLINE void mem_writed_inline(PhysPt address,Bit32u val) {
|
||||
if ((address & 0xfff)<0xffd) {
|
||||
HostPt tlb_addr=get_tlb_write(address);
|
||||
if (tlb_addr) host_writed(tlb_addr+address,val);
|
||||
|
@ -306,7 +306,7 @@ INLINE void mem_writed_inline(PhysPt address,Bit32u val) {
|
|||
}
|
||||
|
||||
|
||||
INLINE bool mem_readb_checked(PhysPt address, Bit8u * val) {
|
||||
static INLINE bool mem_readb_checked(PhysPt address, Bit8u * val) {
|
||||
HostPt tlb_addr=get_tlb_read(address);
|
||||
if (tlb_addr) {
|
||||
*val=host_readb(tlb_addr+address);
|
||||
|
@ -314,7 +314,7 @@ INLINE bool mem_readb_checked(PhysPt address, Bit8u * val) {
|
|||
} else return (get_tlb_readhandler(address))->readb_checked(address, val);
|
||||
}
|
||||
|
||||
INLINE bool mem_readw_checked(PhysPt address, Bit16u * val) {
|
||||
static INLINE bool mem_readw_checked(PhysPt address, Bit16u * val) {
|
||||
if ((address & 0xfff)<0xfff) {
|
||||
HostPt tlb_addr=get_tlb_read(address);
|
||||
if (tlb_addr) {
|
||||
|
@ -324,7 +324,7 @@ INLINE bool mem_readw_checked(PhysPt address, Bit16u * val) {
|
|||
} else return mem_unalignedreadw_checked(address, val);
|
||||
}
|
||||
|
||||
INLINE bool mem_readd_checked(PhysPt address, Bit32u * val) {
|
||||
static INLINE bool mem_readd_checked(PhysPt address, Bit32u * val) {
|
||||
if ((address & 0xfff)<0xffd) {
|
||||
HostPt tlb_addr=get_tlb_read(address);
|
||||
if (tlb_addr) {
|
||||
|
@ -334,7 +334,7 @@ INLINE bool mem_readd_checked(PhysPt address, Bit32u * val) {
|
|||
} else return mem_unalignedreadd_checked(address, val);
|
||||
}
|
||||
|
||||
INLINE bool mem_writeb_checked(PhysPt address,Bit8u val) {
|
||||
static INLINE bool mem_writeb_checked(PhysPt address,Bit8u val) {
|
||||
HostPt tlb_addr=get_tlb_write(address);
|
||||
if (tlb_addr) {
|
||||
host_writeb(tlb_addr+address,val);
|
||||
|
@ -342,7 +342,7 @@ INLINE bool mem_writeb_checked(PhysPt address,Bit8u val) {
|
|||
} else return (get_tlb_writehandler(address))->writeb_checked(address,val);
|
||||
}
|
||||
|
||||
INLINE bool mem_writew_checked(PhysPt address,Bit16u val) {
|
||||
static INLINE bool mem_writew_checked(PhysPt address,Bit16u val) {
|
||||
if ((address & 0xfff)<0xfff) {
|
||||
HostPt tlb_addr=get_tlb_write(address);
|
||||
if (tlb_addr) {
|
||||
|
@ -352,7 +352,7 @@ INLINE bool mem_writew_checked(PhysPt address,Bit16u val) {
|
|||
} else return mem_unalignedwritew_checked(address,val);
|
||||
}
|
||||
|
||||
INLINE bool mem_writed_checked(PhysPt address,Bit32u val) {
|
||||
static INLINE bool mem_writed_checked(PhysPt address,Bit32u val) {
|
||||
if ((address & 0xfff)<0xffd) {
|
||||
HostPt tlb_addr=get_tlb_write(address);
|
||||
if (tlb_addr) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue