[prev in list] [next in list] [prev in thread] [next in thread]
List: bochs-cvs
Subject: [Bochs-cvs] [12086] trunk/bochs/iodev/network/e1000.cc
From: vruppert () users ! sourceforge ! net
Date: 2013-12-30 17:13:20
Message-ID: E1VxgP6-0004it-Hs () sfs-ml-1 ! v29 ! ch3 ! sourceforge ! com
[Download RAW message or body]
Revision: 12086
Author: vruppert
Date: 2013-12-30 17:13:18 +0000 (Mon, 30 Dec 2013)
Log Message:
-----------
Use data conversion macros based on bx_bswap* and remove temporary code
Modified Paths:
--------------
trunk/bochs/iodev/network/e1000.cc
Modified: trunk/bochs/iodev/network/e1000.cc
===================================================================
--- trunk/bochs/iodev/network/e1000.cc 2013-12-30 14:37:04 UTC (rev 12085)
+++ trunk/bochs/iodev/network/e1000.cc 2013-12-30 17:13:18 UTC (rev 12086)
@@ -358,33 +358,18 @@
delete theE1000Device;
}
-// temporary helper functions
-// we should use host from/to little endian conversion directly
+// macros and helper functions
-Bit16u cpu_to_le16(Bit16u value)
-{
- Bit16u hvalue;
+#if defined (BX_LITTLE_ENDIAN)
+#define cpu_to_le16(val) (val)
+#define cpu_to_le32(val) (val)
+#define cpu_to_le64(val) (val)
+#else
+#define cpu_to_le16(val) bx_bswap16(val)
+#define cpu_to_le32(val) bx_bswap32(val)
+#define cpu_to_le64(val) bx_bswap64(val)
+#endif
- WriteHostWordToLittleEndian(&hvalue, value);
- return hvalue;
-}
-
-Bit32u cpu_to_le32(Bit32u value)
-{
- Bit32u hvalue;
-
- WriteHostDWordToLittleEndian(&hvalue, value);
- return hvalue;
-}
-
-Bit64u cpu_to_le64(Bit64u value)
-{
- Bit64u hvalue;
-
- WriteHostQWordToLittleEndian(&hvalue, value);
- return hvalue;
-}
-
#define le16_to_cpu cpu_to_le16
#define le32_to_cpu cpu_to_le32
#define le64_to_cpu cpu_to_le64
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Bochs-cvs mailing list
Bochs-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bochs-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic