summaryrefslogtreecommitdiffstats
path: root/c
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 /c
parentAdded support for rtems_message_queue_get_number_pending. (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.
Diffstat (limited to 'c')
-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
7 files changed, 84 insertions, 6 deletions
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;
}