ranlib: fix it
[odcctools-svp.git] / libmacho / i860_swap.c
blob9feb8513f4c5ed4390684d75da355a14f0b7b789
1 /*
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
23 #ifndef RLD
24 #include <mach-o/i860/swap.h>
26 void
27 swap_i860_thread_state_regs(
28 struct i860_thread_state_regs *cpu,
29 enum NXByteOrder target_byte_sex)
31 unsigned long i;
33 for(i = 0; i < 31; i++)
34 cpu->ireg[i] = NXSwapLong(cpu->ireg[i]);
35 for(i = 0; i < 30; i++)
36 cpu->freg[i] = NXSwapLong(cpu->freg[i]);
37 cpu->psr = NXSwapLong(cpu->psr);
38 cpu->epsr = NXSwapLong(cpu->epsr);
39 cpu->db = NXSwapLong(cpu->db);
40 cpu->pc = NXSwapLong(cpu->pc);
41 cpu->_padding_ = NXSwapLong(cpu->_padding_);
42 cpu->Mres3 = NXSwapDouble(cpu->Mres3);
43 cpu->Ares3 = NXSwapDouble(cpu->Ares3);
44 cpu->Mres2 = NXSwapDouble(cpu->Mres2);
45 cpu->Ares2 = NXSwapDouble(cpu->Ares2);
46 cpu->Mres1 = NXSwapDouble(cpu->Mres1);
47 cpu->Ares1 = NXSwapDouble(cpu->Ares1);
48 cpu->Ires1 = NXSwapDouble(cpu->Ires1);
49 cpu->Lres3m = NXSwapDouble(cpu->Lres3m);
50 cpu->Lres2m = NXSwapDouble(cpu->Lres2m);
51 cpu->Lres1m = NXSwapDouble(cpu->Lres1m);
52 cpu->KR = NXSwapDouble(cpu->KR);
53 cpu->KI = NXSwapDouble(cpu->KI);
54 cpu->T = NXSwapDouble(cpu->T);
55 cpu->Fsr3 = NXSwapLong(cpu->Fsr3);
56 cpu->Fsr2 = NXSwapLong(cpu->Fsr2);
57 cpu->Fsr1 = NXSwapLong(cpu->Fsr1);
58 cpu->Mergelo32 = NXSwapLong(cpu->Mergelo32);
59 cpu->Mergehi32 = NXSwapLong(cpu->Mergehi32);
61 #endif /* !defined(RLD) */