Search
lxdream.org :: lxdream/src/sh4/mmux86.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/mmux86.c
changeset 946:d41ee7994db7
prev942:05e5d6a62e67
next1067:d3c00ffccfcd
author nkeynes
date Tue Jan 06 01:58:08 2009 +0000 (12 years ago)
branchlxdream-mem
permissions -rw-r--r--
last change Fully integrate SQ with the new address space code - added additional 'prefetch'
memory accessor. TLB is utterly untested, but non-TLB at least still works.
file annotate diff log raw
1.1 --- a/src/sh4/mmux86.c Mon Jan 05 04:13:42 2009 +0000
1.2 +++ b/src/sh4/mmux86.c Tue Jan 06 01:58:08 2009 +0000
1.3 @@ -49,7 +49,7 @@
1.4 uint8_t **fn = (uint8_t **)ext_address_space[ppn>>12];
1.5 uint8_t **out = (uint8_t **)&page->fn;
1.6
1.7 - for( i=0; i<8; i+= inc, fn += inc, out += inc ) {
1.8 + for( i=0; i<9; i+= inc, fn += inc, out += inc ) {
1.9 *out = xlat_output;
1.10 #if SIZEOF_VOID_P == 8
1.11 MOV_imm64_r32((uintptr_t)&mmu_urc, R_EAX );
1.12 @@ -69,6 +69,25 @@
1.13 JMP_r32disp8(R_ECX, (((uintptr_t)out) - ((uintptr_t)&page->fn)) ); // 3
1.14 }
1.15 }
1.16 +
1.17 + page->fn.prefetch = unmapped_prefetch; // FIXME
1.18 +}
1.19 +
1.20 +void mmu_utlb_init_storequeue_vtable( struct utlb_entry *ent, struct utlb_page_entry *page )
1.21 +{
1.22 + uint32_t mask = ent->mask;
1.23 + uint32_t vpn = ent->vpn & mask;
1.24 + uint32_t ppn = ent->ppn & mask;
1.25 +
1.26 + xlat_output = page->code;
1.27 +
1.28 + memcpy( page, &p4_region_storequeue, sizeof(struct mem_region_fn) );
1.29 +
1.30 + /* TESTME: Does a PREF increment the URC counter? */
1.31 + page->fn.prefetch = (mem_prefetch_fn_t)xlat_output;
1.32 + ADD_imm32_r32( ppn-vpn, ARG1 );
1.33 + int rel = ((uint8_t *)ccn_storequeue_prefetch_tlb) - xlat_output;
1.34 + JMP_rel( rel );
1.35 }
1.36
1.37 void mmu_utlb_1k_init_vtable( struct utlb_1k_entry *entry )
1.38 @@ -77,7 +96,7 @@
1.39 int i;
1.40 uint8_t **out = (uint8_t **)&entry->fn;
1.41
1.42 - for( i=0; i<8; i++, out++ ) {
1.43 + for( i=0; i<9; i++, out++ ) {
1.44 *out = xlat_output;
1.45 MOV_r32_r32( ARG1, R_ECX );
1.46 SHR_imm8_r32( 10, R_ECX );
1.47 @@ -92,7 +111,7 @@
1.48 }
1.49
1.50 out = (uint8_t **)&entry->user_fn;
1.51 - for( i=0; i<8; i++, out++ ) {
1.52 + for( i=0; i<9; i++, out++ ) {
1.53 *out = xlat_output;
1.54 MOV_r32_r32( ARG1, R_ECX );
1.55 SHR_imm8_r32( 10, R_ECX );
.