From 9c47f874c4c211932bf113c39e20cd7c400afef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= Date: Wed, 10 Aug 2016 03:50:37 +0200 Subject: [PATCH] CC2538: Enable Cortex-M mtarch implementation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Benoît Thébaudeau --- cpu/cc2538/Makefile.cc2538 | 4 ++-- cpu/cc2538/mtarch.h | 48 -------------------------------------- cpu/cc2538/startup-gcc.c | 6 +++-- 3 files changed, 6 insertions(+), 52 deletions(-) delete mode 100644 cpu/cc2538/mtarch.h diff --git a/cpu/cc2538/Makefile.cc2538 b/cpu/cc2538/Makefile.cc2538 index b67749786..ce913bb98 100644 --- a/cpu/cc2538/Makefile.cc2538 +++ b/cpu/cc2538/Makefile.cc2538 @@ -14,7 +14,7 @@ LDSCRIPT = $(OBJECTDIR)/cc2538.ld CFLAGS += -mcpu=cortex-m3 -mthumb -mlittle-endian CFLAGS += -ffunction-sections -fdata-sections CFLAGS += -fshort-enums -fomit-frame-pointer -fno-strict-aliasing -CFLAGS += -Wall +CFLAGS += -Wall -DCMSIS_DEV_HDR=\"cc2538_cm3.h\" LDFLAGS += -mcpu=cortex-m3 -mthumb -nostartfiles LDFLAGS += -T $(LDSCRIPT) LDFLAGS += -Wl,--gc-sections,--sort-section=alignment @@ -79,7 +79,7 @@ CPU_STARTFILES = ${addprefix $(OBJECTDIR)/,${call oname, $(CPU_START_SOURCEFILES CONTIKI_SOURCEFILES += $(CONTIKI_CPU_SOURCEFILES) $(DEBUG_IO_SOURCEFILES) CONTIKI_SOURCEFILES += $(USB_CORE_SOURCEFILES) $(USB_ARCH_SOURCEFILES) -MODULES += lib/newlib +MODULES += lib/newlib cpu/arm/common/sys .SECONDEXPANSION: diff --git a/cpu/cc2538/mtarch.h b/cpu/cc2538/mtarch.h deleted file mode 100644 index 121150d14..000000000 --- a/cpu/cc2538/mtarch.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2010, Loughborough University - Computer Science - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * 3. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -/* - * \file - * Stub header file for multi-threading. It doesn't do anything, it - * just exists so that mt.c can compile cleanly. - * - * This is based on the original mtarch.h for z80 by Takahide Matsutsuka - * - * \author - * George Oikonomou - - */ -#ifndef MTARCH_H_ -#define MTARCH_H_ - -struct mtarch_thread { - unsigned char *sp; -}; - -#endif /* MTARCH_H_ */ diff --git a/cpu/cc2538/startup-gcc.c b/cpu/cc2538/startup-gcc.c index e09356e4d..547764ec3 100644 --- a/cpu/cc2538/startup-gcc.c +++ b/cpu/cc2538/startup-gcc.c @@ -52,6 +52,8 @@ void nmi_handler(void); void default_handler(void); /* System Handler and ISR prototypes implemented elsewhere */ +void svcall_handler(void); /* See mtarch.c */ +void pendsv_handler(void); /* See mtarch.c */ void clock_isr(void); /* SysTick Handler */ void gpio_port_a_isr(void); void gpio_port_b_isr(void); @@ -119,10 +121,10 @@ void(*const vectors[])(void) = 0, /* 8 Reserved */ 0, /* 9 Reserved */ 0, /* 10 Reserved */ - default_handler, /* 11 SVCall handler */ + svcall_handler, /* 11 SVCall handler */ default_handler, /* 12 Debug monitor handler */ 0, /* 13 Reserved */ - default_handler, /* 14 The PendSV handler */ + pendsv_handler, /* 14 The PendSV handler */ clock_isr, /* 15 The SysTick handler */ gpio_port_a_isr, /* 16 GPIO Port A */ gpio_port_b_isr, /* 17 GPIO Port B */