summaryrefslogtreecommitdiffstats
path: root/c/src
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-07-24 16:09:51 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-07-24 16:09:51 +0000
commitdbab462feb1583107babd74b02339bb9a5ad3820 (patch)
treea969c75ad8185e47be35e72f0cbdfca3114e040c /c/src
parent1501809c67000d1d10be53d4520e0cd3d159c5b9 (diff)
downloadrtems-dbab462feb1583107babd74b02339bb9a5ad3820.tar.bz2
Patch from Eric Valette <valette@crf.canon.fr> and Emmanuel Raguet
<raguet@crf.canon.fr> to make their patches work together.
Diffstat (limited to 'c/src')
-rw-r--r--c/src/lib/libbsp/i386/pc386/Makefile.in6
-rw-r--r--c/src/lib/libbsp/i386/pc386/include/Makefile.in7
-rw-r--r--c/src/lib/libbsp/i386/pc386/network/network.c117
-rw-r--r--c/src/lib/libbsp/i386/pc386/start/Makefile.in6
-rw-r--r--c/src/lib/libbsp/i386/pc386/startup/Makefile.in6
-rw-r--r--c/src/lib/libbsp/i386/shared/irq/irq_init.c4
-rw-r--r--c/src/lib/wrapup/Makefile.in1
-rw-r--r--c/src/tests/samples/Makefile.in13
-rw-r--r--c/src/wrapup/Makefile.in1
9 files changed, 96 insertions, 65 deletions
diff --git a/c/src/lib/libbsp/i386/pc386/Makefile.in b/c/src/lib/libbsp/i386/pc386/Makefile.in
index 426b5a6dbe..92963be422 100644
--- a/c/src/lib/libbsp/i386/pc386/Makefile.in
+++ b/c/src/lib/libbsp/i386/pc386/Makefile.in
@@ -11,7 +11,11 @@ PROJECT_ROOT = @PROJECT_ROOT@
include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
include $(RTEMS_ROOT)/make/directory.cfg
+# We only build the Network library if HAS_KA9Q was defined
+NETWORK_yes_V = network
+NETWORK = $(NETWORK_$(HAS_KA9Q)_V)
+
# wrapup is the one that actually builds and installs the library
# from the individual .rel files built in other directories
-SUB_DIRS=include tools start startup clock console timer pc386dev network \
+SUB_DIRS=include tools start startup clock console timer pc386dev $(NETWORK) \
wrapup
diff --git a/c/src/lib/libbsp/i386/pc386/include/Makefile.in b/c/src/lib/libbsp/i386/pc386/include/Makefile.in
index 653bab5067..0af71afba1 100644
--- a/c/src/lib/libbsp/i386/pc386/include/Makefile.in
+++ b/c/src/lib/libbsp/i386/pc386/include/Makefile.in
@@ -8,8 +8,13 @@ VPATH = @srcdir@
RTEMS_ROOT = @top_srcdir@
PROJECT_ROOT = @PROJECT_ROOT@
+# We only install wd80x3.h if HAS_KA9Q was defined
+WD80X3_yes_V = $(srcdir)/wd80x3.h
+WD80X3 = $(WD80X3_$(HAS_KA9Q)_V)
+
H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h $(srcdir)/crt.h \
- $(srcdir)/pc386uart.h $(srcdir)/pcibios.h $(srcdir)/wd80x3.h
+ $(srcdir)/pc386uart.h $(srcdir)/pcibios.h \
+ $(WD80X3)
#
# Equate files are for including from assembly preprocessed by
diff --git a/c/src/lib/libbsp/i386/pc386/network/network.c b/c/src/lib/libbsp/i386/pc386/network/network.c
index a37b9cf88c..4dd718fb79 100644
--- a/c/src/lib/libbsp/i386/pc386/network/network.c
+++ b/c/src/lib/libbsp/i386/pc386/network/network.c
@@ -15,7 +15,7 @@
#include <ka9q/trace.h>
#include <ka9q/commands.h>
#include <ka9q/domain.h>
-#include "irq.h"
+#include <irq.h>
#define ET_MINLEN 60 /* minimum message length */
@@ -49,41 +49,41 @@
* Hardware-specific storage
*/
typedef struct {
- struct mbuf **rxMbuf;
- struct mbuf **txMbuf;
- unsigned int port;
- char *base;
- unsigned long bpar;
- unsigned int irno;
- int rxBdCount;
- int txBdCount;
- int txBdHead;
- int txBdTail;
- int txBdActiveCount;
- struct iface *iface;
- rtems_id txWaitTid;
+ rtems_irq_connect_data irqInfo;
+ struct mbuf **rxMbuf;
+ struct mbuf **txMbuf;
+ unsigned int port;
+ unsigned char *base;
+ unsigned long bpar;
+ int rxBdCount;
+ int txBdCount;
+ int txBdHead;
+ int txBdTail;
+ int txBdActiveCount;
+ struct iface *iface;
+ rtems_id txWaitTid;
/*
* Statistics
*/
- unsigned long rxInterrupts;
- unsigned long rxNotFirst;
- unsigned long rxNotLast;
- unsigned long rxGiant;
- unsigned long rxNonOctet;
- unsigned long rxRunt;
- unsigned long rxBadCRC;
- unsigned long rxOverrun;
- unsigned long rxCollision;
+ unsigned long rxInterrupts;
+ unsigned long rxNotFirst;
+ unsigned long rxNotLast;
+ unsigned long rxGiant;
+ unsigned long rxNonOctet;
+ unsigned long rxRunt;
+ unsigned long rxBadCRC;
+ unsigned long rxOverrun;
+ unsigned long rxCollision;
- unsigned long txInterrupts;
- unsigned long txDeferred;
- unsigned long txHeartbeat;
- unsigned long txLateCollision;
- unsigned long txRetryLimit;
- unsigned long txUnderrun;
- unsigned long txLostCarrier;
- unsigned long txRawWait;
+ unsigned long txInterrupts;
+ unsigned long txDeferred;
+ unsigned long txHeartbeat;
+ unsigned long txLateCollision;
+ unsigned long txRetryLimit;
+ unsigned long txUnderrun;
+ unsigned long txLostCarrier;
+ unsigned long txRawWait;
}wd80x3EnetDriver;
#define RO 0x10
@@ -98,10 +98,12 @@ static unsigned long loopc;
static wd80x3EnetDriver wd8003EnetDriver[NSCCDRIVER];
/*
- * WD8003 interrupt handler
+ * WD8003 interrupt handler. The code as it is cleraly showes that
+ * only one driver is connected. In order to change this a table
+ * making the correspondance between the current irq number and
+ * the corresponding wd8003EnetDriver structure could be used...
*/
-static rtems_isr
-wd8003Enet_interrupt_handler (rtems_vector_number v)
+static void wd8003Enet_interrupt_handler ()
{
unsigned int tport, nowTicks, bootTicks;
unsigned char status, status2;
@@ -116,10 +118,6 @@ wd8003Enet_interrupt_handler (rtems_vector_number v)
tport = wd8003EnetDriver[0].port ;
- PC386_disableIrq(wd8003EnetDriver[0].irno);
- PC386_ackIrq(wd8003EnetDriver[0].irno);
- asm volatile("sti");
-
/*
* Drop chips interrupt
*/
@@ -195,9 +193,19 @@ wd8003Enet_interrupt_handler (rtems_vector_number v)
* Enable chip interrupts
*/
outport_byte(tport+IMR, 0x15);
- asm volatile("cli");
- PC386_enableIrq(wd8003EnetDriver[0].irno);
-
+}
+
+static void nopOn(const rtems_irq_connect_data* notUsed)
+{
+ /*
+ * code should be moved from wd8003Enet_initialize_hardware
+ * to this location
+ */
+}
+
+static int wdIsOn(const rtems_irq_connect_data* irq)
+{
+ return pc386_irq_enabled_at_i8259s (irq->name);
}
/*
@@ -273,10 +281,15 @@ wd8003Enet_initialize_hardware (wd80x3EnetDriver *dp, int broadcastFlag)
/*
* Set up interrupts
*/
- sc = PC386_installRtemsIrqHandler(dp->irno, wd8003Enet_interrupt_handler);
- if (sc != RTEMS_SUCCESSFUL)
- rtems_panic ("Can't attach interrupt handler: %s\n",
- rtems_status_text (sc));
+ dp->irqInfo.hdl = wd8003Enet_interrupt_handler;
+ dp->irqInfo.on = nopOn;
+ dp->irqInfo.off = nopOn;
+ dp->irqInfo.isOn = wdIsOn;
+
+ sc = pc386_install_rtems_irq_handler (&dp->irqInfo);
+ if (!sc)
+ rtems_panic ("Can't attach WD interrupt handler for irq %d\n",
+ dp->irqInfo.name);
}
@@ -458,9 +471,9 @@ rtems_ka9q_driver_attach (int argc, char *argv[], void *p)
dp->txWaitTid = 0;
dp->rxBdCount = RX_BUF_COUNT;
dp->txBdCount = TX_BUF_COUNT * TX_BD_PER_BUF;
- dp->irno = 5;
+ dp->irqInfo.name = (rtems_irq_symbolic_name) 5;
dp->port = 0x240;
- dp->base = 0xD0000;
+ dp->base = (unsigned char*) 0xD0000;
dp->bpar = 0xD0000;
iface->mtu = 1500;
iface->addr = Ip_addr;
@@ -492,14 +505,14 @@ rtems_ka9q_driver_attach (int argc, char *argv[], void *p)
gether (iface->hwaddr, argv[argIndex]);
}
else if (strcmp ("irno", argv[argIndex]) == 0) {
- dp->irno = atoi (argv[++argIndex]);
+ dp->irqInfo.name = (rtems_irq_symbolic_name) atoi (argv[++argIndex]);
}
else if (strcmp ("port", argv[argIndex]) == 0) {
sscanf(argv[++argIndex], "%x", &(dp->port));
}
else if (strcmp ("bpar", argv[argIndex]) == 0) {
- sscanf(argv[++argIndex], "%x", &(dp->bpar));
- dp->base = (char *)(dp->bpar);
+ sscanf(argv[++argIndex], "%x", (unsigned) &(dp->bpar));
+ dp->base = (unsigned char *)(dp->bpar);
}
else {
printf ("Argument %d (%s) is invalid.\n", argIndex, argv[argIndex]);
@@ -508,8 +521,8 @@ rtems_ka9q_driver_attach (int argc, char *argv[], void *p)
}
printf ("Ethernet address: %s\n", pether (cbuf, iface->hwaddr));
printf ("Internet address: %s\n", inet_ntoa(iface->addr));
- printf ("Irno: %X, port: %X, bpar: %X, base: %X\n",dp->irno, dp->port,
- dp->bpar, dp->base);
+ printf ("Irno: %X, port: %X, bpar: %X, base: %X\n",dp->irqInfo.name, dp->port,
+ (unsigned) dp->bpar, (unsigned) dp->base);
fflush(stdout);
/*
* Fill in remainder of interface configuration
diff --git a/c/src/lib/libbsp/i386/pc386/start/Makefile.in b/c/src/lib/libbsp/i386/pc386/start/Makefile.in
index 10e4b70448..1f4aacfc86 100644
--- a/c/src/lib/libbsp/i386/pc386/start/Makefile.in
+++ b/c/src/lib/libbsp/i386/pc386/start/Makefile.in
@@ -64,7 +64,7 @@ ${ARCH}/start16.o: start16.s
$(AS) $(ASFLAGS) -o $@ $*.i
${ARCH}/start16.bin: ${ARCH}/start16.o
- $(LD) -N -T $(LINKCMDS) -Ttext $(START16ADDR) -e start16 -nostdlib \
+ - $(LD) -N -T $(LINKCMDS) -Ttext $(START16ADDR) -e start16 -nostdlib \
--oformat=elf32-i386 -o $(basename $@).obj $(basename $@).o
- $(OBJCOPY) -O binary $(basename $@).obj $@
-
+ - $(OBJCOPY) -O binary $(basename $@).obj $@
+ cp $(basename $@).o $(basename $@).bin
diff --git a/c/src/lib/libbsp/i386/pc386/startup/Makefile.in b/c/src/lib/libbsp/i386/pc386/startup/Makefile.in
index a4fe0e4cb2..0cf32409d4 100644
--- a/c/src/lib/libbsp/i386/pc386/startup/Makefile.in
+++ b/c/src/lib/libbsp/i386/pc386/startup/Makefile.in
@@ -10,6 +10,9 @@ PROJECT_ROOT = @PROJECT_ROOT@
PGM=${ARCH}/startup.rel
+IMPORT_SRC=$(srcdir)/../../shared/irq/irq.c \
+ $(srcdir)/../../shared/irq/irq_init.c $(srcdir)/../../shared/irq/irq_asm.s
+
# C source names, if any, go here -- minus the .c
C_PIECES=bspclean bsplibc bsppost bspstart exit irq irq_init main sbrk
C_FILES=$(C_PIECES:%=%.c)
@@ -50,9 +53,6 @@ LDFLAGS +=
CLEAN_ADDITIONS +=
CLOBBER_ADDITIONS +=
-IMPORT_SRC=$(srcdir)/../../shared/irq/irq.c \
- $(srcdir)/../../shared/irq/irq_init.c $(srcdir)/../../shared/irq/irq_asm.s
-
preinstall:
${CP} ${IMPORT_SRC} .
diff --git a/c/src/lib/libbsp/i386/shared/irq/irq_init.c b/c/src/lib/libbsp/i386/shared/irq/irq_init.c
index 0910bdef56..3f57cf1107 100644
--- a/c/src/lib/libbsp/i386/shared/irq/irq_init.c
+++ b/c/src/lib/libbsp/i386/shared/irq/irq_init.c
@@ -177,7 +177,9 @@ void rtems_irq_mngt_init()
while (1);
}
-#define DEBUG
+ /*
+ * #define DEBUG
+ */
#ifdef DEBUG
{
/*
diff --git a/c/src/lib/wrapup/Makefile.in b/c/src/lib/wrapup/Makefile.in
index 04a12300d5..bef0aa637b 100644
--- a/c/src/lib/wrapup/Makefile.in
+++ b/c/src/lib/wrapup/Makefile.in
@@ -16,7 +16,6 @@ include $(RTEMS_ROOT)/make/lib.cfg
LIB=$(PROJECT_RELEASE)/lib/librtemsall${LIB_VARIANT}.a
SRCS=$(wildcard $(PROJECT_RELEASE)/lib/libbsp$(LIB_VARIANT).a) \
- $(PROJECT_RELEASE)/lib/libcpu$(LIB_VARIANT).a \
$(PROJECT_RELEASE)/lib/librtems$(LIB_VARIANT).a \
$(wildcard $(PROJECT_RELEASE)/lib/libposix$(LIB_VARIANT).a) \
$(wildcard $(PROJECT_RELEASE)/lib/libka9q$(LIB_VARIANT).a) \
diff --git a/c/src/tests/samples/Makefile.in b/c/src/tests/samples/Makefile.in
index 5a3c9a4034..571f7c3f3b 100644
--- a/c/src/tests/samples/Makefile.in
+++ b/c/src/tests/samples/Makefile.in
@@ -17,6 +17,13 @@ include $(RTEMS_ROOT)/make/directory.cfg
CPLUSPLUS_TESTS_yes_V = cdtest
CPLUSPLUS_TESTS = $(CPLUSPLUS_TESTS_$(HAS_CPLUSPLUS)_V)
+# We only build the sockets tests if HAS_KA9Q was defined
+SOCKET_yes_V = socket
+SOCKET = $(SOCKET_$(HAS_KA9Q)_V)
+
+HOSTSOCKET_yes_V = socket/pgmHost
+HOSTSOCKET = $(HOSTSOCKET_$(HAS_KA9Q)_V)
+
# base_mp is a sample multiprocessing test
# We only build it if HAS_MP was defined
@@ -25,6 +32,8 @@ MP_TESTS = $(MP_TESTS_$(HAS_MP)_V)
FP_TESTS = paranoia
-# socket socket/pgmHost
-SUB_DIRS=hello ticker base_sp
+SUB_DIRS=hello ticker base_sp $(HOSTSOCKET) $(SOCKET) \
$(MP_TESTS) $(CPLUSPLUS_TESTS) $(FP_TESTS)
+
+
+
diff --git a/c/src/wrapup/Makefile.in b/c/src/wrapup/Makefile.in
index 04a12300d5..bef0aa637b 100644
--- a/c/src/wrapup/Makefile.in
+++ b/c/src/wrapup/Makefile.in
@@ -16,7 +16,6 @@ include $(RTEMS_ROOT)/make/lib.cfg
LIB=$(PROJECT_RELEASE)/lib/librtemsall${LIB_VARIANT}.a
SRCS=$(wildcard $(PROJECT_RELEASE)/lib/libbsp$(LIB_VARIANT).a) \
- $(PROJECT_RELEASE)/lib/libcpu$(LIB_VARIANT).a \
$(PROJECT_RELEASE)/lib/librtems$(LIB_VARIANT).a \
$(wildcard $(PROJECT_RELEASE)/lib/libposix$(LIB_VARIANT).a) \
$(wildcard $(PROJECT_RELEASE)/lib/libka9q$(LIB_VARIANT).a) \