Search
lxdream.org :: lxdream/src/sh4/ia32mac.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/ia32mac.h
changeset 577:a181aeacd6e8
prev571:9bc09948d0f2
author nkeynes
date Mon Jan 14 10:23:49 2008 +0000 (12 years ago)
branchlxdream-mmu
permissions -rw-r--r--
last change Remove asm file and convert to inline (easier to cope with platform conventions)
Add breakpoint support
Add MMU store-queue support
file annotate diff log raw
1.1 --- a/src/sh4/ia32mac.h Thu Jan 10 08:28:37 2008 +0000
1.2 +++ b/src/sh4/ia32mac.h Mon Jan 14 10:23:49 2008 +0000
1.3 @@ -267,6 +267,30 @@
1.4 }
1.5 }
1.6
1.7 +void *xlat_get_native_pc()
1.8 +{
1.9 + void *result = NULL;
1.10 + asm(
1.11 + "mov %%ebp, %%eax\n\t"
1.12 + "mov $0x8, %%ecx\n\t"
1.13 + "mov %1, %%edx\n"
1.14 +"frame_loop: test %%eax, %%eax\n\t"
1.15 + "je frame_not_found\n\t"
1.16 + "cmp (%%eax), %%edx\n\t"
1.17 + "je frame_found\n\t"
1.18 + "sub $0x1, %%ecx\n\t"
1.19 + "je frame_not_found\n\t"
1.20 + "movl (%%eax), %%eax\n\t"
1.21 + "jmp frame_loop\n"
1.22 +"frame_found: movl 0x4(%%eax), %0\n"
1.23 +"frame_not_found:"
1.24 + : "=r" (result)
1.25 + : "r" (&sh4r)
1.26 + : "eax", "ecx", "edx" );
1.27 + return result;
1.28 +}
1.29 +
1.30 +
1.31 #endif
1.32
1.33
.