summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Makefile.housekeeping8
-rw-r--r--src/drivers/net/legacy.c8
2 files changed, 16 insertions, 0 deletions
diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping
index 3694402b..1e97ee62 100644
--- a/src/Makefile.housekeeping
+++ b/src/Makefile.housekeeping
@@ -102,6 +102,14 @@ CFLAGS += $(OLDGAS)
oldgas :
@$(ECHO) $(oldgas)
+# Some widespread patched versions of gcc include -fstack-protector by
+# default, even when -ffreestanding is specified. We therefore need
+# to disable -fstack-protector if the compiler supports it.
+#
+SP_TEST = $(CC) -fno-stack-protector -x c -E - < /dev/null >/dev/null 2>&1
+SP_FLAGS := $(shell $(SP_TEST) && $(ECHO) '-fno-stack-protector')
+CFLAGS += $(SP_FLAGS)
+
# compiler.h is needed for our linking and debugging system
#
CFLAGS += -include compiler.h
diff --git a/src/drivers/net/legacy.c b/src/drivers/net/legacy.c
index 9b82f1ca..32460adb 100644
--- a/src/drivers/net/legacy.c
+++ b/src/drivers/net/legacy.c
@@ -98,12 +98,20 @@ int legacy_probe ( void *hwdev,
netdev->dev = dev;
nic.node_addr = netdev->ll_addr;
+ nic.irqno = dev->desc.irq;
if ( ! probe ( &nic, hwdev ) ) {
rc = -ENODEV;
goto err_probe;
}
+ /* Overwrite the IRQ number. Some legacy devices set
+ * nic->irqno to 0 in the probe routine to indicate that they
+ * don't support interrupts; doing this allows the timer
+ * interrupt to be used instead.
+ */
+ dev->desc.irq = nic.irqno;
+
if ( ( rc = register_netdev ( netdev ) ) != 0 )
goto err_register;