1*3b4b8bdaSRobert Mustacchi /* 2*3b4b8bdaSRobert Mustacchi * This file and its contents are supplied under the terms of the 3*3b4b8bdaSRobert Mustacchi * Common Development and Distribution License ("CDDL"), version 1.0. 4*3b4b8bdaSRobert Mustacchi * You may only use this file in accordance with the terms of version 5*3b4b8bdaSRobert Mustacchi * 1.0 of the CDDL. 6*3b4b8bdaSRobert Mustacchi * 7*3b4b8bdaSRobert Mustacchi * A full copy of the text of the CDDL should have accompanied this 8*3b4b8bdaSRobert Mustacchi * source. A copy of the CDDL is also available via the Internet at 9*3b4b8bdaSRobert Mustacchi * http://www.illumos.org/license/CDDL. 10*3b4b8bdaSRobert Mustacchi */ 11*3b4b8bdaSRobert Mustacchi 12*3b4b8bdaSRobert Mustacchi /* 13*3b4b8bdaSRobert Mustacchi * Copyright (c) 2015, Joyent, Inc. 14*3b4b8bdaSRobert Mustacchi */ 15*3b4b8bdaSRobert Mustacchi 16*3b4b8bdaSRobert Mustacchi #include <sys/isa_defs.h> 17*3b4b8bdaSRobert Mustacchi #include <endian.h> 18*3b4b8bdaSRobert Mustacchi 19*3b4b8bdaSRobert Mustacchi /* 20*3b4b8bdaSRobert Mustacchi * General endian(3C) functions that are basically no-ops. 21*3b4b8bdaSRobert Mustacchi */ 22*3b4b8bdaSRobert Mustacchi 23*3b4b8bdaSRobert Mustacchi uint16_t 24*3b4b8bdaSRobert Mustacchi letoh16(uint16_t in) 25*3b4b8bdaSRobert Mustacchi { 26*3b4b8bdaSRobert Mustacchi return (in); 27*3b4b8bdaSRobert Mustacchi } 28*3b4b8bdaSRobert Mustacchi 29*3b4b8bdaSRobert Mustacchi uint16_t 30*3b4b8bdaSRobert Mustacchi le16toh(uint16_t in) 31*3b4b8bdaSRobert Mustacchi { 32*3b4b8bdaSRobert Mustacchi return (in); 33*3b4b8bdaSRobert Mustacchi } 34*3b4b8bdaSRobert Mustacchi 35*3b4b8bdaSRobert Mustacchi uint32_t 36*3b4b8bdaSRobert Mustacchi letoh32(uint32_t in) 37*3b4b8bdaSRobert Mustacchi { 38*3b4b8bdaSRobert Mustacchi return (in); 39*3b4b8bdaSRobert Mustacchi } 40*3b4b8bdaSRobert Mustacchi 41*3b4b8bdaSRobert Mustacchi uint32_t 42*3b4b8bdaSRobert Mustacchi le32toh(uint32_t in) 43*3b4b8bdaSRobert Mustacchi { 44*3b4b8bdaSRobert Mustacchi return (in); 45*3b4b8bdaSRobert Mustacchi } 46*3b4b8bdaSRobert Mustacchi 47*3b4b8bdaSRobert Mustacchi uint16_t 48*3b4b8bdaSRobert Mustacchi htole16(uint16_t in) 49*3b4b8bdaSRobert Mustacchi { 50*3b4b8bdaSRobert Mustacchi return (in); 51*3b4b8bdaSRobert Mustacchi } 52*3b4b8bdaSRobert Mustacchi 53*3b4b8bdaSRobert Mustacchi uint32_t 54*3b4b8bdaSRobert Mustacchi htole32(uint32_t in) 55*3b4b8bdaSRobert Mustacchi { 56*3b4b8bdaSRobert Mustacchi return (in); 57*3b4b8bdaSRobert Mustacchi } 58