diff --git a/bochs/iodev/crc32.cc b/bochs/iodev/crc32.cc index 830457453..1632065ca 100644 --- a/bochs/iodev/crc32.cc +++ b/bochs/iodev/crc32.cc @@ -14,7 +14,7 @@ void CRC_Generator::init(void) { int j; crc32_table[i]=reflect(i,8) << 24; for(j=0; j<8; j++) - crc32_table[i] = (crc32_table[i]<<1)^(crc_table[i] & (1<<31) ? POLYNOMIAL : 0); + crc32_table[i] = (crc32_table[i]<<1)^(crc32_table[i] & (1<<31) ? POLYNOMIAL : 0); crc32_table[i] = reflect(crc32_table[i], 32); } } diff --git a/bochs/iodev/crc32.h b/bochs/iodev/crc32.h index 0c2a30e28..216eccf7d 100644 --- a/bochs/iodev/crc32.h +++ b/bochs/iodev/crc32.h @@ -5,6 +5,8 @@ #ifndef _CRC_32_H_ #define _CRC_32_H_ +#include "bochs.h" + class CRC_Generator { private: Bit32u crc32_table[256]; @@ -13,7 +15,7 @@ public: void init(void); CRC_Generator(); Bit32u get_CRC(Bit8u * buf, Bit32u buflen); -} +}; #endif //_CRC_32_H_ diff --git a/bochs/iodev/eth.cc b/bochs/iodev/eth.cc index 1dd11edd3..6bc91d0cc 100644 --- a/bochs/iodev/eth.cc +++ b/bochs/iodev/eth.cc @@ -41,6 +41,22 @@ eth_locator_c::eth_locator_c(const char *type) this->type = type; } +#ifdef ETH_NULL +extern class bx_null_locator_c bx_null_match; +#endif +#ifdef ETH_FBSD +extern class bx_fbsd_locator_c bx_fbsd_match; +#endif +#ifdef ETH_LINUX +extern class bx_linux_locator_c bx_linux_match; +#endif +#ifdef ETH_TEST +extern bx_test_match; +#endif +#ifdef ETH_ARPBACK +extern class bx_arpback_locator_c bx_arpback_match; +#endif + // // Called by ethernet chip emulations to locate and create a pktmover // object @@ -58,30 +74,32 @@ eth_locator_c::create(const char *type, const char *netif, #else eth_locator_c *ptr = 0; +#ifdef ETH_ARPBACK + { + if (!strcmp(type, "arpback")) + ptr = (eth_locator_c *) &bx_arpback_match; + } +#endif #ifdef ETH_NULL { - extern class bx_null_locator_c bx_null_match; if (!strcmp(type, "null")) ptr = (eth_locator_c *) &bx_null_match; } #endif #ifdef ETH_FBSD { - extern class bx_fbsd_locator_c bx_fbsd_match; if (!strcmp(type, "fbsd")) ptr = (eth_locator_c *) &bx_fbsd_match; } #endif #ifdef ETH_LINUX { - extern class bx_linux_locator_c bx_linux_match; if (!strcmp(type, "linux")) ptr = (eth_locator_c *) &bx_linux_match; } #endif #ifdef ETH_TEST { - extern bx_test_match; if (!strcmp(type, "test")) ptr = (eth_locator_c *) &bx_test_match; } diff --git a/bochs/iodev/eth_fbsd.cc b/bochs/iodev/eth_fbsd.cc index 3afa65d0e..bc6173f6d 100644 --- a/bochs/iodev/eth_fbsd.cc +++ b/bochs/iodev/eth_fbsd.cc @@ -45,6 +45,7 @@ // #include "bochs.h" +#ifdef ETH_FBSD #define LOG_THIS this-> extern "C" { @@ -282,3 +283,5 @@ bx_fbsd_pktmover_c::rx_timer(void) } } } +#endif +