summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1997-07-31 22:04:17 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1997-07-31 22:04:17 +0000
commit91333c27bdc98ea872c97ec41be98fab5de4e442 (patch)
tree6a5e3d36ef87ef4fa8f6316252c58855fcf50fd1
parent13f09e64e56cb2bda93cbcdd3c71afc361a6ab6d (diff)
downloadrtems-91333c27bdc98ea872c97ec41be98fab5de4e442.tar.bz2
Merged very large and much appreciated patch from Chris Johns
<cjohns@plessey.com.au>. This patch includes the ods68302 bsp, the RTEMS++ class library, and the rtems++ test.
-rw-r--r--Makefile.in4
-rw-r--r--README.configure5
-rw-r--r--c/Makefile.in6
-rw-r--r--c/src/exec/score/cpu/m68k/m68302.h57
-rw-r--r--c/src/lib/Makefile.in6
-rw-r--r--c/src/lib/include/Makefile.in7
-rw-r--r--c/src/tests/libtests/Makefile.in6
-rw-r--r--c/src/tests/samples/cdtest/Makefile.in2
-rw-r--r--c/src/tests/samples/cdtest/main.cc6
-rw-r--r--configure62
-rw-r--r--configure.in32
-rw-r--r--cpukit/score/cpu/m68k/m68302.h57
-rw-r--r--cpukit/score/cpu/m68k/rtems/m68k/m68302.h57
-rw-r--r--testsuites/samples/cdtest/main.cc6
14 files changed, 293 insertions, 20 deletions
diff --git a/Makefile.in b/Makefile.in
index 1c7858261d..a6e32fc830 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -40,8 +40,10 @@ AWK = @AWK@
RTEMS_ROOT = @RTEMS_ROOT@
RTEMS_HOST = @RTEMS_HOST@
PROJECT_ROOT = @PROJECT_ROOT@
+RTEMS_USE_OWN_PDIR = @RTEMS_USE_OWN_PDIR@
RTEMS_HAS_POSIX_API = @RTEMS_HAS_POSIX_API@
RTEMS_HAS_KA9Q = @RTEMS_HAS_KA9Q@
+RTEMS_HAS_CPLUSPLUS = @RTEMS_HAS_CPLUSPLUS@
RTEMS_USE_MACROS = @RTEMS_USE_MACROS@
RTEMS_USE_GCC272 = @RTEMS_USE_GCC272@
RTEMS_LIBC_DIR = @RTEMS_LIBC_DIR@
@@ -85,8 +87,10 @@ $(MTARGETS): mlink
\"RTEMS_HOST=$(RTEMS_HOST)\" \
\"PROJECT_HOME=$(PROJECT_ROOT)/$$bsp\" \
\"PROJECT_ROOT=$(PROJECT_ROOT)\" \
+ \"RTEMS_USE_OWN_PDIR=$(RTEMS_USE_OWN_PDIR)\" \
\"RTEMS_HAS_POSIX_API=$(RTEMS_HAS_POSIX_API)\" \
\"RTEMS_HAS_KA9Q=$(RTEMS_HAS_KA9Q)\" \
+ \"RTEMS_HAS_CPLUSPLUS=$(RTEMS_HAS_CPLUSPLUS)\" \
\"RTEMS_USE_MACROS=$(RTEMS_USE_MACROS)\" \
\"RTEMS_USE_GCC272=$(RTEMS_USE_GCC272)\" \
\"RTEMS_LIBC_DIR=$(RTEMS_LIBC_DIR)\" \
diff --git a/README.configure b/README.configure
index 9a20359e71..23e16bbe8c 100644
--- a/README.configure
+++ b/README.configure
@@ -20,6 +20,7 @@ RTEMS-specific option are supported:
--disable-posix
--disable-tests
--disable-ka9q
+ --enable-cpp
--enable-gcc28
--enable-libcdir=<DIRECTORY>
--enable-rtemsbsp="bsp1 bsp2 ..."
@@ -30,6 +31,10 @@ it. It can be disabled with the --disable-posix option.
By default, the RTEMS port of the KA9Q TCP/IP stack is build for targets
that support it. It can be disabled with the --disable-ka9q option.
+By default, the RTEMS support of C++ is disabled. It can be enabled
+with the --enable-cpp option. If the rtems++ C++ library is installed
+it will also be build.
+
By default, the RTEMS test suites are configured. The --disable-tests
will not configure the RTEMS test suite. This is used only to speed-up
configuration in case building the tests are not necessary.
diff --git a/c/Makefile.in b/c/Makefile.in
index 8bb19c7fc1..0000a57625 100644
--- a/c/Makefile.in
+++ b/c/Makefile.in
@@ -31,11 +31,16 @@ SUB_DIRS=build-tools src
LIBKA9Q_yes_V = include/ka9q
LIBKA9Q = $(LIBKA9Q_$(HAS_KA9Q)_V)
+# We only make the rtems++ install point if it is enabled.
+LIBRTEMSCPLUSPLUS_yes_V = include/rtems++
+LIBRTEMSCPLUSPLUS = $(LIBRTEMSCPLUSPLUS_$(HAS_CPLUSPLUS)_V)
+
# directories to be created in install point
CREATE_DIRS = include include/sys \
include/rtems include/rtems/score include/rtems/rtems include/rtems/posix \
include/netinet include/libc include/libc/sys \
$(LIBKA9Q) \
+ $(LIBRTEMSCPLUSPLUS) \
lib bin samples \
tests tests/screens tests/screens/sptests \
tests/screens/psxtests tests/screens/mptests \
@@ -93,4 +98,3 @@ tests:
cd src/tests; $(MAKE) all
env: $(SRCS) dirs
-
diff --git a/c/src/exec/score/cpu/m68k/m68302.h b/c/src/exec/score/cpu/m68k/m68302.h
index da96478cf3..084ceac034 100644
--- a/c/src/exec/score/cpu/m68k/m68302.h
+++ b/c/src/exec/score/cpu/m68k/m68302.h
@@ -68,8 +68,8 @@
#define RBIT_SCR_SAM 0x00001000
#define RBIT_SCR_HWDEN 0x00000800
#define RBIT_SCR_HWDCN2 0x00000400
-#define RBIT_SCR_HWDCN1 0x00000200
-#define RBIT_SCR_HWDCN0 0x00000100
+#define RBIT_SCR_HWDCN1 0x00000200 /* 512 clocks */
+#define RBIT_SCR_HWDCN0 0x00000100 /* 128 clocks */
#define RBIT_SCR_LPREC 0x00000080
#define RBIT_SCR_LPP16 0x00000040
@@ -539,6 +539,7 @@ typedef struct {
/* offset +82c */
rtems_unsigned16 res6;
rtems_unsigned16 res7;
+
rtems_unsigned16 br0; /* Base Register (CS0) */
rtems_unsigned16 or0; /* Option Register (CS0) */
rtems_unsigned16 br1; /* Base Register (CS1) */
@@ -597,6 +598,58 @@ typedef struct {
m302_internalReg_t reg; /* +800 68302 Internal Registers */
} m302_dualPortRAM_t;
+/* some useful defines the some of the registers above */
+
+
+/* ----
+ MC68302 Chip Select Registers
+ p3-46 2nd Edition
+
+ */
+#define BR_ENABLED 1
+#define BR_DISABLED 0
+#define BR_FC_NULL 0
+#define BR_READ_ONLY 0
+#define BR_READ_WRITE 2
+#define OR_DTACK_0 0x0000
+#define OR_DTACK_1 0x2000
+#define OR_DTACK_2 0x4000
+#define OR_DTACK_3 0x6000
+#define OR_DTACK_4 0x8000
+#define OR_DTACK_5 0xA000
+#define OR_DTACK_6 0xC000
+#define OR_DTACK_EXT 0xE000
+#define OR_SIZE_64K 0x1FE0
+#define OR_SIZE_128K 0x1FC0
+#define OR_SIZE_256K 0x1F80
+#define OR_SIZE_512K 0x1F00
+#define OR_SIZE_1M 0x1E00
+#define OR_SIZE_2M 0x1C00
+#define OR_MASK_RW 0x0000
+#define OR_NO_MASK_RW 0x0002
+#define OR_MASK_FC 0x0000
+#define OR_NO_MASK_FC 0x0001
+
+#define MAKE_BR(base_address, enable, rw, fc) \
+ ((base_address >> 11) | fc | rw | enable)
+
+#define MAKE_OR(bsize, DtAck, RW_Mask, FC_Mask) \
+ (DtAck | ((~(bsize - 1) & 0x00FFFFFF) >> 11) | FC_Mask | RW_Mask)
+
+#define __REG_CAT(r, n) r ## n
+#define WRITE_BR(csel, base_address, enable, rw, fc) \
+ __REG_CAT(m302.reg.br, csel) = MAKE_BR(base_address, enable, rw, fc)
+#define WRITE_OR(csel, bsize, DtAck, RW_Mask, FC_Mask) \
+ __REG_CAT(m302.reg.or, csel) = MAKE_OR(bsize, DtAck, RW_Mask, FC_Mask)
+
+/* ----
+ MC68302 Watchdog Timer Enable Bit
+
+ */
+#define WATCHDOG_ENABLE (1)
+#define WATCHDOG_TRIGGER() (m302.reg.wrr = 0x10 | WATCHDOG_ENABLE, m302.reg.wcn = 0)
+#define WATCHDOG_TOGGLE() (m302.reg.wcn = WATCHDOG_TIMEOUT_PERIOD)
+#define DISABLE_WATCHDOG() (m302.reg.wrr = 0)
/*
* Declare the variable that's used to reference the variables in
diff --git a/c/src/lib/Makefile.in b/c/src/lib/Makefile.in
index 55ca6e925e..d8afa4fad8 100644
--- a/c/src/lib/Makefile.in
+++ b/c/src/lib/Makefile.in
@@ -10,8 +10,12 @@ VPATH=@srcdir@
include $(RTEMS_CUSTOM)
include $(PROJECT_ROOT)/make/directory.cfg
+# We only build the rtems++ library if HAS_CPLUSPLUS was defined
+LIBRTEMSCPLUSPLUS_yes_V = librtems++
+LIBRTEMSCPLUSPLUS = $(LIBRTEMSCPLUSPLUS_$(HAS_CPLUSPLUS)_V)
+
# General Hardware API library
LIBHWAPI=$(wildcard libhwapi)
SUB_DIRS=start include libmisc libc libcpu libbsp \
- $(LIBHWAPI) wrapup
+ $(LIBKA9Q) $(LIBHWAPI) $(LIBRTEMSCPLUSPLUS) wrapup
diff --git a/c/src/lib/include/Makefile.in b/c/src/lib/include/Makefile.in
index 092b7c9766..fb1cb2c67f 100644
--- a/c/src/lib/include/Makefile.in
+++ b/c/src/lib/include/Makefile.in
@@ -18,6 +18,10 @@ KA9Q_H_PIECES= arp asy ax25 ax25mail bootp cmdparse commands config \
sockaddr socket tcp telnet tftp timer tipmail trace udp usock
KA9Q_H_FILES=$(KA9Q_H_PIECES:%=$(srcdir)/ka9q/%.h)
+RTEMSCPLUSPLUS_H_PIECES= rtemsEvent rtemsInterrupt rtemsMessageQueue \
+ rtemsSemaphore rtemsStatusCode rtemsTask rtemsTaskMode rtemsTimer
+RTEMSCPLUSPLUS_H_FILES=$(RTEMSCPLUSPLUS_H_PIECES:%=$(srcdir)/rtems++/%.h)
+
SYS_H_FILES=
SRCS=$(H_FILES) $(SYS_H_FILES)
@@ -34,3 +38,6 @@ all: $(SRCS)
ifeq ($(HAS_KA9Q),yes)
$(INSTALL) -m 444 $(KA9Q_H_FILES) ${PROJECT_RELEASE}/include/ka9q
endif
+ifeq ($(HAS_CPLUSPLUS),yes)
+ $(INSTALL) -m 444 $(RTEMSCPLUSPLUS_H_FILES) ${PROJECT_RELEASE}/include/rtems++
+endif
diff --git a/c/src/tests/libtests/Makefile.in b/c/src/tests/libtests/Makefile.in
index c6875734a0..cce700a3ad 100644
--- a/c/src/tests/libtests/Makefile.in
+++ b/c/src/tests/libtests/Makefile.in
@@ -10,4 +10,8 @@ VPATH=@srcdir@
include $(RTEMS_CUSTOM)
include $(PROJECT_ROOT)/make/directory.cfg
-SUB_DIRS=cpuuse rtmonuse malloctest stackchk
+# We only build the tests for the rtems++ library if HAS_CPLUSPLUS was defined
+LIBRTEMSCPLUSPLUS_yes_V = rtems++
+LIBRTEMSCPLUSPLUS = $(LIBRTEMSCPLUSPLUS_$(HAS_CPLUSPLUS)_V)
+
+SUB_DIRS=cpuuse rtmonuse malloctest stackchk $(LIBRTEMSCPLUSPLUS)
diff --git a/c/src/tests/samples/cdtest/Makefile.in b/c/src/tests/samples/cdtest/Makefile.in
index 75529f072b..69e164bbc7 100644
--- a/c/src/tests/samples/cdtest/Makefile.in
+++ b/c/src/tests/samples/cdtest/Makefile.in
@@ -41,7 +41,7 @@ include $(PROJECT_ROOT)/make/leaf.cfg
#
DEFINES +=
-CPPFLAGS +=
+CPPFLAGS += -I$(LIBCC_INCLUDE)
CFLAGS +=
LD_PATHS +=
diff --git a/c/src/tests/samples/cdtest/main.cc b/c/src/tests/samples/cdtest/main.cc
index d55f96e9f0..e7b3cd02b3 100644
--- a/c/src/tests/samples/cdtest/main.cc
+++ b/c/src/tests/samples/cdtest/main.cc
@@ -21,7 +21,9 @@
#include <rtems.h>
#include <stdio.h>
+#ifdef RTEMS_TEST_IO_STREAM
#include <iostream.h>
+#endif
extern "C" {
extern rtems_task main_task(rtems_task_argument);
@@ -108,7 +110,11 @@ cdtest(void)
A bar, blech, blah;
B bleak;
+#ifdef RTEMS_TEST_IO_STREAM
cout << "Testing a C++ I/O stream" << endl;
+#else
+ printf("IO Stream not tested\n");
+#endif
bar = blech;
}
diff --git a/configure b/configure
index e130d25f18..2f6ffb8b77 100644
--- a/configure
+++ b/configure
@@ -15,6 +15,9 @@ ac_help="$ac_help
--with-cross-host=HOST host (cygnus)"
ac_help="$ac_help
\
+ --enable-gmake-print-directory enable GNU Make's print directory"
+ac_help="$ac_help
+\
--disable-posix disable posix interface"
ac_help="$ac_help
\
@@ -24,6 +27,9 @@ ac_help="$ac_help
--disable-rtems-inlines disable RTEMS inline functions (use macros)"
ac_help="$ac_help
\
++ --enable-cpp enable C++ support, and build the rtems++ library"
+ac_help="$ac_help
+\
--enable-gcc28 enable use of gcc 2.8.x features"
ac_help="$ac_help
\
@@ -667,6 +673,14 @@ c/src/lib/libbsp/m68k/mvme162/startup/Makefile \
c/src/lib/libbsp/m68k/mvme162/timer/Makefile \
c/src/lib/libbsp/m68k/mvme162/tools/Makefile \
c/src/lib/libbsp/m68k/mvme162/wrapup/Makefile \
+c/src/lib/libbsp/m68k/ods68302/Makefile \
+c/src/lib/libbsp/m68k/ods68302/clock/Makefile \
+c/src/lib/libbsp/m68k/ods68302/console/Makefile \
+c/src/lib/libbsp/m68k/ods68302/include/Makefile \
+c/src/lib/libbsp/m68k/ods68302/start302/Makefile \
+c/src/lib/libbsp/m68k/ods68302/startup/Makefile \
+c/src/lib/libbsp/m68k/ods68302/timer/Makefile \
+c/src/lib/libbsp/m68k/ods68302/wrapup/Makefile \
c/src/lib/libcpu/m68k/Makefile \
c/src/lib/libcpu/m68k/m68040/Makefile \
c/src/lib/libcpu/m68k/m68040/fpsp/Makefile \
@@ -772,6 +786,8 @@ c/src/lib/libbsp/unix/posix/wrapup/Makefile"
ka9q_mk="c/src/lib/libka9q/Makefile"
+rtemscpp_mk="c/src/lib/librtems++/Makefile"
+
hwapi_mk="\
c/src/lib/libhwapi/Makefile \
c/src/lib/libhwapi/eeprom/Makefile \
@@ -819,6 +835,7 @@ c/src/tests/libtests/cpuuse/Makefile \
c/src/tests/libtests/malloctest/Makefile \
c/src/tests/libtests/rtmonuse/Makefile \
c/src/tests/libtests/stackchk/Makefile \
+c/src/tests/libtests/rtems++/Makefile \
c/src/tests/mptests/Makefile \
c/src/tests/mptests/mp01/Makefile \
c/src/tests/mptests/mp01/node1/Makefile \
@@ -960,7 +977,7 @@ c/src/tests/tools/unix/Makefile \
c/src/tests/tools/unix/posix/Makefile"
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:964: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:981: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1033,7 +1050,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:1037: checking host system type" >&5
+echo "configure:1054: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -1054,7 +1071,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:1058: checking target system type" >&5
+echo "configure:1075: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -1072,7 +1089,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1076: checking build system type" >&5
+echo "configure:1093: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -1102,6 +1119,20 @@ host=$withval
fi
+# Check whether --enable-gmake-print-directory or --disable-gmake-print-directory was given.
+if test "${enable_gmake_print_directory+set}" = set; then
+ enableval="$enable_gmake_print_directory"
+ \
+case "${enableval}" in
+ yes) RTEMS_USE_OWN_PDIR=yes ;;
+ no) RTEMS_USE_OWN_PDIR=no ;;
+ *) { echo "configure: error: bad value ${enableval} for gmake-print-directory option" 1>&2; exit 1; } ;;
+esac
+else
+ RTEMS_USE_OWN_PDIR=yes
+fi
+
+
# Check whether --enable-posix or --disable-posix was given.
if test "${enable_posix+set}" = set; then
enableval="$enable_posix"
@@ -1144,6 +1175,17 @@ else
fi
++ # Check whether --enable-cpp or --disable-cpp was given.
+if test "${enable_cpp+set}" = set; then
+ enableval="$enable_cpp"
+ \
+ yes
+fi
+ RTEMS_HAS_CPLUSPLUS=yes ;;
+ no) RTEMS_HAS_CPLUSPLUS=no ;;
+ *) { echo "configure: error: bad value ${enableval} for enable-cpp option" 1>&2; exit 1; } ;;
+esac],RTEMS_HAS_CPLUSPLUS=no)
+
# Check whether --enable-gcc28 or --disable-gcc28 was given.
if test "${enable_gcc28+set}" = set; then
enableval="$enable_gcc28"
@@ -1204,7 +1246,7 @@ case "${target}" in
;;
m68k-rtems*)
rtems_bsp="dmv152 efi332 efi68k gen68302 gen68360 gen68360_040 idp \
- mvme136 mvme147 mvme147s mvme162 mvme162lx"
+ mvme136 mvme147 mvme147s mvme162 mvme162lx ods68302"
makefiles=$m68k_mk
;;
mips64orion-rtems*)
@@ -1263,7 +1305,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1267: checking for $ac_word" >&5
+echo "configure:1309: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1292,7 +1334,7 @@ test -n "$AWK" && break
done
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1296: checking whether ln -s works" >&5
+echo "configure:1338: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1319,7 +1361,7 @@ RTEMS_ROOT=`cd $srcdir/c; pwd`
PROJECT_ROOT=`pwd;`
# For now always generate the KA9Q TCP/IP Makefiles
-makefiles="$makefiles $ka9q_mk"
+makefiles="$makefiles $ka9q_mk $rtemscpp_mk"
# Check whether --enable-tests or --disable-tests was given.
if test "${enable_tests+set}" = set; then
@@ -1361,6 +1403,8 @@ fi
+
+
trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
@@ -1584,9 +1628,11 @@ s%@RTEMS_BSP@%$RTEMS_BSP%g
s%@RTEMS_HOST@%$RTEMS_HOST%g
s%@RTEMS_LIBC_DIR@%$RTEMS_LIBC_DIR%g
s%@RTEMS_ROOT@%$RTEMS_ROOT%g
+s%@RTEMS_USE_OWN_PDIR@%$RTEMS_USE_OWN_PDIR%g
s%@RTEMS_HAS_POSIX_API@%$RTEMS_HAS_POSIX_API%g
s%@RTEMS_HAS_KA9Q@%$RTEMS_HAS_KA9Q%g
s%@RTEMS_USE_MACROS@%$RTEMS_USE_MACROS%g
+s%@RTEMS_HAS_CPLUSPLUS@%$RTEMS_HAS_CPLUSPLUS%g
s%@RTEMS_USE_GCC272@%$RTEMS_USE_GCC272%g
s%@PROJECT_ROOT@%$PROJECT_ROOT%g
s%@program_prefix@%$program_prefix%g
diff --git a/configure.in b/configure.in
index b00981063d..f0e3be2a5b 100644
--- a/configure.in
+++ b/configure.in
@@ -124,6 +124,14 @@ c/src/lib/libbsp/m68k/mvme162/startup/Makefile \
c/src/lib/libbsp/m68k/mvme162/timer/Makefile \
c/src/lib/libbsp/m68k/mvme162/tools/Makefile \
c/src/lib/libbsp/m68k/mvme162/wrapup/Makefile \
+c/src/lib/libbsp/m68k/ods68302/Makefile \
+c/src/lib/libbsp/m68k/ods68302/clock/Makefile \
+c/src/lib/libbsp/m68k/ods68302/console/Makefile \
+c/src/lib/libbsp/m68k/ods68302/include/Makefile \
+c/src/lib/libbsp/m68k/ods68302/start302/Makefile \
+c/src/lib/libbsp/m68k/ods68302/startup/Makefile \
+c/src/lib/libbsp/m68k/ods68302/timer/Makefile \
+c/src/lib/libbsp/m68k/ods68302/wrapup/Makefile \
c/src/lib/libcpu/m68k/Makefile \
c/src/lib/libcpu/m68k/m68040/Makefile \
c/src/lib/libcpu/m68k/m68040/fpsp/Makefile \
@@ -229,6 +237,8 @@ c/src/lib/libbsp/unix/posix/wrapup/Makefile"
ka9q_mk="c/src/lib/libka9q/Makefile"
+rtemscpp_mk="c/src/lib/librtems++/Makefile"
+
hwapi_mk="\
c/src/lib/libhwapi/Makefile \
c/src/lib/libhwapi/eeprom/Makefile \
@@ -276,6 +286,7 @@ c/src/tests/libtests/cpuuse/Makefile \
c/src/tests/libtests/malloctest/Makefile \
c/src/tests/libtests/rtmonuse/Makefile \
c/src/tests/libtests/stackchk/Makefile \
+c/src/tests/libtests/rtems++/Makefile \
c/src/tests/mptests/Makefile \
c/src/tests/mptests/mp01/Makefile \
c/src/tests/mptests/mp01/node1/Makefile \
@@ -422,6 +433,14 @@ AC_CANONICAL_SYSTEM
AC_ARG_WITH(cross-host,[ --with-cross-host=HOST host (cygnus)], \
host=$withval)
+AC_ARG_ENABLE(gmake-print-directory, \
+[ --enable-gmake-print-directory enable GNU Make's print directory], \
+[case "${enableval}" in
+ yes) RTEMS_USE_OWN_PDIR=yes ;;
+ no) RTEMS_USE_OWN_PDIR=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for gmake-print-directory option) ;;
+esac],[RTEMS_USE_OWN_PDIR=yes])
+
AC_ARG_ENABLE(posix, \
[ --disable-posix disable posix interface], \
[case "${enableval}" in
@@ -446,6 +465,13 @@ AC_ARG_ENABLE(rtems-inlines, \
*) AC_MSG_ERROR(bad value ${enableval} for disable-rtems-inlines option) ;;
esac],[RTEMS_USE_MACROS=no])
++ AC_ARG_ENABLE(cpp, \
++ [ --enable-cpp enable C++ support, and build the rtems++ library], \
+ yes) RTEMS_HAS_CPLUSPLUS=yes ;;
+ no) RTEMS_HAS_CPLUSPLUS=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for enable-cpp option) ;;
+esac],[RTEMS_HAS_CPLUSPLUS=no])
+
AC_ARG_ENABLE(gcc28, \
[ --enable-gcc28 enable use of gcc 2.8.x features], \
[case "${enableval}" in
@@ -496,7 +522,7 @@ case "${target}" in
;;
m68k-rtems*)
rtems_bsp="dmv152 efi332 efi68k gen68302 gen68360 gen68360_040 idp \
- mvme136 mvme147 mvme147s mvme162 mvme162lx"
+ mvme136 mvme147 mvme147s mvme162 mvme162lx ods68302"
makefiles=$m68k_mk
;;
mips64orion-rtems*)
@@ -561,7 +587,7 @@ RTEMS_ROOT=`cd $srcdir/c; pwd`
PROJECT_ROOT=`pwd;`
# For now always generate the KA9Q TCP/IP Makefiles
-makefiles="$makefiles $ka9q_mk"
+makefiles="$makefiles $ka9q_mk $rtemscpp_mk"
AC_ARG_ENABLE(tests, \
[ --disable-tests disable tests], \
@@ -579,9 +605,11 @@ AC_SUBST(RTEMS_BSP)
AC_SUBST(RTEMS_HOST)
AC_SUBST(RTEMS_LIBC_DIR)
AC_SUBST(RTEMS_ROOT)
+AC_SUBST(RTEMS_USE_OWN_PDIR)
AC_SUBST(RTEMS_HAS_POSIX_API)
AC_SUBST(RTEMS_HAS_KA9Q)
AC_SUBST(RTEMS_USE_MACROS)
+AC_SUBST(RTEMS_HAS_CPLUSPLUS)
AC_SUBST(RTEMS_USE_GCC272)
AC_SUBST(RTEMS_LIBC_DIR)
AC_SUBST(PROJECT_ROOT)
diff --git a/cpukit/score/cpu/m68k/m68302.h b/cpukit/score/cpu/m68k/m68302.h
index da96478cf3..084ceac034 100644
--- a/cpukit/score/cpu/m68k/m68302.h
+++ b/cpukit/score/cpu/m68k/m68302.h
@@ -68,8 +68,8 @@
#define RBIT_SCR_SAM 0x00001000
#define RBIT_SCR_HWDEN 0x00000800
#define RBIT_SCR_HWDCN2 0x00000400
-#define RBIT_SCR_HWDCN1 0x00000200
-#define RBIT_SCR_HWDCN0 0x00000100
+#define RBIT_SCR_HWDCN1 0x00000200 /* 512 clocks */
+#define RBIT_SCR_HWDCN0 0x00000100 /* 128 clocks */
#define RBIT_SCR_LPREC 0x00000080
#define RBIT_SCR_LPP16 0x00000040
@@ -539,6 +539,7 @@ typedef struct {
/* offset +82c */
rtems_unsigned16 res6;
rtems_unsigned16 res7;
+
rtems_unsigned16 br0; /* Base Register (CS0) */
rtems_unsigned16 or0; /* Option Register (CS0) */
rtems_unsigned16 br1; /* Base Register (CS1) */
@@ -597,6 +598,58 @@ typedef struct {
m302_internalReg_t reg; /* +800 68302 Internal Registers */
} m302_dualPortRAM_t;
+/* some useful defines the some of the registers above */
+
+
+/* ----
+ MC68302 Chip Select Registers
+ p3-46 2nd Edition
+
+ */
+#define BR_ENABLED 1
+#define BR_DISABLED 0
+#define BR_FC_NULL 0
+#define BR_READ_ONLY 0
+#define BR_READ_WRITE 2
+#define OR_DTACK_0 0x0000
+#define OR_DTACK_1 0x2000
+#define OR_DTACK_2 0x4000
+#define OR_DTACK_3 0x6000
+#define OR_DTACK_4 0x8000
+#define OR_DTACK_5 0xA000
+#define OR_DTACK_6 0xC000
+#define OR_DTACK_EXT 0xE000
+#define OR_SIZE_64K 0x1FE0
+#define OR_SIZE_128K 0x1FC0
+#define OR_SIZE_256K 0x1F80
+#define OR_SIZE_512K 0x1F00
+#define OR_SIZE_1M 0x1E00
+#define OR_SIZE_2M 0x1C00
+#define OR_MASK_RW 0x0000
+#define OR_NO_MASK_RW 0x0002
+#define OR_MASK_FC 0x0000
+#define OR_NO_MASK_FC 0x0001
+
+#define MAKE_BR(base_address, enable, rw, fc) \
+ ((base_address >> 11) | fc | rw | enable)
+
+#define MAKE_OR(bsize, DtAck, RW_Mask, FC_Mask) \
+ (DtAck | ((~(bsize - 1) & 0x00FFFFFF) >> 11) | FC_Mask | RW_Mask)
+
+#define __REG_CAT(r, n) r ## n
+#define WRITE_BR(csel, base_address, enable, rw, fc) \
+ __REG_CAT(m302.reg.br, csel) = MAKE_BR(base_address, enable, rw, fc)
+#define WRITE_OR(csel, bsize, DtAck, RW_Mask, FC_Mask) \
+ __REG_CAT(m302.reg.or, csel) = MAKE_OR(bsize, DtAck, RW_Mask, FC_Mask)
+
+/* ----
+ MC68302 Watchdog Timer Enable Bit
+
+ */
+#define WATCHDOG_ENABLE (1)
+#define WATCHDOG_TRIGGER() (m302.reg.wrr = 0x10 | WATCHDOG_ENABLE, m302.reg.wcn = 0)
+#define WATCHDOG_TOGGLE() (m302.reg.wcn = WATCHDOG_TIMEOUT_PERIOD)
+#define DISABLE_WATCHDOG() (m302.reg.wrr = 0)
/*
* Declare the variable that's used to reference the variables in
diff --git a/cpukit/score/cpu/m68k/rtems/m68k/m68302.h b/cpukit/score/cpu/m68k/rtems/m68k/m68302.h
index da96478cf3..084ceac034 100644
--- a/cpukit/score/cpu/m68k/rtems/m68k/m68302.h
+++ b/cpukit/score/cpu/m68k/rtems/m68k/m68302.h
@@ -68,8 +68,8 @@
#define RBIT_SCR_SAM 0x00001000
#define RBIT_SCR_HWDEN 0x00000800
#define RBIT_SCR_HWDCN2 0x00000400
-#define RBIT_SCR_HWDCN1 0x00000200
-#define RBIT_SCR_HWDCN0 0x00000100
+#define RBIT_SCR_HWDCN1 0x00000200 /* 512 clocks */
+#define RBIT_SCR_HWDCN0 0x00000100 /* 128 clocks */
#define RBIT_SCR_LPREC 0x00000080
#define RBIT_SCR_LPP16 0x00000040
@@ -539,6 +539,7 @@ typedef struct {
/* offset +82c */
rtems_unsigned16 res6;
rtems_unsigned16 res7;
+
rtems_unsigned16 br0; /* Base Register (CS0) */
rtems_unsigned16 or0; /* Option Register (CS0) */
rtems_unsigned16 br1; /* Base Register (CS1) */
@@ -597,6 +598,58 @@ typedef struct {
m302_internalReg_t reg; /* +800 68302 Internal Registers */
} m302_dualPortRAM_t;
+/* some useful defines the some of the registers above */
+
+
+/* ----
+ MC68302 Chip Select Registers
+ p3-46 2nd Edition
+
+ */
+#define BR_ENABLED 1
+#define BR_DISABLED 0
+#define BR_FC_NULL 0
+#define BR_READ_ONLY 0
+#define BR_READ_WRITE 2
+#define OR_DTACK_0 0x0000
+#define OR_DTACK_1 0x2000
+#define OR_DTACK_2 0x4000
+#define OR_DTACK_3 0x6000
+#define OR_DTACK_4 0x8000
+#define OR_DTACK_5 0xA000
+#define OR_DTACK_6 0xC000
+#define OR_DTACK_EXT 0xE000
+#define OR_SIZE_64K 0x1FE0
+#define OR_SIZE_128K 0x1FC0
+#define OR_SIZE_256K 0x1F80
+#define OR_SIZE_512K 0x1F00
+#define OR_SIZE_1M 0x1E00
+#define OR_SIZE_2M 0x1C00
+#define OR_MASK_RW 0x0000
+#define OR_NO_MASK_RW 0x0002
+#define OR_MASK_FC 0x0000
+#define OR_NO_MASK_FC 0x0001
+
+#define MAKE_BR(base_address, enable, rw, fc) \
+ ((base_address >> 11) | fc | rw | enable)
+
+#define MAKE_OR(bsize, DtAck, RW_Mask, FC_Mask) \
+ (DtAck | ((~(bsize - 1) & 0x00FFFFFF) >> 11) | FC_Mask | RW_Mask)
+
+#define __REG_CAT(r, n) r ## n
+#define WRITE_BR(csel, base_address, enable, rw, fc) \
+ __REG_CAT(m302.reg.br, csel) = MAKE_BR(base_address, enable, rw, fc)
+#define WRITE_OR(csel, bsize, DtAck, RW_Mask, FC_Mask) \
+ __REG_CAT(m302.reg.or, csel) = MAKE_OR(bsize, DtAck, RW_Mask, FC_Mask)
+
+/* ----
+ MC68302 Watchdog Timer Enable Bit
+
+ */
+#define WATCHDOG_ENABLE (1)
+#define WATCHDOG_TRIGGER() (m302.reg.wrr = 0x10 | WATCHDOG_ENABLE, m302.reg.wcn = 0)
+#define WATCHDOG_TOGGLE() (m302.reg.wcn = WATCHDOG_TIMEOUT_PERIOD)
+#define DISABLE_WATCHDOG() (m302.reg.wrr = 0)
/*
* Declare the variable that's used to reference the variables in
diff --git a/testsuites/samples/cdtest/main.cc b/testsuites/samples/cdtest/main.cc
index d55f96e9f0..e7b3cd02b3 100644
--- a/testsuites/samples/cdtest/main.cc
+++ b/testsuites/samples/cdtest/main.cc
@@ -21,7 +21,9 @@
#include <rtems.h>
#include <stdio.h>
+#ifdef RTEMS_TEST_IO_STREAM
#include <iostream.h>
+#endif
extern "C" {
extern rtems_task main_task(rtems_task_argument);
@@ -108,7 +110,11 @@ cdtest(void)
A bar, blech, blah;
B bleak;
+#ifdef RTEMS_TEST_IO_STREAM
cout << "Testing a C++ I/O stream" << endl;
+#else
+ printf("IO Stream not tested\n");
+#endif
bar = blech;
}