From f43dbdc61b885a617a0e8d73bf565e48ee4d96ba Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 12 Mar 2009 18:46:53 +0000 Subject: Cortex-M3 optimization. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@834 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- ports/ARMCM3/chcore.c | 13 ------------- ports/ARMCM3/chcore.h | 5 ++--- 2 files changed, 2 insertions(+), 16 deletions(-) (limited to 'ports') diff --git a/ports/ARMCM3/chcore.c b/ports/ARMCM3/chcore.c index 4c23b2da4..b075ec27c 100644 --- a/ports/ARMCM3/chcore.c +++ b/ports/ARMCM3/chcore.c @@ -42,19 +42,6 @@ void port_halt(void) { } } -/** - * Start a thread by invoking its work function. - * If the work function returns @p chThdExit() is automatically invoked. - */ -/** @cond never */ -__attribute__((naked, weak)) -/** @endcond */ -void threadstart(void) { - - asm volatile ("blx r1 \n\t" \ - "bl chThdExit"); -} - /** * System Timer vector. * This interrupt is used as system tick. diff --git a/ports/ARMCM3/chcore.h b/ports/ARMCM3/chcore.h index dd810df36..477e2fede 100644 --- a/ports/ARMCM3/chcore.h +++ b/ports/ARMCM3/chcore.h @@ -155,8 +155,8 @@ struct context { tp->p_ctx.r13->basepri = BASEPRI_USER; \ tp->p_ctx.r13->lr_exc = (regarm_t)0xFFFFFFFD; \ tp->p_ctx.r13->r0 = arg; \ - tp->p_ctx.r13->r1 = pf; \ - tp->p_ctx.r13->pc = threadstart; \ + tp->p_ctx.r13->lr_thd = chThdExit; \ + tp->p_ctx.r13->pc = pf; \ tp->p_ctx.r13->xpsr = (regarm_t)0x01000000; \ } @@ -303,7 +303,6 @@ struct context { extern "C" { #endif void port_halt(void); - void threadstart(void); #ifdef __cplusplus } #endif -- cgit v1.2.3