NetBSD/distrib/utils/sysinst/endian.h
fvdl a5d73e00eb Rework the MBR code, and some of the labelling code.
* Use structures, not 2-dimensional arrays..
	* Use the DIOCGDEFLABEL ioctl to get the disk information,
	  to avoid confusion with (older) labels.
	* Don't ever call fdisk for partitioning. This was the
	  source of much confusion.
	* For the i386, use the BIOS geometry information passed by
	  the bootblocks.

Lots of things left to do, but it's a start.
1999-03-31 00:44:48 +00:00

27 lines
571 B
C

/* $NetBSD: endian.h,v 1.1 1999/03/31 00:44:48 fvdl Exp $ */
#include <machine/endian.h>
#include <machine/bswap.h>
#if BYTE_ORDER == LITTLE_ENDIAN
#define le_to_native16(x) (x)
#define le_to_native32(x) (x)
#define le_to_native64(x) (x)
#define native_to_le16(x) (x)
#define native_to_le32(x) (x)
#define native_to_le64(x) (x)
#else
#define le_to_native16(x) bswap16(x)
#define le_to_native32(x) bswap32(x)
#define le_to_native64(x) bswap64(x)
#define native_to_le16(x) bswap16(x)
#define native_to_le32(x) bswap32(x)
#define native_to_le64(x) bswap64(x)
#endif