summaryrefslogtreecommitdiffstats
path: root/c/src
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-08-20 22:04:22 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-08-20 22:04:22 +0000
commit28e7d7faed355e451cc8b0c037035dfcf873a965 (patch)
tree45cde8cd69057225747646a9ad80abba592ae710 /c/src
parent96b391640969faf193911e1ed3c9d7026ae8867b (diff)
downloadrtems-28e7d7faed355e451cc8b0c037035dfcf873a965.tar.bz2
Patches from Eric Norum
Diffstat (limited to 'c/src')
-rw-r--r--c/src/exec/libnetworking/arpa/inet.h2
-rw-r--r--c/src/exec/libnetworking/rtems/rtems_syscall.c20
-rw-r--r--c/src/exec/score/cpu/i386/cpu.h26
-rw-r--r--c/src/exec/score/headers/Makefile.in4
-rw-r--r--c/src/exec/score/include/rtems/score/Makefile.in4
-rw-r--r--c/src/lib/Makefile.in6
-rw-r--r--c/src/lib/include/Makefile.in13
-rw-r--r--c/src/lib/libbsp/bare/README2
-rw-r--r--c/src/lib/libbsp/bare/do-bare-bsp-build2
-rw-r--r--c/src/lib/libbsp/i386/pc386/Makefile.in4
-rw-r--r--c/src/lib/libbsp/i386/pc386/include/Makefile.in7
-rw-r--r--c/src/lib/libbsp/i386/pc386/network/network.c2
-rw-r--r--c/src/lib/libbsp/i386/pc386/wrapup/Makefile.in4
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/Makefile.in6
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/README2
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/include/bsp.h8
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/wrapup/Makefile.in6
-rw-r--r--c/src/lib/libnetworking/arpa/inet.h2
-rw-r--r--c/src/lib/libnetworking/rtems/rtems_syscall.c20
-rw-r--r--c/src/lib/wrapup/Makefile.in1
-rw-r--r--c/src/libnetworking/arpa/inet.h2
-rw-r--r--c/src/libnetworking/rtems/rtems_syscall.c20
-rw-r--r--c/src/make/compilers/gcc-target-default.cfg8
-rw-r--r--c/src/wrapup/Makefile.in1
24 files changed, 108 insertions, 64 deletions
diff --git a/c/src/exec/libnetworking/arpa/inet.h b/c/src/exec/libnetworking/arpa/inet.h
index fb95ee288a..ad5332e7ab 100644
--- a/c/src/exec/libnetworking/arpa/inet.h
+++ b/c/src/exec/libnetworking/arpa/inet.h
@@ -65,6 +65,7 @@
struct in_addr;
+#if 0 /* RTEMS -- Why rename these? */
/* XXX all new diversions!! argh!! */
#define inet_addr __inet_addr
#define inet_aton __inet_aton
@@ -80,6 +81,7 @@ struct in_addr;
#define inet_ntop __inet_ntop
#define inet_nsap_addr __inet_nsap_addr
#define inet_nsap_ntoa __inet_nsap_ntoa
+#endif
__BEGIN_DECLS
int ascii2addr __P((int, const char *, void *));
diff --git a/c/src/exec/libnetworking/rtems/rtems_syscall.c b/c/src/exec/libnetworking/rtems/rtems_syscall.c
index 794b8d3d8e..a526eb2254 100644
--- a/c/src/exec/libnetworking/rtems/rtems_syscall.c
+++ b/c/src/exec/libnetworking/rtems/rtems_syscall.c
@@ -617,8 +617,8 @@ getsockopt (int s, int level, int name, void *aval, int *avalsize)
return 0;
}
-int
-getpeername (int s, struct sockaddr *name, int *namelen)
+static int
+getpeersockname (int s, struct sockaddr *name, int *namelen, int pflag)
{
struct socket *so;
struct mbuf *m;
@@ -636,7 +636,10 @@ getpeername (int s, struct sockaddr *name, int *namelen)
rtems_bsdnet_semaphore_release ();
return -1;
}
- error = (*so->so_proto->pr_usrreqs->pru_peeraddr)(so, m);
+ if (pflag)
+ error = (*so->so_proto->pr_usrreqs->pru_peeraddr)(so, m);
+ else
+ error = (*so->so_proto->pr_usrreqs->pru_sockaddr)(so, m);
if (error) {
errno = error;
rtems_bsdnet_semaphore_release ();
@@ -652,6 +655,17 @@ getpeername (int s, struct sockaddr *name, int *namelen)
return 0;
}
+int
+getpeername (int s, struct sockaddr *name, int *namelen)
+{
+ return getpeersockname (s, name, namelen, 1);
+}
+int
+getsockname (int s, struct sockaddr *name, int *namelen)
+{
+ return getpeersockname (s, name, namelen, 0);
+}
+
/*
************************************************************************
* RTEMS EXTERNAL I/O HANDLER ROUTINES *
diff --git a/c/src/exec/score/cpu/i386/cpu.h b/c/src/exec/score/cpu/i386/cpu.h
index 7af6bebfad..1b6053912a 100644
--- a/c/src/exec/score/cpu/i386/cpu.h
+++ b/c/src/exec/score/cpu/i386/cpu.h
@@ -64,11 +64,23 @@ extern "C" {
#define CPU_IDLE_TASK_IS_FP FALSE
#define CPU_USE_DEFERRED_FP_SWITCH TRUE
-#define CPU_PROVIDES_IDLE_THREAD_BODY TRUE
#define CPU_STACK_GROWS_UP FALSE
#define CPU_STRUCTURE_ALIGNMENT
/*
+ * Does this port provide a CPU dependent IDLE task implementation?
+ *
+ * If TRUE, then the routine _CPU_Thread_Idle_body
+ * must be provided and is the default IDLE thread body instead of
+ * _CPU_Thread_Idle_body.
+ *
+ * If FALSE, then use the generic IDLE thread body if the BSP does
+ * not provide one.
+ */
+
+#define CPU_PROVIDES_IDLE_THREAD_BODY TRUE
+
+/*
* Define what is required to specify how the network to host conversion
* routines are handled.
*/
@@ -385,6 +397,18 @@ void _CPU_ISR_install_vector(
);
/*
+ * _CPU_Thread_Idle_body
+ *
+ * Use the halt instruction of low power mode of a particular i386 model.
+ */
+
+#if (CPU_PROVIDES_IDLE_THREAD_BODY == TRUE)
+
+void _CPU_Thread_Idle_body( void );
+
+#endif /* CPU_PROVIDES_IDLE_THREAD_BODY */
+
+/*
* _CPU_Context_switch
*
* This routine switches from the run context to the heir context.
diff --git a/c/src/exec/score/headers/Makefile.in b/c/src/exec/score/headers/Makefile.in
index 225f7e5bab..920e738c03 100644
--- a/c/src/exec/score/headers/Makefile.in
+++ b/c/src/exec/score/headers/Makefile.in
@@ -23,9 +23,6 @@ SAPI_H_FILES=$(SAPI_H_PIECES:%=$(srcdir)/%.h)
EXTERNAL_H_PIECES =
EXTERNAL_H_FILES=$(EXTERNAL_H_PIECES:%=$(srcdir)/%.h)
-NET_H_PIECES = in
-NET_H_FILES=$(NET_H_PIECES:%=$(srcdir)/%.h)
-
SRCS=$(H_FILES) $(SAPI_H_FILES) $(EXTERNAL_H_FILES)
include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
@@ -44,5 +41,4 @@ CLOBBER_ADDITIONS +=
all: $(SRCS)
$(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems/score
$(INSTALL) -m 444 ${SAPI_H_FILES} $(PROJECT_INCLUDE)/rtems/
- $(INSTALL) -m 444 ${NET_H_FILES} $(PROJECT_INCLUDE)/netinet
# $(INSTALL) -m 444 ${EXTERNAL_H_FILES} $(PROJECT_INCLUDE)
diff --git a/c/src/exec/score/include/rtems/score/Makefile.in b/c/src/exec/score/include/rtems/score/Makefile.in
index 225f7e5bab..920e738c03 100644
--- a/c/src/exec/score/include/rtems/score/Makefile.in
+++ b/c/src/exec/score/include/rtems/score/Makefile.in
@@ -23,9 +23,6 @@ SAPI_H_FILES=$(SAPI_H_PIECES:%=$(srcdir)/%.h)
EXTERNAL_H_PIECES =
EXTERNAL_H_FILES=$(EXTERNAL_H_PIECES:%=$(srcdir)/%.h)
-NET_H_PIECES = in
-NET_H_FILES=$(NET_H_PIECES:%=$(srcdir)/%.h)
-
SRCS=$(H_FILES) $(SAPI_H_FILES) $(EXTERNAL_H_FILES)
include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
@@ -44,5 +41,4 @@ CLOBBER_ADDITIONS +=
all: $(SRCS)
$(INSTALL) -m 444 ${H_FILES} $(PROJECT_INCLUDE)/rtems/score
$(INSTALL) -m 444 ${SAPI_H_FILES} $(PROJECT_INCLUDE)/rtems/
- $(INSTALL) -m 444 ${NET_H_FILES} $(PROJECT_INCLUDE)/netinet
# $(INSTALL) -m 444 ${EXTERNAL_H_FILES} $(PROJECT_INCLUDE)
diff --git a/c/src/lib/Makefile.in b/c/src/lib/Makefile.in
index 7f71ba0b55..271ba5f8b7 100644
--- a/c/src/lib/Makefile.in
+++ b/c/src/lib/Makefile.in
@@ -11,10 +11,6 @@ PROJECT_ROOT = @PROJECT_ROOT@
include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
include $(RTEMS_ROOT)/make/directory.cfg
-# We only build the KA9Q library if HAS_KA9Q was defined
-LIBKA9Q_yes_V = libka9q
-LIBKA9Q = $(LIBKA9Q_$(HAS_KA9Q)_V)
-
# We only build the networking library if HAS_NETWORKING was defined
LIBNETWORKING_yes_V = libnetworking
LIBNETWORKING = $(LIBNETWORKING_$(HAS_NETWORKING)_V)
@@ -29,4 +25,4 @@ LIBRTEMSCPLUSPLUS = $(LIBRTEMSCPLUSPLUS_$(HAS_CPLUSPLUS)_V)
LIBHWAPI=$(wildcard libhwapi)
SUB_DIRS=start include $(NETWORKING_INCLUDE) libmisc libc libcpu libbsp \
- $(LIBKA9Q) $(LIBNETWORKING) $(LIBHWAPI) $(LIBRTEMSCPLUSPLUS) wrapup
+ $(LIBNETWORKING) $(LIBHWAPI) $(LIBRTEMSCPLUSPLUS) wrapup
diff --git a/c/src/lib/include/Makefile.in b/c/src/lib/include/Makefile.in
index e6bf04b675..4d5aef8a89 100644
--- a/c/src/lib/include/Makefile.in
+++ b/c/src/lib/include/Makefile.in
@@ -15,14 +15,6 @@ H_FILES=$(H_PIECES:%=$(srcdir)/%.h)
SYS_H_PIECES=termios
SYS_H_FILES=$(SYS_H_PIECES:%=$(srcdir)/sys/%.h)
-KA9Q_H_PIECES= arp asy ax25 ax25mail bootp cmdparse commands config \
- daemon dialer domain enet ftp ftpcli global hardware icmp iface \
- internet ip kiss lapb lzw mailbox mbuf netuser nospc nr4 nr4mail \
- nrs ping pktdrvr ppp proc rip rtems_ka9q sb session slhc slip smtp \
- sockaddr SyslogDaemon syslog socket tcp telnet tftp timer tipmail \
- trace udp usock
-KA9Q_H_FILES=$(KA9Q_H_PIECES:%=$(srcdir)/ka9q/%.h)
-
MOTOROLA_H_PIECES=mc68230 mc68681
MOTOROLA_H_FILES=$(MOTOROLA_H_PIECES:%=$(srcdir)/motorola/%.h)
@@ -34,7 +26,7 @@ RTEMSCPLUSPLUS_H_PIECES= rtemsEvent rtemsInterrupt rtemsMessageQueue \
RTEMSCPLUSPLUS_H_FILES=$(RTEMSCPLUSPLUS_H_PIECES:%=$(srcdir)/rtems++/%.h)
SRCS=$(H_FILES) $(SYS_H_FILES) \
- $(KA9Q_H_FILES) $(MOTOROLA_H_FILES) $(RTEMSCPLUSPLUS_H_FILES)
+ $(MOTOROLA_H_FILES) $(RTEMSCPLUSPLUS_H_FILES)
include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
include $(RTEMS_ROOT)/make/leaf.cfg
@@ -47,9 +39,6 @@ all: $(SRCS)
$(INSTALL) -m 444 $(MOTOROLA_H_FILES) \
$(PROJECT_INCLUDE)/motorola
$(INSTALL) -m 444 $(ZILOG_H_FILES) $(PROJECT_INCLUDE)/zilog
-ifeq ($(HAS_KA9Q),yes)
- $(INSTALL) -m 444 $(KA9Q_H_FILES) $(PROJECT_INCLUDE)/ka9q
-endif
ifeq ($(HAS_CPLUSPLUS),yes)
$(INSTALL) -m 444 $(RTEMSCPLUSPLUS_H_FILES) $(PROJECT_INCLUDE)/rtems++
endif
diff --git a/c/src/lib/libbsp/bare/README b/c/src/lib/libbsp/bare/README
index 11362253b0..f2d43f974d 100644
--- a/c/src/lib/libbsp/bare/README
+++ b/c/src/lib/libbsp/bare/README
@@ -82,7 +82,7 @@
# --enable-gmake-print-directory \
# --disable-tests \
# --disable-posix \
-# --enable-ka9q \
+# --enable-networking \
# --enable-bare-cpu-cflags=-mcpu32 \
# --enable-bare-cpu-model=mcpu32 \
# --enable-rtemsbsp=bare
diff --git a/c/src/lib/libbsp/bare/do-bare-bsp-build b/c/src/lib/libbsp/bare/do-bare-bsp-build
index 6449756405..16da69e0fe 100644
--- a/c/src/lib/libbsp/bare/do-bare-bsp-build
+++ b/c/src/lib/libbsp/bare/do-bare-bsp-build
@@ -138,7 +138,7 @@ for cpu in ${CPUS}; do
echo "Configuring RTEMS target bare-${rtems_target} ... "
../${RTEMS}/configure --target=${TARGET} --prefix=${RTEMS_PREFIX} \
--enable-cxx --enable-gmake-print-directory \
- --disable-tests --disable-posix --enable-ka9q \
+ --disable-tests --disable-posix --enable-networking \
--enable-bare-cpu-cflags=-m${rtems_target} \
--enable-bare-cpu-model=m${rtems_target} \
--enable-rtemsbsp=bare
diff --git a/c/src/lib/libbsp/i386/pc386/Makefile.in b/c/src/lib/libbsp/i386/pc386/Makefile.in
index 92963be422..4862454e13 100644
--- a/c/src/lib/libbsp/i386/pc386/Makefile.in
+++ b/c/src/lib/libbsp/i386/pc386/Makefile.in
@@ -11,9 +11,9 @@ 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
+# We only build the Network library if HAS_NETWORKING was defined
NETWORK_yes_V = network
-NETWORK = $(NETWORK_$(HAS_KA9Q)_V)
+NETWORK = $(NETWORK_$(HAS_NETWORKING)_V)
# wrapup is the one that actually builds and installs the library
# from the individual .rel files built in other directories
diff --git a/c/src/lib/libbsp/i386/pc386/include/Makefile.in b/c/src/lib/libbsp/i386/pc386/include/Makefile.in
index 0af71afba1..9dafa8662f 100644
--- a/c/src/lib/libbsp/i386/pc386/include/Makefile.in
+++ b/c/src/lib/libbsp/i386/pc386/include/Makefile.in
@@ -8,9 +8,10 @@ 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)
+# This driver needs to be reworked for the BSD stack.
+# # We only install wd80x3.h if HAS_NETWORKING was defined
+# WD80X3_yes_V = $(srcdir)/wd80x3.h
+# WD80X3 = $(WD80X3_$(HAS_NETWORKING)_V)
H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h $(srcdir)/crt.h \
$(srcdir)/pc386uart.h $(srcdir)/pcibios.h \
diff --git a/c/src/lib/libbsp/i386/pc386/network/network.c b/c/src/lib/libbsp/i386/pc386/network/network.c
index 2a13c6e514..639d2eb699 100644
--- a/c/src/lib/libbsp/i386/pc386/network/network.c
+++ b/c/src/lib/libbsp/i386/pc386/network/network.c
@@ -1,4 +1,6 @@
/*
+ * XXX This driver needs to be reworked to support the new BSD stack
+ *
* RTEMS/KA9Q driver for WD8003 Ethernet Controller
*
*
diff --git a/c/src/lib/libbsp/i386/pc386/wrapup/Makefile.in b/c/src/lib/libbsp/i386/pc386/wrapup/Makefile.in
index 93c14df9ed..70515fdb8e 100644
--- a/c/src/lib/libbsp/i386/pc386/wrapup/Makefile.in
+++ b/c/src/lib/libbsp/i386/pc386/wrapup/Makefile.in
@@ -8,9 +8,9 @@ VPATH = @srcdir@
RTEMS_ROOT = @top_srcdir@
PROJECT_ROOT = @PROJECT_ROOT@
-# We only build the Network library if HAS_KA9Q was defined
+# We only build the Network library if HAS_NETWORKING was defined
NETWORK_yes_V = network
-NETWORK = $(NETWORK_$(HAS_KA9Q)_V)
+NETWORK = $(NETWORK_$(HAS_NETWORKING)_V)
BSP_PIECES=startup clock console timer pc386dev $(NETWORK)
GENERIC_PIECES=
diff --git a/c/src/lib/libbsp/m68k/gen68360/Makefile.in b/c/src/lib/libbsp/m68k/gen68360/Makefile.in
index 98cf93acef..b06c1fc69c 100644
--- a/c/src/lib/libbsp/m68k/gen68360/Makefile.in
+++ b/c/src/lib/libbsp/m68k/gen68360/Makefile.in
@@ -13,10 +13,6 @@ include $(RTEMS_ROOT)/make/directory.cfg
SRCS=README
-# We only build the ka9q device driver if HAS_KA9Q was defined
-KA9Q_DRIVER_yes_V = ka9q_network
-KA9Q_DRIVER = $(KA9Q_DRIVER_$(HAS_KA9Q)_V)
-
# We only build the networking device driver if HAS_NETWORKING was defined
NETWORKING_DRIVER_yes_V = network
NETWORKING_DRIVER = $(NETWORKING_DRIVER_$(HAS_NETWORKING)_V)
@@ -26,4 +22,4 @@ all: $(SRCS)
# wrapup is the one that actually builds and installs the library
# from the individual .rel files built in other directories
SUB_DIRS=include start360 startup clock console timer \
- $(KA9Q_DRIVER) $(NETWORKING_DRIVER) wrapup
+ $(NETWORKING_DRIVER) wrapup
diff --git a/c/src/lib/libbsp/m68k/gen68360/README b/c/src/lib/libbsp/m68k/gen68360/README
index 1a5ec2e667..8e14552641 100644
--- a/c/src/lib/libbsp/m68k/gen68360/README
+++ b/c/src/lib/libbsp/m68k/gen68360/README
@@ -33,7 +33,7 @@
#
# Decisions to be made a link-edit time are:
# - The size of the memory allocator heap. The default value is
-# 64 kbytes. If the KA9Q network package is used the heap
+# 64 kbytes. If the network package is used the heap
# should be at least 256 kbytes. If your network is large, or
# busy, the heap should be even larger.
# To choose a heap size of 256 kbytes,
diff --git a/c/src/lib/libbsp/m68k/gen68360/include/bsp.h b/c/src/lib/libbsp/m68k/gen68360/include/bsp.h
index a52dc1e69c..885fdd117d 100644
--- a/c/src/lib/libbsp/m68k/gen68360/include/bsp.h
+++ b/c/src/lib/libbsp/m68k/gen68360/include/bsp.h
@@ -37,6 +37,14 @@ extern "C" {
#include <clockdrv.h>
/*
+ * Network driver configuration
+ */
+struct rtems_bsdnet_ifconfig;
+extern int rtems_scc1_driver_attach (struct rtems_bsdnet_ifconfig *config);
+#define RTEMS_BSP_NETWORK_DRIVER_NAME "scc1"
+#define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_scc1_driver_attach
+
+/*
* Define the time limits for RTEMS Test Suite test durations.
* Long test and short test duration limits are provided. These
* values are in seconds and need to be converted to ticks for the
diff --git a/c/src/lib/libbsp/m68k/gen68360/wrapup/Makefile.in b/c/src/lib/libbsp/m68k/gen68360/wrapup/Makefile.in
index de02880710..c7523cd10f 100644
--- a/c/src/lib/libbsp/m68k/gen68360/wrapup/Makefile.in
+++ b/c/src/lib/libbsp/m68k/gen68360/wrapup/Makefile.in
@@ -8,15 +8,11 @@ VPATH = @srcdir@
RTEMS_ROOT = @top_srcdir@
PROJECT_ROOT = @PROJECT_ROOT@
-# We only build the ka9q device driver if HAS_KA9Q was defined
-KA9Q_DRIVER_yes_V = ka9q_network
-KA9Q_DRIVER = $(KA9Q_DRIVER_$(HAS_KA9Q)_V)
-
# We only build the networking device driver if HAS_NETWORKING was defined
NETWORKING_DRIVER_yes_V = network
NETWORKING_DRIVER = $(NETWORKING_DRIVER_$(HAS_NETWORKING)_V)
-BSP_PIECES=startup clock console timer $(KA9Q_DRIVER) $(NETWORKING_DRIVER)
+BSP_PIECES=startup clock console timer $(NETWORKING_DRIVER)
CPU_PIECES=
GENERIC_PIECES=
diff --git a/c/src/lib/libnetworking/arpa/inet.h b/c/src/lib/libnetworking/arpa/inet.h
index fb95ee288a..ad5332e7ab 100644
--- a/c/src/lib/libnetworking/arpa/inet.h
+++ b/c/src/lib/libnetworking/arpa/inet.h
@@ -65,6 +65,7 @@
struct in_addr;
+#if 0 /* RTEMS -- Why rename these? */
/* XXX all new diversions!! argh!! */
#define inet_addr __inet_addr
#define inet_aton __inet_aton
@@ -80,6 +81,7 @@ struct in_addr;
#define inet_ntop __inet_ntop
#define inet_nsap_addr __inet_nsap_addr
#define inet_nsap_ntoa __inet_nsap_ntoa
+#endif
__BEGIN_DECLS
int ascii2addr __P((int, const char *, void *));
diff --git a/c/src/lib/libnetworking/rtems/rtems_syscall.c b/c/src/lib/libnetworking/rtems/rtems_syscall.c
index 794b8d3d8e..a526eb2254 100644
--- a/c/src/lib/libnetworking/rtems/rtems_syscall.c
+++ b/c/src/lib/libnetworking/rtems/rtems_syscall.c
@@ -617,8 +617,8 @@ getsockopt (int s, int level, int name, void *aval, int *avalsize)
return 0;
}
-int
-getpeername (int s, struct sockaddr *name, int *namelen)
+static int
+getpeersockname (int s, struct sockaddr *name, int *namelen, int pflag)
{
struct socket *so;
struct mbuf *m;
@@ -636,7 +636,10 @@ getpeername (int s, struct sockaddr *name, int *namelen)
rtems_bsdnet_semaphore_release ();
return -1;
}
- error = (*so->so_proto->pr_usrreqs->pru_peeraddr)(so, m);
+ if (pflag)
+ error = (*so->so_proto->pr_usrreqs->pru_peeraddr)(so, m);
+ else
+ error = (*so->so_proto->pr_usrreqs->pru_sockaddr)(so, m);
if (error) {
errno = error;
rtems_bsdnet_semaphore_release ();
@@ -652,6 +655,17 @@ getpeername (int s, struct sockaddr *name, int *namelen)
return 0;
}
+int
+getpeername (int s, struct sockaddr *name, int *namelen)
+{
+ return getpeersockname (s, name, namelen, 1);
+}
+int
+getsockname (int s, struct sockaddr *name, int *namelen)
+{
+ return getpeersockname (s, name, namelen, 0);
+}
+
/*
************************************************************************
* RTEMS EXTERNAL I/O HANDLER ROUTINES *
diff --git a/c/src/lib/wrapup/Makefile.in b/c/src/lib/wrapup/Makefile.in
index 52042c5e6e..de322d9d04 100644
--- a/c/src/lib/wrapup/Makefile.in
+++ b/c/src/lib/wrapup/Makefile.in
@@ -18,7 +18,6 @@ LIB=$(PROJECT_RELEASE)/lib/librtemsall${LIB_VARIANT}.a
SRCS=$(wildcard $(PROJECT_RELEASE)/lib/libbsp$(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) \
$(wildcard $(PROJECT_RELEASE)/lib/libnetworking$(LIB_VARIANT).a) \
$(wildcard $(PROJECT_RELEASE)/lib/libcpu$(LIB_VARIANT).a) \
$(PROJECT_RELEASE)/lib/libcsupport$(LIB_VARIANT).a \
diff --git a/c/src/libnetworking/arpa/inet.h b/c/src/libnetworking/arpa/inet.h
index fb95ee288a..ad5332e7ab 100644
--- a/c/src/libnetworking/arpa/inet.h
+++ b/c/src/libnetworking/arpa/inet.h
@@ -65,6 +65,7 @@
struct in_addr;
+#if 0 /* RTEMS -- Why rename these? */
/* XXX all new diversions!! argh!! */
#define inet_addr __inet_addr
#define inet_aton __inet_aton
@@ -80,6 +81,7 @@ struct in_addr;
#define inet_ntop __inet_ntop
#define inet_nsap_addr __inet_nsap_addr
#define inet_nsap_ntoa __inet_nsap_ntoa
+#endif
__BEGIN_DECLS
int ascii2addr __P((int, const char *, void *));
diff --git a/c/src/libnetworking/rtems/rtems_syscall.c b/c/src/libnetworking/rtems/rtems_syscall.c
index 794b8d3d8e..a526eb2254 100644
--- a/c/src/libnetworking/rtems/rtems_syscall.c
+++ b/c/src/libnetworking/rtems/rtems_syscall.c
@@ -617,8 +617,8 @@ getsockopt (int s, int level, int name, void *aval, int *avalsize)
return 0;
}
-int
-getpeername (int s, struct sockaddr *name, int *namelen)
+static int
+getpeersockname (int s, struct sockaddr *name, int *namelen, int pflag)
{
struct socket *so;
struct mbuf *m;
@@ -636,7 +636,10 @@ getpeername (int s, struct sockaddr *name, int *namelen)
rtems_bsdnet_semaphore_release ();
return -1;
}
- error = (*so->so_proto->pr_usrreqs->pru_peeraddr)(so, m);
+ if (pflag)
+ error = (*so->so_proto->pr_usrreqs->pru_peeraddr)(so, m);
+ else
+ error = (*so->so_proto->pr_usrreqs->pru_sockaddr)(so, m);
if (error) {
errno = error;
rtems_bsdnet_semaphore_release ();
@@ -652,6 +655,17 @@ getpeername (int s, struct sockaddr *name, int *namelen)
return 0;
}
+int
+getpeername (int s, struct sockaddr *name, int *namelen)
+{
+ return getpeersockname (s, name, namelen, 1);
+}
+int
+getsockname (int s, struct sockaddr *name, int *namelen)
+{
+ return getpeersockname (s, name, namelen, 0);
+}
+
/*
************************************************************************
* RTEMS EXTERNAL I/O HANDLER ROUTINES *
diff --git a/c/src/make/compilers/gcc-target-default.cfg b/c/src/make/compilers/gcc-target-default.cfg
index ee533743e8..61449f3f16 100644
--- a/c/src/make/compilers/gcc-target-default.cfg
+++ b/c/src/make/compilers/gcc-target-default.cfg
@@ -18,10 +18,6 @@ CPLUS_CPPFLAGS=$(CFLAGS) $(XCPPFLAGS)
# default flags
-# We only include the header files for KA9Q if it is enabled.
-INCLUDE_KA9Q_yes_V = -I$(PROJECT_INCLUDE)/ka9q
-INCLUDE_KA9Q = $(INCLUDE_KA9Q_$(HAS_KA9Q)_V)
-
# We only include the header files for networking if it is enabled.
INCLUDE_NETWORKING_yes_V = -I$(PROJECT_INCLUDE)/networking
INCLUDE_NETWORKING = $(INCLUDE_NETWORKING_$(HAS_NETWORKING)_V)
@@ -36,7 +32,6 @@ endif
# Used for posix bsps
CFLAGS_DEFAULT = $(CPU_DEFINES) $(CPU_CFLAGS) -Wall -ansi -fasm -g \
-I$(PROJECT_INCLUDE) \
- $(INCLUDE_KA9Q) \
$(INCLUDE_NETWORKING) \
$(RTEMS_LIBC_INCLUDES) $(DEFINES)
@@ -50,7 +45,6 @@ GCC_INCLUDE=$(shell $(CC) $(CPU_CFLAGS) -print-file-name=include $(GCCSED))
CFLAGS_DEFAULT = $(CPU_DEFINES) $(CPU_CFLAGS) -Wall -ansi -fasm -g \
-nostdinc -I$(PROJECT_INCLUDE) \
- $(INCLUDE_KA9Q) \
$(INCLUDE_NETWORKING) \
-I$(RTEMS_LIBC_DIR)/include -I$(GCC_INCLUDE) $(DEFINES)
@@ -71,7 +65,7 @@ endif
else
CFLAGS_DEFAULT = $(CPU_DEFINES) $(CPU_CFLAGS) -Wall -ansi -fasm -g \
-B$(PROJECT_RELEASE)/lib/ -specs bsp_specs -qrtems \
- $(INCLUDE_KA9Q) $(INCLUDE_NETWORKING) $(DEFINES)
+ $(INCLUDE_NETWORKING) $(DEFINES)
ASMFLAGS=$(CPU_DEFINES) $(CPU_CFLAGS) -g -I$(srcdir) \
-B$(PROJECT_RELEASE)/lib/ -specs bsp_specs -qrtems $(DEFINES)
diff --git a/c/src/wrapup/Makefile.in b/c/src/wrapup/Makefile.in
index 52042c5e6e..de322d9d04 100644
--- a/c/src/wrapup/Makefile.in
+++ b/c/src/wrapup/Makefile.in
@@ -18,7 +18,6 @@ LIB=$(PROJECT_RELEASE)/lib/librtemsall${LIB_VARIANT}.a
SRCS=$(wildcard $(PROJECT_RELEASE)/lib/libbsp$(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) \
$(wildcard $(PROJECT_RELEASE)/lib/libnetworking$(LIB_VARIANT).a) \
$(wildcard $(PROJECT_RELEASE)/lib/libcpu$(LIB_VARIANT).a) \
$(PROJECT_RELEASE)/lib/libcsupport$(LIB_VARIANT).a \