Commit de6f590c authored by Damien George's avatar Damien George
Browse files

leon: Make sparc_install_ta_3_window_flush_isr always available.

The header sparcisr.h is part of the ABI and may be included by code which
does not define RTEMS_4_8_EDISOFT yet uses 4.8 Edisoft.  In such cases the
definition of sparc_install_ta_3_window_flush_isr will be inconsistent.  So
just make this function always available, and provide the correct
definition in the .c file (which must have RTEMS_4_8_EDISOFT defined if
that toolchain is used).
parent db01b38c
......@@ -27,7 +27,7 @@ CFLAGS += -DRTEMS_4_8 -DRTEMS_4_8_EDISOFT
CFLAGS += -I$(LEON_COMMON_FROM_HERE)/libc-include
CFLAGS += -B/opt/rtems-4.8/sparc-rtems4.8/leon2/lib
LIBS += -Wl,--start-group -lrtemscpu -lio -lno_event -lmsg -lsem -ltimer -lno_rtmon -lno_ext -lrtemsbsp -lrtemscpu -Wl,--end-group
SRC_RTEMS = leon-common/sparcisr.c leon-common/leon2serial.c
SRC_RTEMS = leon-common/leon2serial.c
endif
# Settings for RTEMS 4.8 Gaisler
......
......@@ -6,6 +6,8 @@
#include <stdint.h>
#include "leon-common/sparcisr.h"
#if RTEMS_4_8_EDISOFT
// This function retrieves the value of the Trap Base Register, to be used
// to install a window flushing trap handler next.
static void TRAP_read_TBR(volatile uint32_t* const tbrPtr) {
......@@ -31,3 +33,11 @@ void sparc_install_ta_3_window_flush_isr(void) {
m[2] = 0x81c52000 | (addr & 0x3ff); // jmp %l4 + (addr & 0x3ff)
m[3] = 0xa6102083; // mov 0x83, %l3
}
#else
// For non-Edisoft builds the "ta 3" ISR is already installed.
void sparc_install_ta_3_window_flush_isr(void) {
}
#endif
......@@ -5,15 +5,5 @@
#pragma once
#if RTEMS_4_8_EDISOFT
// This function is needed to install the "ta 3" window flush handler.
void sparc_install_ta_3_window_flush_isr(void);
#else
// This function is not needed for non-Edisoft builds.
static inline void sparc_install_ta_3_window_flush_isr(void) {
}
#endif
......@@ -41,6 +41,7 @@ LIBS += -lm
SRC_C = \
main.c \
lib/libc/string0.c \
$(LEON_COMMON)/sparcisr.c \
$(LEON_COMMON)/leonprintf.c \
$(LEON_COMMON)/mputil.c \
$(LEON_COMMON)/mpvmmanage.c \
......
......@@ -41,6 +41,7 @@ LIBS += -lm
SRC_C = \
main.c \
lib/libc/string0.c \
$(LEON_COMMON)/sparcisr.c \
$(LEON_COMMON)/leonprintf.c \
$(LEON_COMMON)/mputil.c \
$(LEON_COMMON)/mphalport.c \
......
......@@ -43,6 +43,7 @@ LIBS += -lm
SRC_C = \
main.c \
lib/libc/string0.c \
$(LEON_COMMON)/sparcisr.c \
$(LEON_COMMON)/leonprintf.c \
$(LEON_COMMON)/mputil.c \
$(LEON_COMMON)/mphalport.c \
......
......@@ -41,6 +41,7 @@ LIBS += -lm
SRC_C = \
main.c \
lib/libc/string0.c \
$(LEON_COMMON)/sparcisr.c \
$(LEON_COMMON)/leonprintf.c \
$(LEON_COMMON)/mputil.c \
$(LEON_COMMON)/mphalport.c \
......
......@@ -48,6 +48,7 @@ SRC_C = \
lib/libc/strcmp.c \
lib/libc/strlen.c \
lib/libc/strncmp.c \
$(LEON_COMMON)/sparcisr.c \
$(LEON_COMMON)/leonprintf.c \
$(LEON_COMMON)/nearbyint.c \
$(LEON_COMMON)/mputil.c \
......
......@@ -48,6 +48,7 @@ SRC_C = \
lib/libc/strcmp.c \
lib/libc/strlen.c \
lib/libc/strncmp.c \
$(LEON_COMMON)/sparcisr.c \
$(LEON_COMMON)/leonprintf.c \
$(LEON_COMMON)/nearbyint.c \
$(LEON_COMMON)/mputil.c \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment