History log of /openbsd-current/sys/sys/endian.h
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.25 21-Dec-2014 guenther

<sys/endian.h> needs <sys/cdefs.h>

found previously by someone whose email I've lost; rediscovered by miod@
ok millert@ deraadt@


Revision tags: OPENBSD_5_6_BASE
# 1.24 20-Jul-2014 guenther

Provide correct guidance on which header to use in the comments


# 1.23 12-Jul-2014 guenther

Tackle the endian.h mess. Make it so that:
* you can #include <sys/endian.h> instead of <machine/endian.h>,
and ditto <endian.h> (fixes code that pulls in <sys/endian.h> first)

* those will always export the symbols that POSIX specified for
<endian.h>, including the new {be,le}{16,32,64}toh() set. c.f.
http://austingroupbugs.net/view.php?id=162

if __BSD_VISIBLE then you also get the symbols that our <machine/endian.h>
currently exports (ntohs, NTOHS, dlg's bemtoh*, etc)

* when doing POSIX compiles (not __BSD_VISIBLE), then <netinet/in.h> and
<arpa/inet.h> will *stop* exporting the extra symbols like BYTE_ORDER
and betoh*

ok deraadt@


# 1.22 10-Jul-2014 dlg

guenther spotted my bad copy and pasting.

fall back to htobe64 for htobem64 instead of htole64 on LE archs.


# 1.21 14-Mar-2014 dlg

provide an MI api for doing byteswapping loads and stores. some
archs have instrutions that can do this, and the rest that dont get
to use wrappers around the byteswap(3) api.

this provides MI backends for sparc64 and powerpc which get a big
benefit from this because byteswapping in registers is really hard
for them.

the intended use case is for reading and writing bits of dma memory
handed to and from hardware.

discussed with miod@ guenther@ deraadt@
ok miod@ kettenis@


Revision tags: OPENBSD_5_5_BASE
# 1.20 20-Aug-2013 kettenis

Include <sys/_types.h> to make this header a little bit more self-contained.

ok guenther@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.19 24-Jun-2011 deraadt

When converting endian to same-endian, the macros should cast to unsigned
so that signedness of the input is suppressed.
ok matthew miod kettenis guenther


Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.18 27-Mar-2006 otto

Kill lint warning by using unsigned right hand arg to >>
Right shifting signed values is undefined. From claudio@
ok millert@; comitted by request of deraadt@


Revision tags: OPENBSD_3_9_BASE
# 1.17 06-Jan-2006 millert

Adapt things to use __type_t instead of _BSD_TYPE_T_
Add new sys/_types.h header
Include machine/_types.h or sys/_types.h where applicable


# 1.16 14-Dec-2005 millert

Add a __statement macro to use with gcc statement expressions instead
of using __extension__ directly. This lets us define away the whole
thing when lint is in use.


# 1.15 13-Dec-2005 millert

First step in include files overhaul. Use __FOO_VISIBLE (as defined
in sys/cdefs.h) instead of _FOO_SOURCE. Also fix several namespace
pollution issues, including the byte order defines. OK deraadt@


Revision tags: OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE SMP_SYNC_A SMP_SYNC_B
# 1.14 11-Jan-2004 brad

mark u_int64_t constants with ULL to make gcc3 happy

ok drahn@ tedu@


# 1.13 26-Sep-2003 fgsch

put 64bit macros/functions documentation back.


# 1.12 21-Sep-2003 fgsch

revert for now.


# 1.11 21-Sep-2003 fgsch

document and declare 64-bit function/macros. ok millert@ deraadt@


Revision tags: OPENBSD_3_4_BASE
# 1.10 03-Jun-2003 deraadt

fix various 3/4 licenses according to "terms" file


Revision tags: UBC_SYNC_A
# 1.9 01-May-2003 millert

Fix unbalanced parens in __swap64gen macro for non-gcc; Hugh C Kennedy


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE UBC_SYNC_B
# 1.8 14-Mar-2002 millert

First round of __P removal in sys


Revision tags: OPENBSD_3_0_BASE UBC_BASE
# 1.7 27-Jun-2001 mickey

branches: 1.7.4;
implement md 64 bit swaps; niklas@ ok


# 1.6 22-Jun-2001 deraadt

KNF


Revision tags: OPENBSD_2_8_BASE OPENBSD_2_9_BASE
# 1.5 25-Oct-2000 deraadt

mark swap16() and swap32() with __extension__; guenther@gac.edu


Revision tags: OPENBSD_2_6_BASE OPENBSD_2_7_BASE SMP_BASE kame_19991208
# 1.4 21-Jul-1999 csapuntz

branches: 1.4.4;


swap16_multi by niklas@cvs.openbsd.org

Fix cd.c so it compiles on big-endian platforms


Revision tags: OPENBSD_2_3_BASE OPENBSD_2_4_BASE OPENBSD_2_5_BASE
# 1.3 30-Nov-1997 millert

Move in_addr_t and in_port_t to <sys/types.h> and add sa_family_t
and suseconds_t types for XPG4.2.


# 1.2 10-Nov-1997 niklas

Sign extension paranoia. Careful about local varnames in macros.
Typo correction. Overrideable _QUAD_{LOW,HIGH}WORD values.


# 1.1 09-Nov-1997 niklas

New endian.h design. All architectures now use a common file for the bulk
part. Some ports can optimize the swap operations. This also means the
general API is extended with swap16, swap32, htobe16, htobe32, betoh16,
betoh32, htole16, htole32, letoh16 and letoh32.