Search
lxdream.org :: lxdream/src/sh4/ia64abi.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/ia64abi.h
changeset 577:a181aeacd6e8
prev571:9bc09948d0f2
next580:508dc852a8eb
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/ia64abi.h Thu Jan 10 08:28:37 2008 +0000
1.2 +++ b/src/sh4/ia64abi.h Mon Jan 14 10:23:49 2008 +0000
1.3 @@ -235,4 +235,28 @@
1.4 }
1.5 }
1.6
1.7 +
1.8 +void *xlat_get_native_pc()
1.9 +{
1.10 + void *result = NULL;
1.11 + asm(
1.12 + "mov %%rbp, %%rax\n\t"
1.13 + "mov $0x8, %%ecx\n\t"
1.14 + "mov %1, %%rdx\n"
1.15 +"frame_loop: test %%rax, %%rax\n\t"
1.16 + "je frame_not_found\n\t"
1.17 + "cmpq (%%rax), %%rdx\n\t"
1.18 + "je frame_found\n\t"
1.19 + "sub $0x1, %%ecx\n\t"
1.20 + "je frame_not_found\n\t"
1.21 + "movq (%%rax), %%rax\n\t"
1.22 + "jmp frame_loop\n"
1.23 +"frame_found: movq 0x4(%%rax), %0\n"
1.24 +"frame_not_found:"
1.25 + : "=r" (result)
1.26 + : "r" (&sh4r)
1.27 + : "rax", "rcx", "rdx" );
1.28 + return result;
1.29 +}
1.30 +
1.31 #endif
.