author | ab196087 |
Tue, 22 May 2007 11:10:09 -0700 | |
changeset 4292 | d7beef35913b |
parent 0 | 68f95e015346 |
child 7298 | b69e27387f74 |
permissions | -rw-r--r-- |
0 | 1 |
/* |
2 |
* CDDL HEADER START |
|
3 |
* |
|
4 |
* The contents of this file are subject to the terms of the |
|
4292
d7beef35913b
6518331 Eliminate duplicate addresses from ON ELF symbol sort sections
ab196087
parents:
0
diff
changeset
|
5 |
* Common Development and Distribution License (the "License"). |
d7beef35913b
6518331 Eliminate duplicate addresses from ON ELF symbol sort sections
ab196087
parents:
0
diff
changeset
|
6 |
* You may not use this file except in compliance with the License. |
0 | 7 |
* |
8 |
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
9 |
* or http://www.opensolaris.org/os/licensing. |
|
10 |
* See the License for the specific language governing permissions |
|
11 |
* and limitations under the License. |
|
12 |
* |
|
13 |
* When distributing Covered Code, include this CDDL HEADER in each |
|
14 |
* file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
15 |
* If applicable, add the following below this CDDL HEADER, with the |
|
16 |
* fields enclosed by brackets "[]" replaced with your own identifying |
|
17 |
* information: Portions Copyright [yyyy] [name of copyright owner] |
|
18 |
* |
|
19 |
* CDDL HEADER END |
|
20 |
*/ |
|
21 |
/* |
|
4292
d7beef35913b
6518331 Eliminate duplicate addresses from ON ELF symbol sort sections
ab196087
parents:
0
diff
changeset
|
22 |
* Copyright 2007 Sun Microsystems, Inc. All rights reserved. |
0 | 23 |
* Use is subject to license terms. |
24 |
*/ |
|
25 |
||
26 |
.ident "%Z%%M% %I% %E% SMI" |
|
27 |
||
28 |
.file "%M%" |
|
29 |
||
30 |
#include "SYS.h" |
|
31 |
||
4292
d7beef35913b
6518331 Eliminate duplicate addresses from ON ELF symbol sort sections
ab196087
parents:
0
diff
changeset
|
32 |
/* |
d7beef35913b
6518331 Eliminate duplicate addresses from ON ELF symbol sort sections
ab196087
parents:
0
diff
changeset
|
33 |
* NOTE: htonl/ntohl are identical routines, as are htons/ntohs. |
d7beef35913b
6518331 Eliminate duplicate addresses from ON ELF symbol sort sections
ab196087
parents:
0
diff
changeset
|
34 |
* As such, they could be implemented as a single routine, using |
d7beef35913b
6518331 Eliminate duplicate addresses from ON ELF symbol sort sections
ab196087
parents:
0
diff
changeset
|
35 |
* multiple ALTENTRY/SET_SIZE definitions. We don't do this so |
d7beef35913b
6518331 Eliminate duplicate addresses from ON ELF symbol sort sections
ab196087
parents:
0
diff
changeset
|
36 |
* that they will have unique addresses, allowing DTrace and |
d7beef35913b
6518331 Eliminate duplicate addresses from ON ELF symbol sort sections
ab196087
parents:
0
diff
changeset
|
37 |
* other debuggers to tell them apart. |
d7beef35913b
6518331 Eliminate duplicate addresses from ON ELF symbol sort sections
ab196087
parents:
0
diff
changeset
|
38 |
*/ |
d7beef35913b
6518331 Eliminate duplicate addresses from ON ELF symbol sort sections
ab196087
parents:
0
diff
changeset
|
39 |
|
0 | 40 |
/ unsigned long htonl( hl ) |
41 |
/ unsigned long ntohl( hl ) |
|
42 |
/ long hl; |
|
43 |
/ reverses the byte order of 'long hl' |
|
44 |
/ |
|
45 |
ENTRY(htonl) |
|
4292
d7beef35913b
6518331 Eliminate duplicate addresses from ON ELF symbol sort sections
ab196087
parents:
0
diff
changeset
|
46 |
movl 4(%esp), %eax / %eax = hl |
d7beef35913b
6518331 Eliminate duplicate addresses from ON ELF symbol sort sections
ab196087
parents:
0
diff
changeset
|
47 |
bswap %eax / reverses the byte order of %eax |
d7beef35913b
6518331 Eliminate duplicate addresses from ON ELF symbol sort sections
ab196087
parents:
0
diff
changeset
|
48 |
ret / return (%eax) |
d7beef35913b
6518331 Eliminate duplicate addresses from ON ELF symbol sort sections
ab196087
parents:
0
diff
changeset
|
49 |
SET_SIZE(htonl) |
d7beef35913b
6518331 Eliminate duplicate addresses from ON ELF symbol sort sections
ab196087
parents:
0
diff
changeset
|
50 |
|
0 | 51 |
ENTRY(ntohl) |
52 |
movl 4(%esp), %eax / %eax = hl |
|
53 |
bswap %eax / reverses the byte order of %eax |
|
54 |
ret / return (%eax) |
|
55 |
SET_SIZE(ntohl) |
|
56 |
||
57 |
/ unsigned short htons( hs ) |
|
58 |
/ short hs; |
|
59 |
/ |
|
60 |
/ reverses the byte order in hs. |
|
61 |
/ |
|
62 |
ENTRY(htons) |
|
4292
d7beef35913b
6518331 Eliminate duplicate addresses from ON ELF symbol sort sections
ab196087
parents:
0
diff
changeset
|
63 |
movl 4(%esp), %eax / %eax = hs |
d7beef35913b
6518331 Eliminate duplicate addresses from ON ELF symbol sort sections
ab196087
parents:
0
diff
changeset
|
64 |
bswap %eax / reverses the byte order of %eax |
d7beef35913b
6518331 Eliminate duplicate addresses from ON ELF symbol sort sections
ab196087
parents:
0
diff
changeset
|
65 |
shrl $16, %eax / moves high 16-bit to low 16-bit |
d7beef35913b
6518331 Eliminate duplicate addresses from ON ELF symbol sort sections
ab196087
parents:
0
diff
changeset
|
66 |
ret / return (%eax) |
d7beef35913b
6518331 Eliminate duplicate addresses from ON ELF symbol sort sections
ab196087
parents:
0
diff
changeset
|
67 |
SET_SIZE(htons) |
d7beef35913b
6518331 Eliminate duplicate addresses from ON ELF symbol sort sections
ab196087
parents:
0
diff
changeset
|
68 |
|
0 | 69 |
ENTRY(ntohs) |
70 |
movl 4(%esp), %eax / %eax = hs |
|
71 |
bswap %eax / reverses the byte order of %eax |
|
72 |
shrl $16, %eax / moves high 16-bit to low 16-bit |
|
73 |
ret / return (%eax) |
|
74 |
SET_SIZE(ntohs) |