]> git.saurik.com Git - apple/xnu.git/blob - osfmk/i386/ntoh.s
xnu-344.21.74.tar.gz
[apple/xnu.git] / osfmk / i386 / ntoh.s
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25 /*
26 * @OSF_COPYRIGHT@
27 */
28 /*
29 * HISTORY
30 *
31 * Revision 1.1.1.1 1998/09/22 21:05:37 wsanchez
32 * Import of Mac OS X kernel (~semeria)
33 *
34 * Revision 1.1.1.1 1998/03/07 02:25:38 wsanchez
35 * Import of OSF Mach kernel (~mburg)
36 *
37 * Revision 1.1.6.1 1994/09/23 01:59:41 ezf
38 * change marker to not FREE
39 * [1994/09/22 21:25:28 ezf]
40 *
41 * Revision 1.1.2.2 1993/06/02 23:26:45 jeffc
42 * Added to OSF/1 R1.3 from NMK15.0.
43 * [1993/06/02 21:06:38 jeffc]
44 *
45 * Revision 1.1 1992/09/30 02:43:08 robert
46 * Initial revision
47 *
48 * $EndLog$
49 */
50 /* CMU_HIST */
51 /*
52 * Revision 2.4 91/05/14 16:12:50 mrt
53 * Correcting copyright
54 *
55 * Revision 2.3 91/02/14 15:04:55 mrt
56 * Changed to new Mach copyright
57 *
58 *
59 * Revision 2.2 90/05/03 15:34:56 dbg
60 * First checkin.
61 *
62 * New a.out and coff compatible .s files.
63 * [89/10/16 rvb]
64 *
65 * Revision 1.3 89/02/26 12:35:37 gm0w
66 * Changes for cleanup.
67 *
68 * 16-Feb-89 Robert Baron (rvb) at Carnegie-Mellon University
69 * Created.
70 *
71 */
72 /* CMU_ENDHIST */
73 /*
74 * Mach Operating System
75 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
76 * All Rights Reserved.
77 *
78 * Permission to use, copy, modify and distribute this software and its
79 * documentation is hereby granted, provided that both the copyright
80 * notice and this permission notice appear in all copies of the
81 * software, derivative works or modified versions, and any portions
82 * thereof, and that both notices appear in supporting documentation.
83 *
84 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
85 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
86 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
87 *
88 * Carnegie Mellon requests users of this software to return to
89 *
90 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
91 * School of Computer Science
92 * Carnegie Mellon University
93 * Pittsburgh PA 15213-3890
94 *
95 * any improvements or extensions that they make and grant Carnegie Mellon
96 * the rights to redistribute these changes.
97 */
98 /*
99 */
100
101 #include <i386/asm.h>
102
103 Entry(ntohl)
104 ENTRY(htonl)
105 movl 4(%esp), %eax
106 rorw $8, %ax
107 ror $16,%eax
108 rorw $8, %ax
109 ret
110
111
112 Entry(ntohs)
113 ENTRY(htons)
114 movzwl 4(%esp), %eax
115 rorw $8, %ax
116 ret