summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2012-07-01 01:41:14 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2012-07-01 01:41:14 +0000
commit35b697b9f5a242eeffada8ad7b634d46145d7f24 (patch)
treea7a42812fdf47c77be1924733a24a691c8072640 /sys/dev/ic
parent270e6554af8b198920aa6292aa3d7fcadba55e9c (diff)
Nuke unused _[23]ltol() and _lto[23]l() inline functions. Move
_4ltol() and _lto4l() to bha, the only place they were used. ok dlg@
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/bhareg.h26
1 files changed, 23 insertions, 3 deletions
diff --git a/sys/dev/ic/bhareg.h b/sys/dev/ic/bhareg.h
index 4bf84004e09..d4c88d15b1d 100644
--- a/sys/dev/ic/bhareg.h
+++ b/sys/dev/ic/bhareg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bhareg.h,v 1.4 2008/09/01 17:30:56 deraadt Exp $ */
+/* $OpenBSD: bhareg.h,v 1.5 2012/07/01 01:41:13 krw Exp $ */
/* $NetBSD: bhareg.h,v 1.12 1998/08/17 00:26:33 mycroft Exp $ */
/*-
@@ -48,8 +48,28 @@
typedef u_int8_t physaddr[4];
typedef u_int8_t physlen[4];
-#define ltophys _lto4l
-#define phystol _4ltol
+
+static __inline void ltophys(u_int32_t val, u_int8_t *bytes);
+static __inline u_int32_t phystol(u_int8_t *bytes);
+
+static __inline void
+ltophys(u_int32_t val, u_int8_t *bytes)
+{
+ bytes[0] = val & 0xff;
+ bytes[1] = (val >> 8) & 0xff;
+ bytes[2] = (val >> 16) & 0xff;
+ bytes[3] = (val >> 24) & 0xff;
+}
+
+static __inline u_int32_t
+phystol(u_int8_t *bytes)
+{
+ u_int32_t rv;
+
+ rv = bytes[0] | (bytes[1] << 8) |
+ (bytes[2] << 16) | (bytes[3] << 24);
+ return (rv);
+ }
/*
* I/O port offsets