]> git.saurik.com Git - apple/xnu.git/blob - osfmk/i386/ntoh.s
4513026d6e254a2394580d43b91392e6a042c2d0
[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 * 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.
12 *
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.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23 /*
24 * @OSF_COPYRIGHT@
25 */
26 /*
27 * HISTORY
28 *
29 * Revision 1.1.1.1 1998/09/22 21:05:37 wsanchez
30 * Import of Mac OS X kernel (~semeria)
31 *
32 * Revision 1.1.1.1 1998/03/07 02:25:38 wsanchez
33 * Import of OSF Mach kernel (~mburg)
34 *
35 * Revision 1.1.6.1 1994/09/23 01:59:41 ezf
36 * change marker to not FREE
37 * [1994/09/22 21:25:28 ezf]
38 *
39 * Revision 1.1.2.2 1993/06/02 23:26:45 jeffc
40 * Added to OSF/1 R1.3 from NMK15.0.
41 * [1993/06/02 21:06:38 jeffc]
42 *
43 * Revision 1.1 1992/09/30 02:43:08 robert
44 * Initial revision
45 *
46 * $EndLog$
47 */
48 /* CMU_HIST */
49 /*
50 * Revision 2.4 91/05/14 16:12:50 mrt
51 * Correcting copyright
52 *
53 * Revision 2.3 91/02/14 15:04:55 mrt
54 * Changed to new Mach copyright
55 *
56 *
57 * Revision 2.2 90/05/03 15:34:56 dbg
58 * First checkin.
59 *
60 * New a.out and coff compatible .s files.
61 * [89/10/16 rvb]
62 *
63 * Revision 1.3 89/02/26 12:35:37 gm0w
64 * Changes for cleanup.
65 *
66 * 16-Feb-89 Robert Baron (rvb) at Carnegie-Mellon University
67 * Created.
68 *
69 */
70 /* CMU_ENDHIST */
71 /*
72 * Mach Operating System
73 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
74 * All Rights Reserved.
75 *
76 * Permission to use, copy, modify and distribute this software and its
77 * documentation is hereby granted, provided that both the copyright
78 * notice and this permission notice appear in all copies of the
79 * software, derivative works or modified versions, and any portions
80 * thereof, and that both notices appear in supporting documentation.
81 *
82 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
83 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
84 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
85 *
86 * Carnegie Mellon requests users of this software to return to
87 *
88 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
89 * School of Computer Science
90 * Carnegie Mellon University
91 * Pittsburgh PA 15213-3890
92 *
93 * any improvements or extensions that they make and grant Carnegie Mellon
94 * the rights to redistribute these changes.
95 */
96 /*
97 */
98
99 #include <i386/asm.h>
100
101 Entry(ntohl)
102 ENTRY(htonl)
103 movl 4(%esp), %eax
104 rorw $8, %ax
105 ror $16,%eax
106 rorw $8, %ax
107 ret
108
109
110 Entry(ntohs)
111 ENTRY(htons)
112 movzwl 4(%esp), %eax
113 rorw $8, %ax
114 ret