From: Michal Sojka Date: Tue, 15 Nov 2005 07:24:00 +0000 (+0000) Subject: It is possible to compile gdb-stub under omk now. X-Git-Url: https://rtime.felk.cvut.cz/gitweb/sysless.git/commitdiff_plain/c4da0c002134521477f1e7f03836298be417821a It is possible to compile gdb-stub under omk now. darcs-hash:20051115072451-f2ef6-0880eac843d2bd51a5a37b8b65e4cb2dbfd82822.gz --- diff --git a/arch/h8300/generic/libs/gdbstub/Makefile b/arch/h8300/generic/libs/gdbstub/Makefile index 475699d..f595272 100644 --- a/arch/h8300/generic/libs/gdbstub/Makefile +++ b/arch/h8300/generic/libs/gdbstub/Makefile @@ -1,46 +1,14 @@ -############################################################################## -# -# Makefile - ID_CPU1 makefile for drivers -# -############################################################################## +# Generic directory or leaf node makefile for OCERA make framework -ifndef TOP -TOP = .. -CONFIG = $(TOP)/config +ifndef MAKERULES_DIR +MAKERULES_DIR := $(shell ( old_pwd="" ; while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" == `pwd` ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) ) endif -include $(CONFIG) - -######################## Additional Flags section ############################ - -# Directories list for header files -INCLUDEDIRS += -# Defines for preprocessor -DEFINES += - -# Compilation flags for C files OTHER than include directories -# Some drivers use outb macro, requires -O optimization -CFLAGS += -O -# Preprocessor flags OTHER than defines -CPPFLAGS += -# Linking flags -LDFLAGS += - -############################# targets section ################################ - -# If you want to create a library with the objects files, define the name here -LIBNAME = libgdbstub.a -LIBNAMESO = libgdbstub.so - -# List of objects to compile - -OBJS += gdb-stub.o h8s-2633.o h8s-2633-sci.o - -ASMOBJS += h8s-2633-asm.o - -######################### Makefile.rules section ############################# - -include $(TOP)/Makefile.rules - -######################## Tools targets section ############################### +ifeq ($(MAKERULES_DIR),) +all : default +.DEFAULT:: + @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n" +else +include $(MAKERULES_DIR)/Makefile.rules +endif diff --git a/arch/h8300/generic/libs/gdbstub/Makefile.omk b/arch/h8300/generic/libs/gdbstub/Makefile.omk new file mode 100644 index 0000000..0b1a32b --- /dev/null +++ b/arch/h8300/generic/libs/gdbstub/Makefile.omk @@ -0,0 +1,7 @@ +# -*- makefile -*- + +lib_LIBRARIES = gdbstub + +gdbstub_SOURCES = gdb-stub.c h8s-2633.c h8s-2633-sci.c h8s-2633-asm.S + +include_HEADERS = gdb-stub.h diff --git a/arch/h8300/generic/libs/gdbstub/Makefile.std b/arch/h8300/generic/libs/gdbstub/Makefile.std new file mode 100644 index 0000000..475699d --- /dev/null +++ b/arch/h8300/generic/libs/gdbstub/Makefile.std @@ -0,0 +1,46 @@ +############################################################################## +# +# Makefile - ID_CPU1 makefile for drivers +# +############################################################################## + +ifndef TOP +TOP = .. +CONFIG = $(TOP)/config +endif + +include $(CONFIG) + +######################## Additional Flags section ############################ + +# Directories list for header files +INCLUDEDIRS += +# Defines for preprocessor +DEFINES += + +# Compilation flags for C files OTHER than include directories +# Some drivers use outb macro, requires -O optimization +CFLAGS += -O +# Preprocessor flags OTHER than defines +CPPFLAGS += +# Linking flags +LDFLAGS += + +############################# targets section ################################ + +# If you want to create a library with the objects files, define the name here +LIBNAME = libgdbstub.a +LIBNAMESO = libgdbstub.so + +# List of objects to compile + +OBJS += gdb-stub.o h8s-2633.o h8s-2633-sci.o + +ASMOBJS += h8s-2633-asm.o + +######################### Makefile.rules section ############################# + +include $(TOP)/Makefile.rules + +######################## Tools targets section ############################### + diff --git a/arch/h8300/generic/libs/gdbstub/common_def.h b/arch/h8300/generic/libs/gdbstub/common_def.h new file mode 100644 index 0000000..5b44cfa --- /dev/null +++ b/arch/h8300/generic/libs/gdbstub/common_def.h @@ -0,0 +1,10 @@ +#ifndef _COMMON_DEF_H +#define _COMMON_DEF_H + +#define UNUSED __attribute ((unused)) + +#ifndef BIT +#define BIT(n) (1 << n) +#endif + +#endif /* _COMMON_DEF_H */ diff --git a/arch/h8300/generic/libs/gdbstub/h8s-2633-defs.h b/arch/h8300/generic/libs/gdbstub/h8s-2633-defs.h index 3019e70..1a8274c 100644 --- a/arch/h8300/generic/libs/gdbstub/h8s-2633-defs.h +++ b/arch/h8300/generic/libs/gdbstub/h8s-2633-defs.h @@ -1,6 +1,8 @@ #ifndef H8S_2633_DEFS #define H8S_2633_DEFS +#include + /* use expedited response insead of just signal */ #define GDB_STATUS_EXPEDITED 1 /* fetch MAC from register file */ @@ -26,15 +28,15 @@ #define GDB_HOOK_SUPPORT 0 /* serial port to talk to gdb */ /*#define GDB_SCI_PORT 4 */ /* RS232/485 */ -#define GDB_SCI_PORT 0 /* IRDA */ +#define GDB_SCI_PORT 1 /* IRDA */ /* serial speed */ /*#define GDB_SCI_SPEED 115200U*/ #define GDB_SCI_SPEED 38400U /* clock speed */ /*#define TARGET_CLOCK_HZ 18432000.0*/ //#define TARGET_CLOCK_HZ 12000000 /*CPU_SYS_HZ*/ -#define TARGET_CLOCK_HZ 11059200 /*CPU_SYS_HZ*/ - +//#define TARGET_CLOCK_HZ 11059200 /*CPU_SYS_HZ*/ +#define TARGET_CLOCK_HZ CPU_SYS_HZ #endif diff --git a/arch/h8300/generic/libs/gdbstub/h8s-2633-rmap.h b/arch/h8300/generic/libs/gdbstub/h8s-2633-rmap.h index 6b6c678..882bac7 100644 --- a/arch/h8300/generic/libs/gdbstub/h8s-2633-rmap.h +++ b/arch/h8300/generic/libs/gdbstub/h8s-2633-rmap.h @@ -102,5 +102,14 @@ #define RTCOR R_UCHAR(0xfffffed9) /* Refresh timer const */ #define PFCR R_UCHAR(0xfffffdeb) /* Pin Function control */ +/* Exception vectors */ +#define EXCPTVEC_ERI0 80 /* SCI 0 */ +#define EXCPTVEC_ERI1 84 /* SCI 1 */ +#define EXCPTVEC_ERI2 88 /* SCI 2 */ +#define EXCPTVEC_NMI 7 +#define EXCPTVEC_TRAP2 10 +#define EXCPTVEC_TRAP3 11 +#define EXCPTVEC_PBC 27 + #endif diff --git a/arch/h8300/generic/libs/gdbstub/h8s-2633.c b/arch/h8300/generic/libs/gdbstub/h8s-2633.c index 983866f..04248a3 100644 --- a/arch/h8300/generic/libs/gdbstub/h8s-2633.c +++ b/arch/h8300/generic/libs/gdbstub/h8s-2633.c @@ -584,7 +584,7 @@ void gdb_kill ( void ) #if defined(HW_INDEPENDENT)&&HW_INDEPENDENT #include "cpu_def.h" #include "system_def.h" -#include "h8s2633h.h" +/* #include "h8s2638h.h" */ /* extern void *excptvec_get(int vectnum); */ /* extern void *excptvec_set(int vectnum,void *vect); */ @@ -595,7 +595,7 @@ void gdb_kill ( void ) void gdb_platform_init() { #if defined(HW_INDEPENDENT)&&HW_INDEPENDENT static const int sci_vect_tab[]= - {EXCPTVEC_ERI0,EXCPTVEC_ERI1,EXCPTVEC_ERI2,EXCPTVEC_ERI3,EXCPTVEC_ERI4}; + {EXCPTVEC_ERI0,EXCPTVEC_ERI1,EXCPTVEC_ERI2}; int sci_vect=sci_vect_tab[GDB_SCI_PORT]; excptvec_initfill(gdb_unhandled_isr,0);