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