summaryrefslogtreecommitdiffstats
path: root/lib/libc/arch/amd64/net/htons.S
blob: 51a268d4e4eea5e1f177e1e7f8cfd386944deb46 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
/*	$OpenBSD: htons.S,v 1.4 2018/07/03 23:14:05 mortimer Exp $	*/

/* Written by Artur Grabowski. Public Domain */

#include <machine/asm.h>

ENTRY(htons)
	RETGUARD_SETUP(htons, r11)
	movl    %edi,%eax
	xchgb   %ah,%al
	RETGUARD_CHECK(htons, r11)
	ret
END(htons)