Search
lxdream.org :: lxdream/src/sh4/ia32abi.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/ia32abi.h
changeset 947:aa80962d6439
prev944:a4e31314bee1
author nkeynes
date Tue Jan 06 02:03:36 2009 +0000 (13 years ago)
branchlxdream-mem
permissions -rw-r--r--
last change Back out the CALL_ptr change (need to handle relocation from end-of-cache to
front in overflow situations)
file annotate diff log raw
nkeynes@539
     1
/**
nkeynes@586
     2
 * $Id$
nkeynes@539
     3
 * 
nkeynes@926
     4
 * Provides the implementation for the ia32 ABI variant 
nkeynes@926
     5
 * (eg prologue, epilogue, and calling conventions). Stack frame is
nkeynes@926
     6
 * aligned on 16-byte boundaries for the benefit of OS X (which 
nkeynes@926
     7
 * requires it).
nkeynes@539
     8
 *
nkeynes@539
     9
 * Copyright (c) 2007 Nathan Keynes.
nkeynes@539
    10
 *
nkeynes@539
    11
 * This program is free software; you can redistribute it and/or modify
nkeynes@539
    12
 * it under the terms of the GNU General Public License as published by
nkeynes@539
    13
 * the Free Software Foundation; either version 2 of the License, or
nkeynes@539
    14
 * (at your option) any later version.
nkeynes@539
    15
 *
nkeynes@539
    16
 * This program is distributed in the hope that it will be useful,
nkeynes@539
    17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
nkeynes@539
    18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
nkeynes@539
    19
 * GNU General Public License for more details.
nkeynes@539
    20
 */
nkeynes@539
    21
nkeynes@926
    22
#ifndef lxdream_ia32mac_H
nkeynes@926
    23
#define lxdream_ia32mac_H 1
nkeynes@539
    24
nkeynes@539
    25
#define load_ptr( reg, ptr ) load_imm32( reg, (uint32_t)ptr );
nkeynes@539
    26
nkeynes@930
    27
static inline decode_address( int addr_reg )
nkeynes@930
    28
{
nkeynes@944
    29
    uintptr_t base = (sh4r.xlat_sh4_mode&SR_MD) ? (uintptr_t)sh4_address_space : (uintptr_t)sh4_user_address_space;
nkeynes@930
    30
    MOV_r32_r32( addr_reg, R_ECX ); 
nkeynes@930
    31
    SHR_imm8_r32( 12, R_ECX ); 
nkeynes@944
    32
    MOV_r32disp32x4_r32( R_ECX, base, R_ECX );
nkeynes@930
    33
}
nkeynes@930
    34
nkeynes@539
    35
/**
nkeynes@539
    36
 * Note: clobbers EAX to make the indirect call - this isn't usually
nkeynes@539
    37
 * a problem since the callee will usually clobber it anyway.
nkeynes@539
    38
 */
nkeynes@539
    39
static inline void call_func0( void *ptr )
nkeynes@539
    40
{
nkeynes@947
    41
    load_imm32(R_ECX, (uint32_t)ptr);
nkeynes@947
    42
    CALL_r32(R_ECX);
nkeynes@539
    43
}
nkeynes@539
    44
nkeynes@905
    45
#ifdef HAVE_FASTCALL
nkeynes@905
    46
static inline void call_func1( void *ptr, int arg1 )
nkeynes@905
    47
{
nkeynes@905
    48
    if( arg1 != R_EAX ) {
nkeynes@905
    49
        MOV_r32_r32( arg1, R_EAX );
nkeynes@905
    50
    }
nkeynes@947
    51
    load_imm32(R_ECX, (uint32_t)ptr);
nkeynes@947
    52
    CALL_r32(R_ECX);
nkeynes@905
    53
}
nkeynes@905
    54
nkeynes@929
    55
static inline void call_func1_r32( int addr_reg, int arg1 )
nkeynes@929
    56
{
nkeynes@929
    57
    if( arg1 != R_EAX ) {
nkeynes@929
    58
        MOV_r32_r32( arg1, R_EAX );
nkeynes@929
    59
    }
nkeynes@929
    60
    CALL_r32(addr_reg);
nkeynes@929
    61
}
nkeynes@929
    62
nkeynes@930
    63
static inline void call_func1_r32disp8( int preg, uint32_t disp8, int arg1 )
nkeynes@929
    64
{
nkeynes@929
    65
    if( arg1 != R_EAX ) {
nkeynes@929
    66
        MOV_r32_r32( arg1, R_EAX );
nkeynes@929
    67
    }
nkeynes@930
    68
    CALL_r32disp8(preg, disp8);
nkeynes@929
    69
}
nkeynes@929
    70
nkeynes@939
    71
static inline void call_func1_r32disp8_exc( int preg, uint32_t disp8, int arg1, int pc )
nkeynes@939
    72
{
nkeynes@939
    73
    if( arg1 != R_EAX ) {
nkeynes@939
    74
        MOV_r32_r32( arg1, R_EAX );
nkeynes@939
    75
    }
nkeynes@939
    76
    load_exc_backpatch(R_EDX);
nkeynes@939
    77
    CALL_r32disp8(preg, disp8);
nkeynes@939
    78
}
nkeynes@939
    79
nkeynes@905
    80
static inline void call_func2( void *ptr, int arg1, int arg2 )
nkeynes@905
    81
{
nkeynes@905
    82
    if( arg2 != R_EDX ) {
nkeynes@905
    83
        MOV_r32_r32( arg2, R_EDX );
nkeynes@905
    84
    }
nkeynes@905
    85
    if( arg1 != R_EAX ) {
nkeynes@905
    86
        MOV_r32_r32( arg1, R_EAX );
nkeynes@905
    87
    }
nkeynes@947
    88
    load_imm32(R_ECX, (uint32_t)ptr);
nkeynes@947
    89
    CALL_r32(R_ECX);
nkeynes@905
    90
}
nkeynes@905
    91
nkeynes@929
    92
static inline void call_func2_r32( int addr_reg, int arg1, int arg2 )
nkeynes@929
    93
{
nkeynes@929
    94
    if( arg2 != R_EDX ) {
nkeynes@929
    95
        MOV_r32_r32( arg2, R_EDX );
nkeynes@929
    96
    }
nkeynes@929
    97
    if( arg1 != R_EAX ) {
nkeynes@929
    98
        MOV_r32_r32( arg1, R_EAX );
nkeynes@929
    99
    }
nkeynes@929
   100
    CALL_r32(addr_reg);
nkeynes@929
   101
}
nkeynes@929
   102
nkeynes@930
   103
static inline void call_func2_r32disp8( int preg, uint32_t disp8, int arg1, int arg2 )
nkeynes@929
   104
{
nkeynes@929
   105
    if( arg2 != R_EDX ) {
nkeynes@929
   106
        MOV_r32_r32( arg2, R_EDX );
nkeynes@929
   107
    }
nkeynes@929
   108
    if( arg1 != R_EAX ) {
nkeynes@929
   109
        MOV_r32_r32( arg1, R_EAX );
nkeynes@929
   110
    }
nkeynes@930
   111
    CALL_r32disp8(preg, disp8);
nkeynes@929
   112
}
nkeynes@929
   113
nkeynes@939
   114
static inline void call_func2_r32disp8_exc( int preg, uint32_t disp8, int arg1, int arg2, int pc )
nkeynes@939
   115
{
nkeynes@939
   116
    if( arg2 != R_EDX ) {
nkeynes@939
   117
        MOV_r32_r32( arg2, R_EDX );
nkeynes@939
   118
    }
nkeynes@939
   119
    if( arg1 != R_EAX ) {
nkeynes@939
   120
        MOV_r32_r32( arg1, R_EAX );
nkeynes@939
   121
    }
nkeynes@939
   122
    MOV_backpatch_esp8( 0 );
nkeynes@939
   123
    CALL_r32disp8(preg, disp8);
nkeynes@939
   124
}
nkeynes@939
   125
nkeynes@929
   126
nkeynes@929
   127
nkeynes@927
   128
static inline void call_func1_exc( void *ptr, int arg1, int pc )
nkeynes@927
   129
{
nkeynes@927
   130
    if( arg1 != R_EAX ) {
nkeynes@927
   131
        MOV_r32_r32( arg1, R_EAX );
nkeynes@927
   132
    }
nkeynes@927
   133
    load_exc_backpatch(R_EDX);
nkeynes@947
   134
    load_imm32(R_ECX, (uint32_t)ptr);
nkeynes@947
   135
    CALL_r32(R_ECX);
nkeynes@927
   136
}   
nkeynes@927
   137
nkeynes@927
   138
static inline void call_func2_exc( void *ptr, int arg1, int arg2, int pc )
nkeynes@927
   139
{
nkeynes@927
   140
    if( arg2 != R_EDX ) {
nkeynes@927
   141
        MOV_r32_r32( arg2, R_EDX );
nkeynes@927
   142
    }
nkeynes@927
   143
    if( arg1 != R_EAX ) {
nkeynes@927
   144
        MOV_r32_r32( arg1, R_EAX );
nkeynes@927
   145
    }
nkeynes@947
   146
    MOV_backpatch_esp8(0);
nkeynes@947
   147
    load_imm32(R_ECX, (uint32_t)ptr);
nkeynes@947
   148
    CALL_r32(R_ECX);
nkeynes@927
   149
}
nkeynes@927
   150
nkeynes@905
   151
#else
nkeynes@539
   152
static inline void call_func1( void *ptr, int arg1 )
nkeynes@539
   153
{
nkeynes@926
   154
    SUB_imm8s_r32( 12, R_ESP );
nkeynes@539
   155
    PUSH_r32(arg1);
nkeynes@947
   156
    load_imm32(R_ECX, (uint32_t)ptr);
nkeynes@947
   157
    CALL_r32(R_ECX);
nkeynes@926
   158
    ADD_imm8s_r32( 16, R_ESP );
nkeynes@539
   159
}
nkeynes@539
   160
nkeynes@539
   161
static inline void call_func2( void *ptr, int arg1, int arg2 )
nkeynes@539
   162
{
nkeynes@926
   163
    SUB_imm8s_r32( 8, R_ESP );
nkeynes@539
   164
    PUSH_r32(arg2);
nkeynes@539
   165
    PUSH_r32(arg1);
nkeynes@947
   166
    load_imm32(R_ECX, (uint32_t)ptr);
nkeynes@947
   167
    CALL_r32(R_ECX);
nkeynes@926
   168
    ADD_imm8s_r32( 16, R_ESP );
nkeynes@539
   169
}
nkeynes@539
   170
nkeynes@905
   171
#endif
nkeynes@539
   172
nkeynes@539
   173
/**
nkeynes@539
   174
 * Emit the 'start of block' assembly. Sets up the stack frame and save
nkeynes@539
   175
 * SI/DI as required
nkeynes@926
   176
 * Allocates 8 bytes for local variables, which also has the convenient
nkeynes@926
   177
 * side-effect of aligning the stack.
nkeynes@539
   178
 */
nkeynes@901
   179
void enter_block( ) 
nkeynes@539
   180
{
nkeynes@539
   181
    PUSH_r32(R_EBP);
nkeynes@669
   182
    load_ptr( R_EBP, ((uint8_t *)&sh4r) + 128 );
nkeynes@930
   183
    SUB_imm8s_r32( 8, R_ESP ); 
nkeynes@926
   184
}
nkeynes@736
   185
nkeynes@926
   186
static inline void exit_block( )
nkeynes@926
   187
{
nkeynes@930
   188
    ADD_imm8s_r32( 8, R_ESP );
nkeynes@926
   189
    POP_r32(R_EBP);
nkeynes@926
   190
    RET();
nkeynes@539
   191
}
nkeynes@539
   192
nkeynes@539
   193
/**
nkeynes@926
   194
 * Exit the block with sh4r.new_pc written with the target pc
nkeynes@539
   195
 */
nkeynes@586
   196
void exit_block_pcset( sh4addr_t pc )
nkeynes@539
   197
{
nkeynes@539
   198
    load_imm32( R_ECX, ((pc - sh4_x86.block_start_pc)>>1)*sh4_cpu_period ); // 5
nkeynes@539
   199
    ADD_r32_sh4r( R_ECX, REG_OFFSET(slice_cycle) );    // 6
nkeynes@590
   200
    load_spreg( R_EAX, R_PC );
nkeynes@590
   201
    if( sh4_x86.tlb_on ) {
nkeynes@736
   202
        call_func1(xlat_get_code_by_vma,R_EAX);
nkeynes@590
   203
    } else {
nkeynes@736
   204
        call_func1(xlat_get_code,R_EAX);
nkeynes@926
   205
    }
nkeynes@926
   206
    exit_block();
nkeynes@590
   207
}
nkeynes@590
   208
nkeynes@590
   209
/**
nkeynes@590
   210
 * Exit the block with sh4r.new_pc written with the target pc
nkeynes@590
   211
 */
nkeynes@590
   212
void exit_block_newpcset( sh4addr_t pc )
nkeynes@590
   213
{
nkeynes@590
   214
    load_imm32( R_ECX, ((pc - sh4_x86.block_start_pc)>>1)*sh4_cpu_period ); // 5
nkeynes@590
   215
    ADD_r32_sh4r( R_ECX, REG_OFFSET(slice_cycle) );    // 6
nkeynes@590
   216
    load_spreg( R_EAX, R_NEW_PC );
nkeynes@590
   217
    store_spreg( R_EAX, R_PC );
nkeynes@586
   218
    if( sh4_x86.tlb_on ) {
nkeynes@736
   219
        call_func1(xlat_get_code_by_vma,R_EAX);
nkeynes@586
   220
    } else {
nkeynes@736
   221
        call_func1(xlat_get_code,R_EAX);
nkeynes@926
   222
    }
nkeynes@926
   223
    exit_block();
nkeynes@539
   224
}
nkeynes@539
   225
nkeynes@586
   226
nkeynes@539
   227
/**
nkeynes@539
   228
 * Exit the block to an absolute PC
nkeynes@539
   229
 */
nkeynes@926
   230
void exit_block_abs( sh4addr_t pc, sh4addr_t endpc )
nkeynes@539
   231
{
nkeynes@539
   232
    load_imm32( R_ECX, pc );                            // 5
nkeynes@539
   233
    store_spreg( R_ECX, REG_OFFSET(pc) );               // 3
nkeynes@586
   234
    if( IS_IN_ICACHE(pc) ) {
nkeynes@736
   235
        MOV_moff32_EAX( xlat_get_lut_entry(GET_ICACHE_PHYS(pc)) ); // 5
nkeynes@926
   236
        AND_imm8s_r32( 0xFC, R_EAX ); // 3
nkeynes@586
   237
    } else if( sh4_x86.tlb_on ) {
nkeynes@736
   238
        call_func1(xlat_get_code_by_vma,R_ECX);
nkeynes@586
   239
    } else {
nkeynes@736
   240
        call_func1(xlat_get_code,R_ECX);
nkeynes@586
   241
    }
nkeynes@586
   242
    load_imm32( R_ECX, ((endpc - sh4_x86.block_start_pc)>>1)*sh4_cpu_period ); // 5
nkeynes@586
   243
    ADD_r32_sh4r( R_ECX, REG_OFFSET(slice_cycle) );     // 6
nkeynes@926
   244
    exit_block();
nkeynes@586
   245
}
nkeynes@586
   246
nkeynes@586
   247
/**
nkeynes@586
   248
 * Exit the block to a relative PC
nkeynes@586
   249
 */
nkeynes@586
   250
void exit_block_rel( sh4addr_t pc, sh4addr_t endpc )
nkeynes@586
   251
{
nkeynes@586
   252
    load_imm32( R_ECX, pc - sh4_x86.block_start_pc );   // 5
nkeynes@586
   253
    ADD_sh4r_r32( R_PC, R_ECX );
nkeynes@586
   254
    store_spreg( R_ECX, REG_OFFSET(pc) );               // 3
nkeynes@586
   255
    if( IS_IN_ICACHE(pc) ) {
nkeynes@736
   256
        MOV_moff32_EAX( xlat_get_lut_entry(GET_ICACHE_PHYS(pc)) ); // 5
nkeynes@926
   257
        AND_imm8s_r32( 0xFC, R_EAX ); // 3
nkeynes@586
   258
    } else if( sh4_x86.tlb_on ) {
nkeynes@736
   259
        call_func1(xlat_get_code_by_vma,R_ECX);
nkeynes@586
   260
    } else {
nkeynes@736
   261
        call_func1(xlat_get_code,R_ECX);
nkeynes@586
   262
    }
nkeynes@539
   263
    load_imm32( R_ECX, ((endpc - sh4_x86.block_start_pc)>>1)*sh4_cpu_period ); // 5
nkeynes@539
   264
    ADD_r32_sh4r( R_ECX, REG_OFFSET(slice_cycle) );     // 6
nkeynes@926
   265
    exit_block();
nkeynes@539
   266
}
nkeynes@539
   267
nkeynes@539
   268
/**
nkeynes@539
   269
 * Write the block trailer (exception handling block)
nkeynes@539
   270
 */
nkeynes@539
   271
void sh4_translate_end_block( sh4addr_t pc ) {
nkeynes@539
   272
    if( sh4_x86.branch_taken == FALSE ) {
nkeynes@736
   273
        // Didn't exit unconditionally already, so write the termination here
nkeynes@736
   274
        exit_block_rel( pc, pc );
nkeynes@539
   275
    }
nkeynes@539
   276
    if( sh4_x86.backpatch_posn != 0 ) {
nkeynes@736
   277
        unsigned int i;
nkeynes@736
   278
        // Raise exception
nkeynes@736
   279
        uint8_t *end_ptr = xlat_output;
nkeynes@736
   280
        MOV_r32_r32( R_EDX, R_ECX );
nkeynes@736
   281
        ADD_r32_r32( R_EDX, R_ECX );
nkeynes@736
   282
        ADD_r32_sh4r( R_ECX, R_PC );
nkeynes@736
   283
        MOV_moff32_EAX( &sh4_cpu_period );
nkeynes@736
   284
        MUL_r32( R_EDX );
nkeynes@736
   285
        ADD_r32_sh4r( R_EAX, REG_OFFSET(slice_cycle) );
nkeynes@539
   286
nkeynes@926
   287
        POP_r32(R_EAX);
nkeynes@907
   288
        call_func1( sh4_raise_exception, R_EAX );
nkeynes@736
   289
        load_spreg( R_EAX, R_PC );
nkeynes@736
   290
        if( sh4_x86.tlb_on ) {
nkeynes@736
   291
            call_func1(xlat_get_code_by_vma,R_EAX);
nkeynes@736
   292
        } else {
nkeynes@736
   293
            call_func1(xlat_get_code,R_EAX);
nkeynes@736
   294
        }
nkeynes@926
   295
        exit_block();
nkeynes@539
   296
nkeynes@736
   297
        // Exception already raised - just cleanup
nkeynes@736
   298
        uint8_t *preexc_ptr = xlat_output;
nkeynes@736
   299
        MOV_r32_r32( R_EDX, R_ECX );
nkeynes@736
   300
        ADD_r32_r32( R_EDX, R_ECX );
nkeynes@736
   301
        ADD_r32_sh4r( R_ECX, R_SPC );
nkeynes@736
   302
        MOV_moff32_EAX( &sh4_cpu_period );
nkeynes@736
   303
        MUL_r32( R_EDX );
nkeynes@736
   304
        ADD_r32_sh4r( R_EAX, REG_OFFSET(slice_cycle) );
nkeynes@736
   305
        load_spreg( R_EAX, R_PC );
nkeynes@736
   306
        if( sh4_x86.tlb_on ) {
nkeynes@736
   307
            call_func1(xlat_get_code_by_vma,R_EAX);
nkeynes@736
   308
        } else {
nkeynes@736
   309
            call_func1(xlat_get_code,R_EAX);
nkeynes@736
   310
        }
nkeynes@926
   311
        exit_block();
nkeynes@586
   312
nkeynes@736
   313
        for( i=0; i< sh4_x86.backpatch_posn; i++ ) {
nkeynes@736
   314
            uint32_t *fixup_addr = (uint32_t *)&xlat_current_block->code[sh4_x86.backpatch_list[i].fixup_offset];
nkeynes@736
   315
            if( sh4_x86.backpatch_list[i].exc_code < 0 ) {
nkeynes@927
   316
                if( sh4_x86.backpatch_list[i].exc_code == -2 ) {
nkeynes@927
   317
                    *fixup_addr = (uint32_t)xlat_output;
nkeynes@927
   318
                } else {
nkeynes@927
   319
                    *fixup_addr += xlat_output - (uint8_t *)&xlat_current_block->code[sh4_x86.backpatch_list[i].fixup_offset] - 4;
nkeynes@927
   320
                }
nkeynes@736
   321
                load_imm32( R_EDX, sh4_x86.backpatch_list[i].fixup_icount );
nkeynes@736
   322
                int rel = preexc_ptr - xlat_output;
nkeynes@736
   323
                JMP_rel(rel);
nkeynes@736
   324
            } else {
nkeynes@927
   325
                *fixup_addr += xlat_output - (uint8_t *)&xlat_current_block->code[sh4_x86.backpatch_list[i].fixup_offset] - 4;
nkeynes@736
   326
                PUSH_imm32( sh4_x86.backpatch_list[i].exc_code );
nkeynes@736
   327
                load_imm32( R_EDX, sh4_x86.backpatch_list[i].fixup_icount );
nkeynes@736
   328
                int rel = end_ptr - xlat_output;
nkeynes@736
   329
                JMP_rel(rel);
nkeynes@736
   330
            }
nkeynes@736
   331
        }
nkeynes@539
   332
    }
nkeynes@539
   333
}
nkeynes@539
   334
nkeynes@926
   335
nkeynes@899
   336
/**
nkeynes@899
   337
 * The unwind methods only work if we compiled with DWARF2 frame information
nkeynes@899
   338
 * (ie -fexceptions), otherwise we have to use the direct frame scan.
nkeynes@899
   339
 */
nkeynes@899
   340
#ifdef HAVE_EXCEPTIONS
nkeynes@899
   341
#include <unwind.h>
nkeynes@899
   342
nkeynes@899
   343
struct UnwindInfo {
nkeynes@926
   344
    uintptr_t block_start;
nkeynes@926
   345
    uintptr_t block_end;
nkeynes@926
   346
    void *pc;
nkeynes@899
   347
};
nkeynes@899
   348
nkeynes@899
   349
_Unwind_Reason_Code xlat_check_frame( struct _Unwind_Context *context, void *arg )
nkeynes@899
   350
{
nkeynes@926
   351
    struct UnwindInfo *info = arg;
nkeynes@926
   352
    void *pc = (void *)_Unwind_GetIP(context);
nkeynes@926
   353
    if( ((uintptr_t)pc) >= info->block_start && ((uintptr_t)pc) < info->block_end ) {
nkeynes@926
   354
        info->pc = pc;
nkeynes@899
   355
        return _URC_NORMAL_STOP;
nkeynes@899
   356
    }
nkeynes@899
   357
nkeynes@899
   358
    return _URC_NO_REASON;
nkeynes@899
   359
}
nkeynes@899
   360
nkeynes@906
   361
void *xlat_get_native_pc( void *code, uint32_t code_size )
nkeynes@899
   362
{
nkeynes@899
   363
    struct _Unwind_Exception exc;
nkeynes@899
   364
    struct UnwindInfo info;
nkeynes@899
   365
nkeynes@926
   366
    info.pc = NULL;
nkeynes@926
   367
    info.block_start = (uintptr_t)code;
nkeynes@926
   368
    info.block_end = info.block_start + code_size;
nkeynes@899
   369
    void *result = NULL;
nkeynes@899
   370
    _Unwind_Backtrace( xlat_check_frame, &info );
nkeynes@926
   371
    return info.pc;
nkeynes@899
   372
}
nkeynes@899
   373
#else 
nkeynes@906
   374
void *xlat_get_native_pc( void *code, uint32_t code_size )
nkeynes@586
   375
{
nkeynes@586
   376
    void *result = NULL;
nkeynes@586
   377
    asm(
nkeynes@736
   378
        "mov %%ebp, %%eax\n\t"
nkeynes@736
   379
        "mov $0x8, %%ecx\n\t"
nkeynes@736
   380
        "mov %1, %%edx\n"
nkeynes@736
   381
        "frame_loop: test %%eax, %%eax\n\t"
nkeynes@736
   382
        "je frame_not_found\n\t"
nkeynes@736
   383
        "cmp (%%eax), %%edx\n\t"
nkeynes@736
   384
        "je frame_found\n\t"
nkeynes@736
   385
        "sub $0x1, %%ecx\n\t"
nkeynes@736
   386
        "je frame_not_found\n\t"
nkeynes@736
   387
        "movl (%%eax), %%eax\n\t"
nkeynes@736
   388
        "jmp frame_loop\n"
nkeynes@736
   389
        "frame_found: movl 0x4(%%eax), %0\n"
nkeynes@736
   390
        "frame_not_found:"
nkeynes@736
   391
        : "=r" (result)
nkeynes@736
   392
        : "r" (((uint8_t *)&sh4r) + 128 )
nkeynes@736
   393
        : "eax", "ecx", "edx" );
nkeynes@586
   394
    return result;
nkeynes@586
   395
}
nkeynes@899
   396
#endif
nkeynes@586
   397
nkeynes@926
   398
#endif /* !lxdream_ia32mac.h */
nkeynes@539
   399
nkeynes@539
   400
.