summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2003-04-30 18:07:23 +0000
committerpeter <peter@FreeBSD.org>2003-04-30 18:07:23 +0000
commit5219e46960d9e99f627a92765299eb1e25405fd5 (patch)
tree377a30cfc508d59163749debd1ac6eb83eff5239 /lib/libc
parent6ca367c8548fc5fb3638be2d6eb64d1412737525 (diff)
downloadFreeBSD-src-5219e46960d9e99f627a92765299eb1e25405fd5.zip
FreeBSD-src-5219e46960d9e99f627a92765299eb1e25405fd5.tar.gz
Update for AMD64 (repocopied from i386/net). We can depend on having
the bswap instruction (yay!). Update for register parameter passing instead of i386 style stack based param passing.
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/amd64/net/htonl.S6
-rw-r--r--lib/libc/amd64/net/htons.S2
-rw-r--r--lib/libc/amd64/net/ntohl.S6
-rw-r--r--lib/libc/amd64/net/ntohs.S2
4 files changed, 6 insertions, 10 deletions
diff --git a/lib/libc/amd64/net/htonl.S b/lib/libc/amd64/net/htonl.S
index da74ed6..8d802d6 100644
--- a/lib/libc/amd64/net/htonl.S
+++ b/lib/libc/amd64/net/htonl.S
@@ -45,8 +45,6 @@ __FBSDID("$FreeBSD$");
.weak CNAME(htonl)
.set CNAME(htonl),CNAME(__htonl)
ENTRY(__htonl)
- movl 4(%esp),%eax
- xchgb %al,%ah
- roll $16,%eax
- xchgb %al,%ah
+ movl %edi,%eax
+ bswap %eax
ret
diff --git a/lib/libc/amd64/net/htons.S b/lib/libc/amd64/net/htons.S
index d5d63fc..6940ef0 100644
--- a/lib/libc/amd64/net/htons.S
+++ b/lib/libc/amd64/net/htons.S
@@ -45,6 +45,6 @@ __FBSDID("$FreeBSD$");
.weak CNAME(htons)
.set CNAME(htons),CNAME(__htons)
ENTRY(__htons)
- movzwl 4(%esp),%eax
+ movl %edi,%eax
xchgb %al,%ah
ret
diff --git a/lib/libc/amd64/net/ntohl.S b/lib/libc/amd64/net/ntohl.S
index 15e2d6e..e5e2150 100644
--- a/lib/libc/amd64/net/ntohl.S
+++ b/lib/libc/amd64/net/ntohl.S
@@ -45,8 +45,6 @@ __FBSDID("$FreeBSD$");
.weak CNAME(ntohl)
.set CNAME(ntohl),CNAME(__ntohl)
ENTRY(__ntohl)
- movl 4(%esp),%eax
- xchgb %al,%ah
- roll $16,%eax
- xchgb %al,%ah
+ movl %edi,%eax
+ bswap %eax
ret
diff --git a/lib/libc/amd64/net/ntohs.S b/lib/libc/amd64/net/ntohs.S
index eb0668c..02e4441 100644
--- a/lib/libc/amd64/net/ntohs.S
+++ b/lib/libc/amd64/net/ntohs.S
@@ -47,6 +47,6 @@ __FBSDID("$FreeBSD$");
.weak CNAME(ntohs)
.set CNAME(ntohs),CNAME(__ntohs)
ENTRY(__ntohs)
- movzwl 4(%esp),%eax
+ movl %edi,%eax
xchgb %al,%ah
ret
OpenPOWER on IntegriCloud