[Mit-cadr-cvs] r297 - trunk/emulator/usim
bparker at common-lisp.net
bparker at common-lisp.net
Fri Sep 23 00:58:45 UTC 2011
Author: bparker
Date: Thu Sep 22 17:58:44 2011
New Revision: 297
Log:
minor fixups for linux
Modified:
trunk/emulator/usim/Makefile
trunk/emulator/usim/ether.c
Modified: trunk/emulator/usim/Makefile
==============================================================================
--- trunk/emulator/usim/Makefile Thu Sep 22 17:52:29 2011 (r296)
+++ trunk/emulator/usim/Makefile Thu Sep 22 17:58:44 2011 (r297)
@@ -74,7 +74,7 @@
#CFLAGS= -O3 -march=pentium3 -mfpmath=sse -mmmx -msse $(DEFINES) -Walle
#CFLAGS = -O3 -fomit-frame-pointer -mcpu=i686 -g $(DEFINES)
#CFLAGS= -O3 -mfpmath=sse -mmmx -msse $(DEFINES) -Walle
-CFLAGS = -O3 -mfpmath=sse -mmmx -msse $(DEFINES) -Walle $(M32) -g
+CFLAGS = -O3 -mfpmath=sse -mmmx -msse $(DEFINES) $(M32) -g
LFLAGS = $(M32) -L/usr/lib
endif
Modified: trunk/emulator/usim/ether.c
==============================================================================
--- trunk/emulator/usim/ether.c Thu Sep 22 17:52:29 2011 (r296)
+++ trunk/emulator/usim/ether.c Thu Sep 22 17:58:44 2011 (r297)
@@ -20,6 +20,9 @@
#if defined(LINUX) || defined(OSX) || defined(BSD)
#include <sys/time.h>
+#define uint8_t __uint8_t
+#define uint16_t __uint16_t
+#define uint32_t __uint32_t
#endif
#if defined(BSD)
@@ -177,10 +180,12 @@
if (status & ETHER_DESC_TX_PAD)
len = MAX(len, 60);
+#ifdef BSD
ret = write(tap_fd, packet, len);
if (ret != len) {
perror("write");
}
+#endif
status &= ~ETHER_DESC_TX_READY;
descs.desc_structs[i].status = status;
@@ -197,7 +202,11 @@
for (i = tx_bd_num; i < 0x80; i++) {
status = descs.desc_structs[i].status;
if (status & ETHER_DESC_RX_EMPTY) {
+#ifdef BSD
len = read(tap_fd, packet, sizeof(packet));
+#else
+ len = -1;
+#endif
if (len == -1) break;
ptr = descs.desc_structs[i].ptr;
More information about the mit-cadr-cvs
mailing list