Revision eda52953

b/linux-user/main.c
808 808

  
809 809
static void restore_window(CPUSPARCState *env)
810 810
{
811
    unsigned int new_wim, i, cwp1;
811
#ifndef TARGET_SPARC64
812
    unsigned int new_wim;
813
#endif
814
    unsigned int i, cwp1;
812 815
    abi_ulong sp_ptr;
813 816

  
817
#ifndef TARGET_SPARC64
814 818
    new_wim = ((env->wim << 1) | (env->wim >> (env->nwindows - 1))) &
815 819
        ((1LL << env->nwindows) - 1);
820
#endif
816 821

  
817 822
    /* restore the invalid window */
818 823
    cwp1 = cpu_cwp_inc(env, env->cwp + 1);
......
826 831
        get_user_ual(env->regbase[get_reg_index(env, cwp1, 8 + i)], sp_ptr);
827 832
        sp_ptr += sizeof(abi_ulong);
828 833
    }
829
    env->wim = new_wim;
830 834
#ifdef TARGET_SPARC64
831 835
    env->canrestore++;
832 836
    if (env->cleanwin < env->nwindows - 1)
833 837
        env->cleanwin++;
834 838
    env->cansave--;
839
#else
840
    env->wim = new_wim;
835 841
#endif
836 842
}
837 843

  
......
843 849
    for(;;) {
844 850
        /* if restore would invoke restore_window(), then we can stop */
845 851
        cwp1 = cpu_cwp_inc(env, env->cwp + offset);
852
#ifndef TARGET_SPARC64
846 853
        if (env->wim & (1 << cwp1))
847 854
            break;
855
#else
856
        if (env->canrestore == 0)
857
            break;
858
        env->cansave++;
859
        env->canrestore--;
860
#endif
848 861
        save_window_offset(env, cwp1);
849 862
        offset++;
850 863
    }
851
    /* set wim so that restore will reload the registers */
852 864
    cwp1 = cpu_cwp_inc(env, env->cwp + 1);
865
#ifndef TARGET_SPARC64
866
    /* set wim so that restore will reload the registers */
853 867
    env->wim = 1 << cwp1;
868
#endif
854 869
#if defined(DEBUG_WIN)
855 870
    printf("flush_windows: nb=%d\n", offset - 1);
856 871
#endif

Also available in: Unified diff