void swap_x86_float_state( x86_float_state_t *fpu, enum NXByteOrder target_byte_sex) { x86_state_hdr_t hdr; enum NXByteOrder host_byte_sex; host_byte_sex = NXHostByteOrder(); hdr = fpu->fsh; if(target_byte_sex == host_byte_sex) swap_x86_state_hdr(&hdr, host_byte_sex); swap_x86_state_hdr(&fpu->fsh, target_byte_sex); if(hdr.flavor == x86_FLOAT_STATE32) swap_i386_float_state(&fpu->ufs.fs32, target_byte_sex); else if(hdr.flavor == x86_FLOAT_STATE64) swap_x86_float_state64(&fpu->ufs.fs64, target_byte_sex); }
void swap_x86_float_state( x86_float_state_t *fpu, enum NXByteOrder target_byte_sex) { x86_state_hdr_t hdr; enum NXByteOrder host_byte_sex; host_byte_sex = NXHostByteOrder(); hdr = fpu->fsh; if(target_byte_sex == host_byte_sex) swap_x86_state_hdr(&hdr, host_byte_sex); swap_x86_state_hdr(&fpu->fsh, target_byte_sex); /* current i386 thread states */ #if i386_THREAD_STATE == 1 if(hdr.flavor == x86_FLOAT_STATE32) swap_i386_float_state(&fpu->ufs.fs32, target_byte_sex); else #endif if(hdr.flavor == x86_FLOAT_STATE64) swap_x86_float_state64(&fpu->ufs.fs64, target_byte_sex); }