ranlib: fix it
[odcctools-svp.git] / libmacho / hppa_swap.c
blob303af059fbbbd93719bf5b4368fa6f95661b98c1
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/hppa/swap.h>
26 void
27 swap_hppa_integer_thread_state(
28 struct hp_pa_integer_thread_state *regs,
29 enum NXByteOrder target_byte_order)
31 regs->ts_gr1 = NXSwapLong(regs->ts_gr1);
32 regs->ts_gr2 = NXSwapLong(regs->ts_gr2);
33 regs->ts_gr3 = NXSwapLong(regs->ts_gr3);
34 regs->ts_gr4 = NXSwapLong(regs->ts_gr4);
35 regs->ts_gr5 = NXSwapLong(regs->ts_gr5);
36 regs->ts_gr6 = NXSwapLong(regs->ts_gr6);
37 regs->ts_gr7 = NXSwapLong(regs->ts_gr7);
38 regs->ts_gr8 = NXSwapLong(regs->ts_gr8);
39 regs->ts_gr9 = NXSwapLong(regs->ts_gr9);
40 regs->ts_gr10 = NXSwapLong(regs->ts_gr10);
41 regs->ts_gr11 = NXSwapLong(regs->ts_gr11);
42 regs->ts_gr12 = NXSwapLong(regs->ts_gr12);
43 regs->ts_gr13 = NXSwapLong(regs->ts_gr13);
44 regs->ts_gr14 = NXSwapLong(regs->ts_gr14);
45 regs->ts_gr15 = NXSwapLong(regs->ts_gr15);
46 regs->ts_gr16 = NXSwapLong(regs->ts_gr16);
47 regs->ts_gr17 = NXSwapLong(regs->ts_gr17);
48 regs->ts_gr18 = NXSwapLong(regs->ts_gr18);
49 regs->ts_gr19 = NXSwapLong(regs->ts_gr19);
50 regs->ts_gr20 = NXSwapLong(regs->ts_gr20);
51 regs->ts_gr21 = NXSwapLong(regs->ts_gr21);
52 regs->ts_gr22 = NXSwapLong(regs->ts_gr22);
53 regs->ts_gr23 = NXSwapLong(regs->ts_gr23);
54 regs->ts_gr24 = NXSwapLong(regs->ts_gr24);
55 regs->ts_gr25 = NXSwapLong(regs->ts_gr25);
56 regs->ts_gr26 = NXSwapLong(regs->ts_gr26);
57 regs->ts_gr27 = NXSwapLong(regs->ts_gr27);
58 regs->ts_gr28 = NXSwapLong(regs->ts_gr28);
59 regs->ts_gr29 = NXSwapLong(regs->ts_gr29);
60 regs->ts_gr30 = NXSwapLong(regs->ts_gr30);
61 regs->ts_gr31 = NXSwapLong(regs->ts_gr31);
62 regs->ts_sr0 = NXSwapLong(regs->ts_sr0);
63 regs->ts_sr1 = NXSwapLong(regs->ts_sr1);
64 regs->ts_sr2 = NXSwapLong(regs->ts_sr2);
65 regs->ts_sr3 = NXSwapLong(regs->ts_sr3);
66 regs->ts_sar = NXSwapLong(regs->ts_sar);
69 void swap_hppa_frame_thread_state(
70 struct hp_pa_frame_thread_state *frame,
71 enum NXByteOrder target_byte_order)
73 frame->ts_pcsq_front = NXSwapLong(frame->ts_pcsq_front);
74 frame->ts_pcsq_back = NXSwapLong(frame->ts_pcsq_back);
75 frame->ts_pcoq_front = NXSwapLong(frame->ts_pcoq_front);
76 frame->ts_pcoq_back = NXSwapLong(frame->ts_pcoq_back);
77 frame->ts_psw = NXSwapLong(frame->ts_psw);
78 frame->ts_unaligned_faults = NXSwapLong(frame->ts_unaligned_faults);
79 frame->ts_fault_address = NXSwapLong(frame->ts_fault_address);
80 frame->ts_step_range_start = NXSwapLong(frame->ts_step_range_start);
81 frame->ts_step_range_stop = NXSwapLong(frame->ts_step_range_stop);
84 void swap_hppa_fp_thread_state(
85 struct hp_pa_fp_thread_state *fp,
86 enum NXByteOrder target_byte_order)
88 fp->ts_fp0 = NXSwapDouble(fp->ts_fp0);
89 fp->ts_fp1 = NXSwapDouble(fp->ts_fp1);
90 fp->ts_fp2 = NXSwapDouble(fp->ts_fp2);
91 fp->ts_fp3 = NXSwapDouble(fp->ts_fp3);
92 fp->ts_fp4 = NXSwapDouble(fp->ts_fp4);
93 fp->ts_fp5 = NXSwapDouble(fp->ts_fp5);
94 fp->ts_fp6 = NXSwapDouble(fp->ts_fp6);
95 fp->ts_fp7 = NXSwapDouble(fp->ts_fp7);
96 fp->ts_fp8 = NXSwapDouble(fp->ts_fp8);
97 fp->ts_fp9 = NXSwapDouble(fp->ts_fp9);
98 fp->ts_fp10 = NXSwapDouble(fp->ts_fp10);
99 fp->ts_fp11 = NXSwapDouble(fp->ts_fp11);
100 fp->ts_fp12 = NXSwapDouble(fp->ts_fp12);
101 fp->ts_fp13 = NXSwapDouble(fp->ts_fp13);
102 fp->ts_fp14 = NXSwapDouble(fp->ts_fp14);
103 fp->ts_fp15 = NXSwapDouble(fp->ts_fp15);
104 fp->ts_fp16 = NXSwapDouble(fp->ts_fp16);
105 fp->ts_fp17 = NXSwapDouble(fp->ts_fp17);
106 fp->ts_fp18 = NXSwapDouble(fp->ts_fp18);
107 fp->ts_fp19 = NXSwapDouble(fp->ts_fp19);
108 fp->ts_fp20 = NXSwapDouble(fp->ts_fp20);
109 fp->ts_fp21 = NXSwapDouble(fp->ts_fp21);
110 fp->ts_fp22 = NXSwapDouble(fp->ts_fp22);
111 fp->ts_fp23 = NXSwapDouble(fp->ts_fp23);
112 fp->ts_fp24 = NXSwapDouble(fp->ts_fp24);
113 fp->ts_fp25 = NXSwapDouble(fp->ts_fp25);
114 fp->ts_fp26 = NXSwapDouble(fp->ts_fp26);
115 fp->ts_fp27 = NXSwapDouble(fp->ts_fp27);
116 fp->ts_fp28 = NXSwapDouble(fp->ts_fp28);
117 fp->ts_fp29 = NXSwapDouble(fp->ts_fp29);
118 fp->ts_fp30 = NXSwapDouble(fp->ts_fp30);
119 fp->ts_fp31 = NXSwapDouble(fp->ts_fp31);
121 #endif /* !defined(RLD) */