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