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

/* Written by Artur Grabowski. Public Domain */

#include <machine/asm.h>

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