Search
lxdream.org :: lxdream/src/sh4/sh4core.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/sh4core.h
changeset 570:d2893980fbf5
prev569:a1c49e1e8776
next571:9bc09948d0f2
author nkeynes
date Sun Jan 06 12:24:18 2008 +0000 (14 years ago)
branchlxdream-mmu
permissions -rw-r--r--
last change Change to generate different code for mmu on/off cases
file annotate diff log raw
1.1 --- a/src/sh4/sh4core.h Fri Jan 04 11:54:17 2008 +0000
1.2 +++ b/src/sh4/sh4core.h Sun Jan 06 12:24:18 2008 +0000
1.3 @@ -105,22 +105,37 @@
1.4 void signsat48(void);
1.5
1.6 /* SH4 Memory */
1.7 +#define MMU_VMA_ERROR 0x8000000
1.8 +/**
1.9 + * Update the sh4_icache structure to contain the specified vma. If the vma
1.10 + * cannot be resolved, an MMU exception is raised and the function returns
1.11 + * FALSE. Otherwise, returns TRUE and updates sh4_icache accordingly.
1.12 + * Note: If the vma resolves to a non-memory area, sh4_icache will be
1.13 + * invalidated, but the function will still return TRUE.
1.14 + * @return FALSE if an MMU exception was raised, otherwise TRUE.
1.15 + */
1.16 gboolean mmu_update_icache( sh4vma_t addr );
1.17 -uint64_t mmu_vma_to_phys_read( sh4vma_t addr );
1.18 -uint64_t mmu_vma_to_phys_write( sh4vma_t addr );
1.19 -uint64_t mmu_vma_to_phys_exec( sh4vma_t addr );
1.20 +
1.21 +/**
1.22 + * Resolve a virtual address through the TLB for a read operation, returning
1.23 + * the resultant P4 or external address. If the resolution fails, the
1.24 + * appropriate MMU exception is raised and the value MMU_VMA_ERROR is returned.
1.25 + * @return An external address (0x00000000-0x1FFFFFFF), a P4 address
1.26 + * (0xE0000000 - 0xFFFFFFFF), or MMU_VMA_ERROR.
1.27 + */
1.28 +sh4addr_t mmu_vma_to_phys_read( sh4vma_t addr );
1.29 +sh4addr_t mmu_vma_to_phys_write( sh4vma_t addr );
1.30
1.31 int64_t sh4_read_quad( sh4addr_t addr );
1.32 -int64_t sh4_read_long( sh4addr_t addr );
1.33 -int64_t sh4_read_word( sh4addr_t addr );
1.34 -int64_t sh4_read_byte( sh4addr_t addr );
1.35 +int32_t sh4_read_long( sh4addr_t addr );
1.36 +int32_t sh4_read_word( sh4addr_t addr );
1.37 +int32_t sh4_read_byte( sh4addr_t addr );
1.38 void sh4_write_quad( sh4addr_t addr, uint64_t val );
1.39 -int32_t sh4_write_long( sh4addr_t addr, uint32_t val );
1.40 -int32_t sh4_write_word( sh4addr_t addr, uint32_t val );
1.41 -int32_t sh4_write_byte( sh4addr_t addr, uint32_t val );
1.42 +void sh4_write_long( sh4addr_t addr, uint32_t val );
1.43 +void sh4_write_word( sh4addr_t addr, uint32_t val );
1.44 +void sh4_write_byte( sh4addr_t addr, uint32_t val );
1.45 int32_t sh4_read_phys_word( sh4addr_t addr );
1.46 void sh4_flush_store_queue( sh4addr_t addr );
1.47 -sh4ptr_t sh4_get_region_by_vma( sh4addr_t addr );
1.48
1.49 /* SH4 Exceptions */
1.50 #define EXC_POWER_RESET 0x000 /* reset vector */
.