This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] sim: bfin: drop old linux/mii.h workarounds
- From: Mike Frysinger <vapier at gentoo dot org>
- To: gdb-patches at sourceware dot org
- Date: Thu, 12 Apr 2012 20:48:27 -0400
- Subject: [PATCH] sim: bfin: drop old linux/mii.h workarounds
We had some workarounds for old linux/mii.h headers, but it breaks with
newer ones. So tweak the checks a bit to work with newer ones. We'll
worry about older systems once someone complains.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
Committed to the 7.4 branch
sim/bfin/ChangeLog | 8 ++++++++
sim/bfin/config.in | 21 ++++++---------------
sim/bfin/configure | 15 +++++++++++----
sim/bfin/configure.ac | 9 ++++++++-
sim/bfin/dv-eth_phy.c | 5 ++---
5 files changed, 35 insertions(+), 23 deletions(-)
2012-02-04 Mike Frysinger <vapier@gentoo.org>
* config.in: Regenerate.
* configure: Likewise.
* configure.ac: Add linux/types.h to AC_CHECK_HEADERS.
* dv-eth_phy.c: Check for HAVE_LINUX_TYPES_H, and delete __u16 and
_LINUX_TYPES_H defines.
diff --git a/sim/bfin/configure.ac b/sim/bfin/configure.ac
index 1917c01..cda3ac9 100644
--- a/sim/bfin/configure.ac
+++ b/sim/bfin/configure.ac
@@ -45,7 +45,14 @@ SIM_AC_OPTION_HARDWARE(yes,,\
)
AC_CHECK_FUNCS([getuid getgid geteuid getegid setuid setgid mmap munmap kill pread])
-AC_CHECK_HEADERS([sys/ioctl.h sys/mman.h net/if.h linux/if_tun.h linux/mii.h])
+AC_CHECK_HEADERS([ \
+ linux/if_tun.h \
+ linux/mii.h \
+ linux/types.h \
+ net/if.h \
+ sys/ioctl.h \
+ sys/mman.h \
+])
BFIN_SIM_EXTRA_OBJS=
diff --git a/sim/bfin/dv-eth_phy.c b/sim/bfin/dv-eth_phy.c
index f7d7172..e42b213 100644
--- a/sim/bfin/dv-eth_phy.c
+++ b/sim/bfin/dv-eth_phy.c
@@ -23,11 +23,10 @@
#include "sim-main.h"
#include "devices.h"
-#ifdef HAVE_LINUX_MII_H
+#if defined (HAVE_LINUX_MII_H) && defined (HAVE_LINUX_TYPES_H)
/* Workaround old/broken linux headers. */
-#define _LINUX_TYPES_H
-#define __u16 unsigned short
+#include <linux/types.h>
#include <linux/mii.h>
#define REG_PHY_SIZE 0x20
--
1.7.8.5