]> rtime.felk.cvut.cz Git - arc.git/commitdiff
More improvements on ARM. PowerPC changed to have simular changes. Tweaking with...
authormahi <devnull@localhost>
Mon, 28 Sep 2009 19:29:10 +0000 (21:29 +0200)
committermahi <devnull@localhost>
Mon, 28 Sep 2009 19:29:10 +0000 (21:29 +0200)
37 files changed:
arch/arm/arm_cm3/kernel/Frt.c
arch/arm/arm_cm3/scripts/linkscript_gcc.ldf
arch/ppc/mpc55xx/drivers/Frt.c
arch/ppc/mpc55xx/drivers/Mcu_Exceptions.sx
arch/ppc/mpc55xx/drivers/Mcu_IntcVectors.c [deleted file]
arch/ppc/mpc55xx/kernel/int_ctrl.c
boards/board_common.mk
boards/et_stm32_stamp/build_config.mk
common/arc.c [new file with mode: 0644]
common/newlib_port.c
communication/PduR/makefile
communication/PduR/test/makefile
examples/blinker_node/config/Os_Cfg.c
examples/blinker_node/makefile
examples/pwm_node/config/Os_Cfg.c
examples/pwm_node/makefile
examples/pwm_node2/config/Os_Cfg.c
examples/pwm_node2/makefile
examples/simple/config/Os_Cfg.c
examples/simple/makefile
examples/switch_node/config/Os_Cfg.c
examples/switch_node/makefile
examples/tiny/makefile
include/Os.h
include/arc.h [new file with mode: 0644]
include/int_ctrl.h
include/ppc/asm_book_e.h
scripts/build_arm.sh
scripts/rules.mk
system/kernel/create.c
system/kernel/init.c
system/kernel/testsystem/build_config.mk
system/kernel/testsystem/config/Os_Cfg.c
system/kernel/testsystem/config/Os_Cfg.h
system/kernel/testsystem/makefile
system/kernel/testsystem/test_framework.c
system/kernel/testsystem/test_master.c

index e58a34cbc8bdcd518a1f23dcf79bd543abb8ef2a..867b074a293b135337bf743e8ef13dd462f966b8 100644 (file)
  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  * for more details.
  * -------------------------------- Arctic Core ------------------------------*/
-
-
-
-
-
-
-
-
-/*\r
- * timer.c\r
- *\r
- *  Created on: 2009-jan-17\r
- *      Author: mahi\r
- */\r
 \r
 #include "Os.h"\r
 #include "sys.h"\r
 #include "pcb.h"\r
 #include "internal.h"\r
 #include "stm32f10x.h"\r
-#include "core_cm3.h"\r
+#include "core_cm3.h"
+#include "int_ctrl.h"\r
 \r
 /**\r
  * Init of free running timer.\r
index ae60ea6dde9e791f56f4ca565ebac0226e666b77..9d466bc87ba401358318fd0abe0def6612bdf834 100644 (file)
@@ -8,6 +8,7 @@ Copyright RAISONANCE S.A.S. 2008
 /* Common part of the linker scripts for STM32 devices*/\r
 \r
 \r
+\r
 /* default stack sizes. \r
 \r
 These are used by the startup in order to allocate stacks for the different modes.\r
@@ -43,10 +44,6 @@ MEMORY
   RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K\r
   FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 128K\r
   FLASHB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0\r
-  EXTMEMB0 (rx) : ORIGIN = 0x00000000, LENGTH = 0\r
-  EXTMEMB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0\r
-  EXTMEMB2 (rx) : ORIGIN = 0x00000000, LENGTH = 0\r
-  EXTMEMB3 (rx) : ORIGIN = 0x00000000, LENGTH = 0\r
 }\r
 \r
 /* higher address of the user mode stack */\r
@@ -107,6 +104,13 @@ SECTIONS
     The program executes knowing that the data is in the RAM\r
     but the loader puts the initial values in the FLASH (inidata).\r
     It is one task of the startup to copy the initial values from FLASH to RAM. */\r
+\r
+/*\r
+       .heap : \r
+       {\r
+               *(.heap)\r
+       } >RAM\r
+*/\r
     .data  : AT ( _sidata )\r
     {\r
            . = ALIGN(4);\r
@@ -129,6 +133,7 @@ SECTIONS
            . = ALIGN(4);\r
         /* This is used by the startup in order to initialize the .bss secion */\r
         _sbss = .;\r
+        *(.heap)\r
         \r
         *(.bss)\r
         *(.t32_outport)\r
@@ -172,43 +177,7 @@ SECTIONS
     /* this is the EXTMEM */\r
     /* the C or assembly source must explicitly place the code or data there\r
     using the "section" attribute */\r
-    \r
-    /* EXTMEM Bank0 */\r
-    .eb0text :\r
-    {\r
-        *(.eb0text)                   /* remaining code */\r
-        *(.eb0rodata)                 /* read-only data (constants) */\r
-        *(.eb0rodata*)\r
-    } >EXTMEMB0\r
-    \r
-    /* EXTMEM Bank1 */\r
-    .eb1text :\r
-    {\r
-        *(.eb1text)                   /* remaining code */\r
-        *(.eb1rodata)                 /* read-only data (constants) */\r
-        *(.eb1rodata*)\r
-    } >EXTMEMB1\r
-    \r
-    /* EXTMEM Bank2 */\r
-    .eb2text :\r
-    {\r
-        *(.eb2text)                   /* remaining code */\r
-        *(.eb2rodata)                 /* read-only data (constants) */\r
-        *(.eb2rodata*)\r
-    } >EXTMEMB2\r
-    \r
-    /* EXTMEM Bank0 */\r
-    .eb3text :\r
-    {\r
-        *(.eb3text)                   /* remaining code */\r
-        *(.eb3rodata)                 /* read-only data (constants) */\r
-        *(.eb3rodata*)\r
-    } >EXTMEMB3\r
-    \r
-    \r
-    \r
-    /* after that it's only debugging information. */\r
-    \r
+           \r
     /* remove the debugging information from the standard libraries */\r
 \r
     /DISCARD/ :\r
index 289a16e98bbec5945ea8e4089897894964cd1041..1675857b8b848323502bea242062ac1f3a363e91 100644 (file)
  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  * for more details.
  * -------------------------------- Arctic Core ------------------------------*/
-
-
-
-
-
-
-
-
-/*\r
- * timer.c\r
- *\r
- *  Created on: 2009-jan-17\r
- *      Author: mahi\r
- */\r
 \r
 #include "Os.h"\r
 #include "sys.h"\r
 #include "pcb.h"\r
 #include "internal.h"\r
+#include "int_ctrl.h"
 \r
 /**\r
  * Init of free running timer.\r
index dc30c3d1042493ed653cce23f73522c1a61fdc8c..f403518156b960ca42f00ebb3bc752aa044f27af 100644 (file)
@@ -17,7 +17,7 @@
          _inst    _label;\r
 \r
 \r
-               .extern intc_vector_tbl\r
+               .extern IntCtrl_VectorTable\r
 \r
                .section .text\r
 //---------------------------------------------------------------\r
diff --git a/arch/ppc/mpc55xx/drivers/Mcu_IntcVectors.c b/arch/ppc/mpc55xx/drivers/Mcu_IntcVectors.c
deleted file mode 100644 (file)
index 07be631..0000000
+++ /dev/null
@@ -1,547 +0,0 @@
-/* -------------------------------- Arctic Core ------------------------------
- * Arctic Core - the open source AUTOSAR platform http://arccore.com
- *
- * Copyright (C) 2009  ArcCore AB <contact@arccore.com>
- *
- * This source code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published by the
- * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- * -------------------------------- Arctic Core ------------------------------*/
-
-
-
-
-
-
-
-
-#include "typedefs.h"\r
-#include "asm_book_e.h"\r
-#include "mpc55xx.h"\r
-#if !defined(USE_KERNEL)\r
-#include "Mcu.h"\r
-#endif\r
-#include <assert.h>\r
-//#include <stdio.h>\r
-\r
-#if defined(USE_KERNEL)\r
-#include "pcb.h"\r
-#include "sys.h"\r
-#include "internal.h"\r
-#include "task_i.h"\r
-#include "hooks.h"\r
-#include "swap.h"\r
-\r
-#define INTC_SSCIR0_CLR7                                       7\r
-#define MLB_SERVICE_REQUEST                                    293\r
-#define CRITICAL_INPUT_EXCEPTION                       320\r
-#define DEBUG_EXCEPTION                                                335\r
-#define NUMBER_OF_INTERRUPTS_AND_EXCEPTIONS    336\r
-\r
-#include "Trace.h"\r
-#endif\r
-\r
-static void dump_exception_regs( uint32_t *regs );\r
-\r
-typedef void (*f_t)( uint32_t *);\r
-typedef void (*func_t)();\r
-\r
-#if defined(USE_KERNEL)\r
-extern void * intc_vector_tbl[NUMBER_OF_INTERRUPTS_AND_EXCEPTIONS];\r
-extern uint8 intc_type_tbl[NUMBER_OF_INTERRUPTS_AND_EXCEPTIONS];\r
-#else\r
-extern func_t intc_vector_tbl[];\r
-#endif\r
-\r
-/* Handle INTC\r
- *\r
- * When we get here we have saved\r
- * - exception frame\r
- * - VGPR\r
- * - ?\r
- *\r
- * */\r
-\r
-\r
-\r
-void IntCtrl_AttachIsr1( void (*entry)(void), void *int_ctrl, uint32_t vector,uint8_t prio) {\r
-#if defined(CFG_MPC5516)\r
-       uint8_t cpu = 0; /* 0- cpu Z1, 1-CPU Z0(slave) */\r
-#endif\r
-\r
-       intc_vector_tbl[vector] = (void *)entry;\r
-       intc_type_tbl[vector] = PROC_ISR1;\r
-\r
-       if (vector <= MLB_SERVICE_REQUEST) {\r
-#if defined(CFG_MPC5516)\r
-               INTC.PSR[vector].B.PRC_SEL = cpu;\r
-#endif\r
-               INTC.PSR[vector].B.PRI = prio;\r
-\r
-       } else if ((vector >= CRITICAL_INPUT_EXCEPTION) && (vector\r
-                       <= DEBUG_EXCEPTION)) {\r
-       } else {\r
-               /* Invalid vector! */\r
-               assert(0);\r
-       }\r
-\r
-}\r
-\r
-void IntCtrl_AttachIsr2(TaskType tid,void *int_ctrl,uint32_t vector ) {\r
-#if defined(CFG_MPC5516)\r
-       uint8_t cpu = 0; /* 0- cpu Z1, 1-CPU Z0(slave) */\r
-#endif\r
-       pcb_t *pcb;\r
-\r
-       pcb = os_find_task(tid);\r
-       intc_vector_tbl[vector] = (void *)pcb;\r
-       intc_type_tbl[vector] = PROC_ISR2;\r
-\r
-       if (vector <= MLB_SERVICE_REQUEST) {\r
-#if defined(CFG_MPC5516)\r
-               INTC.PSR[vector].B.PRC_SEL = cpu;\r
-#endif\r
-               INTC.PSR[vector].B.PRI = pcb->prio;\r
-\r
-       } else if ((vector >= CRITICAL_INPUT_EXCEPTION) && (vector\r
-                       <= DEBUG_EXCEPTION)) {\r
-       } else {\r
-               /* Invalid vector! */\r
-               assert(0);\r
-       }\r
-}\r
-\r
-\r
-/**\r
- *\r
- * USE_KERNEL\r
- * Following must be done before coming here:\r
- * - Swapped to interrupt stack, or???\r
- *\r
- * @param stack Ptr to current stack. The context just saved\r
- * can be access with positive offsets.\r
- */\r
-\r
-void *mcu_intc( uint32_t *stack ) {\r
-       uint32_t vector;\r
-\r
-#if defined(CFG_MPC5516)\r
-       struct INTC_tag *intc = &INTC;\r
-#else\r
-       volatile struct INTC_tag *intc = &INTC;\r
-#endif\r
-\r
-#if defined(USE_KERNEL)\r
-       struct pcb_s *pcb;\r
-       struct pcb_s *preempted_pcb;\r
-#else\r
-       func_t t;\r
-#endif\r
-\r
-       // Check for exception\r
-       if( stack[EXC_VECTOR_OFF/sizeof(uint32_t)]>=CRITICAL_INPUT_EXCEPTION )\r
-       {\r
-               vector = stack[EXC_VECTOR_OFF/sizeof(uint32_t)];\r
-       }\r
-       else\r
-       {\r
-#if defined(CFG_MPC5516)\r
-               vector = (intc->IACKR_PRC0.B.INTVEC_PRC0);\r
-#else\r
-               vector = (intc->IACKR.B.INTVEC);\r
-#endif\r
-               // save the vector for later\r
-               stack[EXC_VECTOR_OFF/sizeof(uint32_t)] = vector;\r
-\r
-               // Check for software interrupt\r
-               if((uint32_t)vector<=INTC_SSCIR0_CLR7)\r
-               {\r
-                       // Clear soft int\r
-                       intc->SSCIR[vector].B.CLR = 1;\r
-               }\r
-       }\r
-\r
-#if defined(USE_KERNEL)\r
-\r
-       os_sys.int_nest_cnt++;\r
-\r
-       if( intc_type_tbl[vector] == PROC_ISR1 ) {\r
-               // It's a function, just call it.\r
-               ((func_t)intc_vector_tbl[vector])();\r
-       } else {\r
-               // It's a PCB\r
-\r
-               // Save info for preemted pcb\r
-               preempted_pcb = get_curr_pcb();\r
-               preempted_pcb->stack.curr = stack;\r
-               preempted_pcb->state = ST_READY;\r
-               os_isr_printf(D_TASK,"Preempted %s\n",preempted_pcb->name);\r
-\r
-               POSTTASKHOOK();\r
-\r
-               pcb = intc_vector_tbl[vector];\r
-               pcb->state = ST_RUNNING;\r
-               set_curr_pcb(pcb);\r
-\r
-               PRETASKHOOK();\r
-\r
-               // We should not get here if we're SCHEDULING_NONE\r
-               if( pcb->scheduling == SCHEDULING_NONE) {\r
-                       // TODO:\r
-                       // assert(0);\r
-                       while(1);\r
-               }\r
-               //Irq_Enable(); // Added by Mattias\r
-               //Irq_Enable();\r
-               pcb->entry();\r
-               Irq_Disable();\r
-       }\r
-\r
-       pcb->state = ST_SUSPENDED;\r
-       POSTTASKHOOK();\r
-\r
-       // write 0 to pop INTC stack\r
-\r
-#if defined(CFG_MPC5516)\r
-       intc->EOIR_PRC0.R = 0;\r
-#else\r
-       intc->EOIR.R = 0;\r
-#endif\r
-       --os_sys.int_nest_cnt;\r
-\r
-       // TODO: Check stack check marker....\r
-       // We have preempted a task\r
-       if( (os_sys.int_nest_cnt == 0) ) { //&& is_idle_task() ) {\r
-               /* If we get here:\r
-                * - the preempted task is saved with large context.\r
-                * - We are on interrupt stack..( this function )\r
-                *\r
-                * if we find a new task:\r
-                * - just switch in the new context( don't save the old because\r
-                *   its already saved )\r
-                *\r
-                */\r
-               pcb_t *new_pcb;\r
-               new_pcb = os_find_top_prio_proc();\r
-               if( new_pcb != preempted_pcb ) {\r
-                       os_isr_printf(D_TASK,"Found candidate %s\n",new_pcb->name);\r
-//#warning os_swap_context_to should call the pretaskswaphook\r
-                       os_swap_context_to(NULL,new_pcb);\r
-               } else {\r
-                       if( new_pcb == NULL ) {\r
-                               assert(0);\r
-                       }\r
-                       preempted_pcb->state = ST_RUNNING;\r
-                       set_curr_pcb(preempted_pcb);\r
-               }\r
-       }\r
-\r
-       return stack;\r
-\r
-#else\r
-       //read address\r
-       t = (func_t)intc_vector_tbl[vector];\r
-\r
-       if( t == ((void *)0) )\r
-       {\r
-               while(1);\r
-       }\r
-\r
-       // Enable nestling interrupts\r
-       Irq_Enable();\r
-       t();\r
-       Irq_Disable();\r
-\r
-       if( vector < INTC_NUMBER_OF_INTERRUPTS )\r
-       {\r
-               // write 0 to pop INTC stack\r
-               intc->EOIR_PRC0.R = 0;\r
-       }\r
-       return NULL;\r
-#endif\r
-}\r
-\r
-void dummy (void);\r
-\r
-// Critical Input Interrupt\r
-void IVOR0Exception (uint32_t *regs)\r
-{\r
-//     srr0 = get_spr(SPR_SRR0);\r
-//     srr1 = get_spr(SPR_SRR0);\r
-//     ExceptionSave(srr0,srr1,esr,mcsr,dear;)\r
-       // CSRR0, CSSR1\r
-       // Nothing more\r
-       dump_exception_regs(regs);\r
-       while (1);\r
-}\r
-\r
-// Machine check\r
-void IVOR1Exception (uint32_t *regs)\r
-{\r
-       // CSRR0, CSSR1\r
-       // MCSR - Source of machine check\r
-       dump_exception_regs(regs);\r
-   while (1);\r
-}\r
-// Data Storage Interrupt\r
-void IVOR2Exception (uint32_t *regs)\r
-{\r
-       // SRR0, SRR1\r
-       // ESR - lots of stuff\r
-       dump_exception_regs(regs);\r
-   while (1);\r
-}\r
-\r
-// Instruction Storage Interrupt\r
-void IVOR3Exception (uint32_t *regs)\r
-{\r
-       // SRR0, SRR1\r
-       // ESR - lots of stuff\r
-       dump_exception_regs(regs);\r
-   while (1);\r
-}\r
-\r
-// Alignment Interrupt\r
-void IVOR5Exception (uint32_t *regs)\r
-{\r
-       // SRR0, SRR1\r
-       // ESR - lots of stuff\r
-       // DEAR - Address of load store that caused the exception\r
-       dump_exception_regs(regs);\r
-   while (1);\r
-}\r
-\r
-// Program Interrupt\r
-void IVOR6Exception (uint32_t *regs)\r
-{\r
-       // SRR0, SRR1\r
-       // ESR - lots of stuff\r
-       dump_exception_regs(regs);\r
-       while (1);\r
-}\r
-\r
-// Floating point unavailable\r
-void IVOR7Exception (uint32_t *regs)\r
-{\r
-       // SRR0, SRR1\r
-       dump_exception_regs(regs);\r
-   while (1);\r
-}\r
-\r
-// System call\r
-void IVOR8Exception (uint32_t *regs)\r
-{\r
-       // SRR0, SRR1\r
-       // ESR\r
-       dump_exception_regs(regs);\r
-       while (1);\r
-}\r
-\r
-// Aux processor Unavailable\r
-void IVOR9Exception (uint32_t *regs)\r
-{\r
-       // Does not happen on e200\r
-       dump_exception_regs(regs);\r
-       while (1);\r
-}\r
-#if 0\r
-// Decrementer\r
-void IVOR10Exception (uint32_t *regs)\r
-{\r
-       // SRR0, SRR1\r
-       while (1);\r
-}\r
-#endif\r
-\r
-// FIT\r
-void IVOR11Exception (uint32_t *regs)\r
-{\r
-       // SRR0, SRR1\r
-       dump_exception_regs(regs);\r
-       while (1);\r
-}\r
-\r
-// Watchdog Timer\r
-void IVOR12Exception (uint32_t *regs)\r
-{\r
-       // SRR0, SRR1\r
-       dump_exception_regs(regs);\r
-       while (1);\r
-}\r
-\r
-// Data TLB Error Interrupt\r
-void IVOR13Exception (uint32_t *regs)\r
-{\r
-#if 0\r
-       uint32_t srr0,srr1,esr,dear;\r
-\r
-       srr0 = regs[SC_GPRS_SIZE+(EXC_SRR0_OFF/4)];\r
-       srr1 = regs[SC_GPRS_SIZE+(EXC_SRR1_OFF/4)];\r
-       esr = regs[SC_GPRS_SIZE+(EXC_ESR_OFF/4)];\r
-       dear = regs[SC_GPRS_SIZE+(EXC_DEAR_OFF/4)];\r
-       dump_exception_regs(regs);\r
-#endif\r
-\r
-       // SRR0, SRR1\r
-       // ESR - lots\r
-       // DEAR -\r
-       while (1);\r
-}\r
-\r
-// Instruction TLB Error Interupt\r
-void IVOR14Exception (uint32_t *regs)\r
-{\r
-       // SRR0, SRR1\r
-       // ESR - MIF set, All others cleared\r
-       dump_exception_regs(regs);\r
-       while (1);\r
-}\r
-\r
-void IVOR15Exception (uint32_t *regs)\r
-{\r
-       // Debug\r
-       dump_exception_regs(regs);\r
-       while (1);\r
-}\r
-\r
-#if defined(CFG_CONSOLE_T32) || defined(CFG_CONSOLE_WINIDEA)\r
-\r
-typedef struct {\r
-       uint32_t sp;\r
-       uint32_t bc;  // backchain\r
-       uint32_t pad;\r
-       uint32_t srr0;\r
-       uint32_t srr1;\r
-       uint32_t lr;\r
-       uint32_t ctr;\r
-       uint32_t xer;\r
-       uint32_t cr;\r
-       uint32_t esr;\r
-       uint32_t mcsr;\r
-       uint32_t dear;\r
-       uint32_t vector;\r
-       uint32_t r3;\r
-       uint32_t r4;\r
-} exc_stack_t;\r
-\r
-\r
-\r
-static void dump_exception_regs( uint32_t *regs ) {\r
-       exc_stack_t *r = (exc_stack_t *)regs;\r
-\r
-dbg_printf("sp   %08x  srr0 %08x  srr1 %08x\n",r->sp,r->srr0,r->srr1);\r
-dbg_printf("lr   %08x  ctr  %08x  xer  %08x\n",r->lr,r->ctr,r->xer);\r
-dbg_printf("cr   %08x  esr  %08x  mcsr %08x\n",r->cr,r->esr,r->mcsr);\r
-dbg_printf("dear %08x  vec  %08x  r3   %08x\n",r->dear,r->vector,r->r3);\r
-dbg_printf("r4   %08x\n",r->r4);\r
-}\r
-\r
-#else\r
-static void dump_exception_regs( uint32_t *regs ) {\r
-}\r
-#endif\r
-\r
-#if !defined(USE_KERNEL)\r
-func_t intc_vector_tbl[NUMBER_OF_INTERRUPTS_AND_EXCEPTIONS] __attribute__ ((aligned (0x800))) = {\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 00 - 04 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 05 - 09 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 10 - 14 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 15 - 19 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 20 - 24 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 25 - 29 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 30 - 34 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 35 - 39 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 40 - 44 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 45 - 49 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 50 - 54 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 55 - 59 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 60 - 64 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 55 - 69 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 70 - 74 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 75 - 79 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 80 - 84 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 85 - 89 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 90 - 94 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 95 - 99 */\r
-\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 100 - 104 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 105 - 109 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 110 - 114 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 115 - 119 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 120 - 124 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 125 - 129 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 130 - 134 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 135 - 139 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 140 - 144 */\r
- dummy, dummy, dummy, dummy, dummy /* PIT1 */, /* ISRs 145 - 149 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 150 - 154 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 155 - 159 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 160 - 164 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 155 - 169 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 170 - 174 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 175 - 179 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 180 - 184 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 185 - 189 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 190 - 194 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 195 - 199 */\r
-\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 200 - 204 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 205 - 209 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 210 - 214 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 215 - 219 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 220 - 224 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 225 - 229 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 230 - 234 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 235 - 239 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 240 - 244 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 245 - 249 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 250 - 254 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 255 - 259 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 260 - 264 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 255 - 269 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 270 - 274 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 275 - 279 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 280 - 284 */\r
- dummy, dummy, dummy, dummy, dummy, /* ISRs 285 - 289 */\r
- dummy, dummy, dummy, dummy,        /* ISRs 290 - 293 */\r
-\r
- /* Some reserved vectors between INC interrupts and exceptions. */\r
- dummy,                             /* INTC_NUMBER_OF_INTERRUPTS */\r
-\r
- dummy, dummy, dummy, dummy, dummy,\r
- dummy, dummy, dummy, dummy, dummy,\r
- dummy, dummy, dummy, dummy, dummy,\r
- dummy, dummy, dummy, dummy, dummy,\r
- dummy, dummy, dummy, dummy, dummy,\r
-\r
- IVOR0Exception,                    /* CRITICAL_INPUT_EXCEPTION, */\r
- IVOR1Exception,                    /* MACHINE_CHECK_EXCEPTION */\r
- IVOR2Exception,                    /* DATA_STORAGE_EXCEPTION */\r
- IVOR3Exception,                    /* INSTRUCTION_STORAGE_EXCEPTION */\r
- dummy,                             /* EXTERNAL_INTERRUPT */\r
-                                    /* This is the place where the "normal" interrupts will hit the CPU... */\r
- IVOR5Exception,                    /* ALIGNMENT_EXCEPTION */\r
- IVOR6Exception,                    /* PROGRAM_EXCEPTION */\r
- IVOR7Exception,                    /* FLOATING_POINT_EXCEPTION */\r
- IVOR8Exception,                    /* SYSTEM_CALL_EXCEPTION */\r
- dummy,                             /* AUX_EXCEPTION Not implemented in MPC5516. */\r
- dummy,                             /* DECREMENTER_EXCEPTION */\r
- IVOR11Exception,                   /* FIXED_INTERVAL_TIMER_EXCEPTION */\r
- IVOR12Exception,                   /* WATCHDOG_TIMER_EXCEPTION */\r
- IVOR13Exception,                   /* DATA_TLB_EXCEPTION */\r
- IVOR14Exception,                   /* INSTRUCTION_TLB_EXCEPTION */\r
- IVOR15Exception,                   /* DEBUG_EXCEPTION */\r
-};\r
-\r
-void dummy (void) {\r
-   while (1){\r
-          /* TODO: Rename and check for what spurious interrupt have happend */\r
-   };\r
- }\r
-\r
-#endif\r
index 79b4b8ed494a052db1c31b8ebbfacb91bc724a74..c7bb3f713be400fe663035e1f5eeb87d316cb473 100644 (file)
@@ -61,16 +61,16 @@ static void dump_exception_regs( uint32_t *regs );
 
 typedef void (*f_t)( uint32_t *);
 typedef void (*func_t)();
-//extern vfunc_t intc_vector_tbl[];
+//extern vfunc_t IntCtrl_VectorTable[];
 extern void exception_tbl(void);
 
 
 
 #if defined(USE_KERNEL)
-extern void * intc_vector_tbl[NUMBER_OF_INTERRUPTS_AND_EXCEPTIONS];
+extern void * IntCtrl_VectorTable[NUMBER_OF_INTERRUPTS_AND_EXCEPTIONS];
 extern uint8 intc_type_tbl[NUMBER_OF_INTERRUPTS_AND_EXCEPTIONS];
 #else
-extern func_t intc_vector_tbl[];
+extern func_t IntCtrl_VectorTable[];
 #endif
 
 // write 0 to pop INTC stack
@@ -132,11 +132,11 @@ void IntCtrl_Init( void ) {
 
 
          // Check alignment requirements for the INTC table
-         assert( (((uint32_t)&intc_vector_tbl[0]) & 0x7ff) == 0 );
+         assert( (((uint32_t)&IntCtrl_VectorTable[0]) & 0x7ff) == 0 );
        #if defined(CFG_MPC5516)
-         INTC.IACKR_PRC0.R = (uint32_t) & intc_vector_tbl[0]; // Set INTC ISR vector table
+         INTC.IACKR_PRC0.R = (uint32_t) & IntCtrl_VectorTable[0]; // Set INTC ISR vector table
        #elif defined(CFG_MPC5554) || defined(CFG_MPC5567)
-         INTC.IACKR.R = (uint32_t) & intc_vector_tbl[0]; // Set INTC ISR vector table
+         INTC.IACKR.R = (uint32_t) & IntCtrl_VectorTable[0]; // Set INTC ISR vector table
        #endif
          // Pop the FIFO queue
          for (int i = 0; i < 15; i++)
@@ -212,18 +212,18 @@ void *IntCtrl_Entry( void *stack_p )
 
        if( intc_type_tbl[vector] == PROC_ISR1 ) {
                // It's a function, just call it.
-               ((func_t)intc_vector_tbl[vector])();
+               ((func_t)IntCtrl_VectorTable[vector])();
                return stack;
        } else {
                // It's a PCB
                // Let the kernel handle the rest,
-               return Os_Isr(stack, (void *)intc_vector_tbl[vector]);
+               return Os_Isr(stack, (void *)IntCtrl_VectorTable[vector]);
        }
 
 
 #else
                //read address
-       t = (func_t)intc_vector_tbl[vector];
+       t = (func_t)IntCtrl_VectorTable[vector];
 
        if( t == ((void *)0) )
        {
@@ -257,7 +257,7 @@ void *IntCtrl_Entry( void *stack_p )
  * @param prio
  */
 void IntCtrl_AttachIsr1( void (*entry)(void), void *int_ctrl, uint32_t vector,uint8_t prio) {
-       intc_vector_tbl[vector] = (void *)entry;
+       IntCtrl_VectorTable[vector] = (void *)entry;
        intc_type_tbl[vector] = PROC_ISR1;
 
        if (vector < INTC_NUMBER_OF_INTERRUPTS) {
@@ -287,7 +287,7 @@ void IntCtrl_AttachIsr2(TaskType tid,void *int_ctrl,uint32_t vector ) {
        pcb_t *pcb;
 
        pcb = os_find_task(tid);
-       intc_vector_tbl[vector] = (void *)pcb;
+       IntCtrl_VectorTable[vector] = (void *)pcb;
        intc_type_tbl[vector] = PROC_ISR2;
 
        if (vector < INTC_NUMBER_OF_INTERRUPTS) {
@@ -325,18 +325,18 @@ void IntCtrl_InstallVector(void(*func)(), IrqType vector,
 {
   VALIDATE( ( 1 == Mcu_Global.initRun ), MCU_INTCVECTORINSTALL_SERVICE_ID, MCU_E_UNINIT );
   DEBUG(DEBUG_LOW,"Installing INTC vector:%d,prio:%d,cpu,%d\n",vector,priority,cpu);
-  intc_vector_tbl[vector] = func;
+  IntCtrl_VectorTable[vector] = func;
 
   if (vector <= MLB_SERVICE_REQUEST)
   {
     INTC.PSR[vector].B.PRC_SEL = cpu;
     INTC.PSR[vector].B.PRI = priority;
 
-    intc_vector_tbl[vector] = func;
+    IntCtrl_VectorTable[vector] = func;
   } else if ((vector >= CRITICAL_INPUT_EXCEPTION)
       && (vector <= DEBUG_EXCEPTION))
   {
-    intc_vector_tbl[vector] = func;
+    IntCtrl_VectorTable[vector] = func;
   } else
   {
     /* Invalid vector! */
@@ -555,7 +555,7 @@ static void dump_exception_regs( uint32_t *regs ) {
 #endif
 
 #if !defined(USE_KERNEL)
-func_t intc_vector_tbl[NUMBER_OF_INTERRUPTS_AND_EXCEPTIONS] __attribute__ ((aligned (0x800))) = {
+func_t IntCtrl_VectorTable[NUMBER_OF_INTERRUPTS_AND_EXCEPTIONS] __attribute__ ((aligned (0x800))) = {
  dummy, dummy, dummy, dummy, dummy, /* ISRs 00 - 04 */
  dummy, dummy, dummy, dummy, dummy, /* ISRs 05 - 09 */
  dummy, dummy, dummy, dummy, dummy, /* ISRs 10 - 14 */
index b266ba6f4a22574b27a22e967883e6fa23d815e1..1870e275b70a1ccc598514c74b7f5d2d6dc415b2 100644 (file)
@@ -27,7 +27,6 @@ inc-$(USE_DMA) += $(ROOTDIR)/$(ARCH_PATH-y)/drivers
 obj-$(USE_MCU) += Mcu.o\r
 obj-$(USE_MCU) += Mcu_Cfg.o\r
 obj-$(CFG_MPC55XX)-$(USE_MCU) += Mcu_Exceptions.o\r
-#obj-$(USE_MCU) += Mcu_IntcVectors.o\r
 \r
 # Flash\r
 obj-$(USE_FLS) += Fls.o\r
@@ -156,8 +155,11 @@ vpath-$(USE_PDUR) += $(ROOTDIR)/communication/PduR
 \r
 # Common\r
 obj-y += xtoa.o\r
+obj-y += arc.o\r
+#obj-y += malloc.o\r
 obj-$(USE_RAMLOG) += ramlog.o\r
 obj-$(USE_SIMPLE_PRINTF) += printf.o\r
+\r
 VPATH += $(ROOTDIR)/common\r
 \r
 obj-y += newlib_port.o\r
index bfbfaa06578f6d1de1ef9bb4e6a2909a7e5f00ac..fdd4db080467b11395a692ecde87fbfa7d292230 100644 (file)
@@ -10,10 +10,11 @@ CFG=ARM ARM_CM3 BRD_ET_STM32_STAMP SIMULATOR
 
 # What buildable modules does this board have, 
 # default or private
-MOD_AVAIL=KERNEL MCU T32_TERM SIMPLE_PRINTF RAMLOG
+MOD_AVAIL=KERNEL MCU 
+#T32_TERM SIMPLE_PRINTF RAMLOG
 
 # Needed by us
 MOD_USE=KERNEL MCU
 
 # Use little head
-def-y += HEAPSIZE=600
+def-y += HEAPSIZE=400
diff --git a/common/arc.c b/common/arc.c
new file mode 100644 (file)
index 0000000..b811e01
--- /dev/null
@@ -0,0 +1,54 @@
+/*\r
+ * arc.c\r
+ *\r
+ *  Created on: 28 sep 2009\r
+ *      Author: mahi\r
+ */\r
+\r
+#include "os.h"\r
+#include "arc.h"\r
+\r
+#define ENTRY(_x)  [_x] = OS_STRSTR__(_x)\r
+\r
+const char *Arc_StatusToString(StatusType err) {\r
+\r
+       static char *errToStr[] = {\r
+\r
+               ENTRY(E_OK),\r
+\r
+               /* STD OSEK */\r
+               ENTRY(E_OS_ACCESS),\r
+               ENTRY(E_OS_CALLEVEL),\r
+               ENTRY(E_OS_ID),\r
+               ENTRY(E_OS_LIMIT),\r
+               ENTRY(E_OS_NOFUNC),\r
+               ENTRY(E_OS_RESOURCE),\r
+               ENTRY(E_OS_STATE),\r
+\r
+               ENTRY(E_OS_VALUE),\r
+\r
+               /* AUTOSAR, see 7.10 */\r
+               ENTRY(E_OS_SERVICEID),\r
+               ENTRY(E_OS_RATE),\r
+               ENTRY(E_OS_ILLEGAL_ADDRESS ),\r
+               ENTRY(E_OS_MISSINGEND ),\r
+               ENTRY(E_OS_DISABLEDINT ),\r
+               ENTRY(E_OS_STACKFAULT ),\r
+               ENTRY(E_OS_PROTECTION_MEMORY ),\r
+               ENTRY(E_OS_PROTECTION_TIME ),\r
+               ENTRY(E_OS_PROTECTION_LOCKED ),\r
+               ENTRY(E_OS_PROTECTION_EXCEPTION ),\r
+               ENTRY(E_OS_PROTECTION_RATE),\r
+\r
+               /* COM.. TODO: move ?? */\r
+               ENTRY(E_COM_ID),\r
+\r
+               /* Implementation specific */\r
+               ENTRY(E_OS_SYS_APA),\r
+\r
+               ENTRY(E_NOT_OK),\r
+       };\r
+\r
+       return errToStr[err];\r
+\r
+}\r
index c03f21f33920ac99a5f2dc7cba5065bd5c50b7d6..5a1a1d59e24e4e61b3acb738230dd99888dc2208 100644 (file)
@@ -244,7 +244,15 @@ extern char _end[];
 #ifndef HEAPSIZE
 #define HEAPSIZE 16000
 #endif
-unsigned char _heap[HEAPSIZE];
+
+/*
+ * The heap sadly have alignment that depends on the pagesize that
+ * you compile malloc newlib with. From what I can tell from the
+ * code that is a pagesize of 4096.
+ */
+
+unsigned char _heap[HEAPSIZE] __attribute__((aligned (4)));
+//__attribute__((section(".heap")));
 
 caddr_t sbrk( int incr )
 {
index 09044521c47747d597f6c15df0b0d7ef90ac1a7d..9337fb012acbb5c2462a0efb38cdf5f80c2d9492 100644 (file)
@@ -8,7 +8,7 @@
 
 
 #linkfile
-#ldcmdfile-$(CFG_MPC55XX) = -T $(ROOTDIR)/arch/$(ARCH)/scripts/linkscript_gcc.ldf
+#ldcmdfile-$(CFG_MPC55XX) = $(ROOTDIR)/arch/$(ARCH)/scripts/linkscript_gcc.ldf
 
 #build-exe-y = ../../../$(target)_$(ARCH).$(TE)
 
index 2c040d9d00a722ccf27813d574cf088fb10fa887..ca4d84fbfed48979aa85b77cac37c44c21bf9d9c 100644 (file)
@@ -9,7 +9,6 @@ obj-y += Gpt_Cfg.o
 obj-y += Mcu.o
 obj-y += Mcu_Cfg.o
 obj-y += Mcu_Exceptions.o
-obj-y += Mcu_IntcVectors.o
 
 # Can
 obj-y += Can.o
@@ -96,7 +95,7 @@ libitem-y += $(ROOTDIR)/embunit/embUnit/obj_$(ARCH)/libembunit.a
 libitem-y += $(ROOTDIR)/embunit/textui/obj_$(ARCH)/libtextui.a
 
 #linkfile
-ldcmdfile-$(CFG_MPC55XX) = -T $(ROOTDIR)/arch/$(ARCH)/scripts/linkscript_gcc.ldf
+ldcmdfile-$(CFG_MPC55XX) = $(ROOTDIR)/arch/$(ARCH)/scripts/linkscript_gcc.ldf
 
 build-exe-y = ../../../$(target)_$(ARCH).$(TE)
 
index ac01c1b46c6db1fd07c16c343013be510b7a9c1c..c4299ee5755be9f8eae587417bbd2b67376a2562 100644 (file)
@@ -89,7 +89,7 @@ GEN_PCB_LIST()
 uint8_t os_interrupt_stack[OS_INTERRUPT_STACK_SIZE] __attribute__ ((aligned (0x10)));\r
 \r
 // The vector table\r
-void * intc_vector_tbl[NUMBER_OF_INTERRUPTS_AND_EXCEPTIONS] __attribute__ ((aligned (0x0800),section(".data")))= {\r
+void * IntCtrl_VectorTable[NUMBER_OF_INTERRUPTS_AND_EXCEPTIONS] __attribute__ ((aligned (0x0800),section(".data")))= {\r
 };\r
 \r
 // The type of vector\r
index 76ce0cbc3d5d4152c268f2ed323905b6f94d1dc6..0f9c76126f72592303e8d3578aa466625d33d9c3 100644 (file)
@@ -30,7 +30,7 @@ inc-y += $(ROOTDIR)/components/blinker
 libitem-y += $(ROOTDIR)/libs/libkernel_$(ARCH_MCU).a
 
 #linkfile
-ldcmdfile-y = -T $(ROOTDIR)/$(ARCH_PATH-y)/scripts/linkscript_gcc.ldf
+ldcmdfile-y = $(ROOTDIR)/$(ARCH_PATH-y)/scripts/linkscript_gcc.ldf
 
 # What I want to build
 build-exe-y = blinker_node.elf
index b8c9fa62bc28e6858f3e64b65e26cf880c35bd40..be6edd4b1b2f52e4df8565b2bc2e397516075a42 100644 (file)
@@ -81,7 +81,7 @@ GEN_PCB_LIST()
 uint8_t os_interrupt_stack[OS_INTERRUPT_STACK_SIZE] __attribute__ ((aligned (0x10)));\r
 \r
 // The vector table\r
-void * intc_vector_tbl[NUMBER_OF_INTERRUPTS_AND_EXCEPTIONS] __attribute__ ((aligned (0x0800),section(".data")))= {\r
+void * IntCtrl_VectorTable[NUMBER_OF_INTERRUPTS_AND_EXCEPTIONS] __attribute__ ((aligned (0x0800),section(".data")))= {\r
 };\r
 \r
 // The type of vector\r
index adae6c494ada9ce12a720039764f828cc234f9a8..1b14c961e3d1f1e2dfc969136e6a90fa71a9e377 100644 (file)
@@ -32,7 +32,7 @@ inc-y += $(ROOTDIR)/components/pwm_sine
 libitem-y += $(ROOTDIR)/libs/libkernel_$(ARCH_MCU).a
 
 #linkfile
-ldcmdfile-y = -T $(ROOTDIR)/$(ARCH_PATH-y)/scripts/linkscript_gcc.ldf
+ldcmdfile-y = $(ROOTDIR)/$(ARCH_PATH-y)/scripts/linkscript_gcc.ldf
 
 # What I want to build
 build-exe-y = pwm_node.elf
index cb188cdff7a5e308ae6187264018be240a650ee5..171b5ba77ec72bcfade78859331bb1aef266ee34 100644 (file)
@@ -163,7 +163,7 @@ uint8_t pcb_list[PCB_T_SIZE*ARRAY_SIZE(rom_pcb_list)];
 uint8_t os_interrupt_stack[OS_INTERRUPT_STACK_SIZE] __attribute__ ((aligned (0x10)));\r
 \r
 // The vector table\r
-void * intc_vector_tbl[NUMBER_OF_INTERRUPTS_AND_EXCEPTIONS] __attribute__ ((aligned (0x1000),section(".data")))= {\r
+void * IntCtrl_VectorTable[NUMBER_OF_INTERRUPTS_AND_EXCEPTIONS] __attribute__ ((aligned (0x1000),section(".data")))= {\r
 };\r
 \r
 // The type of vector\r
index f1aabc0fd5b04e589b5772e844c2a45dc9ff4e0e..ffb2bfee89fb2bdcfa1eccbe32d4c5a16a12e7c5 100644 (file)
@@ -33,7 +33,7 @@ inc-y += $(ROOTDIR)/components/fading_led
 libitem-y += $(ROOTDIR)/libs/libkernel_$(ARCH_MCU).a
 
 #linkfile
-ldcmdfile-y = -T $(ROOTDIR)/$(ARCH_PATH-y)/scripts/linkscript_gcc.ldf
+ldcmdfile-y = $(ROOTDIR)/$(ARCH_PATH-y)/scripts/linkscript_gcc.ldf
 
 # What I want to build
 build-exe-y = pwm_node2.elf
index 4d4f1e44331921818963e6344ed7b12680a3a2ab..aea4ac1122751c6a69e0c474630dcd60f992de51 100644 (file)
@@ -91,7 +91,7 @@ GEN_PCB_LIST()
 uint8_t os_interrupt_stack[OS_INTERRUPT_STACK_SIZE] __attribute__ ((aligned (0x10)));\r
 \r
 // The vector table\r
-void * intc_vector_tbl[NUMBER_OF_INTERRUPTS_AND_EXCEPTIONS] __attribute__ ((aligned (0x1000),section(".data")))= {\r
+void * IntCtrl_VectorTable[NUMBER_OF_INTERRUPTS_AND_EXCEPTIONS] __attribute__ ((aligned (0x1000),section(".data")))= {\r
 };\r
 \r
 // The type of vector\r
index c58c26a4f889f58e2db7e504a38786188dd2f189..ebfd14f6920c494820f697bfeea12b28d73fe791 100644 (file)
@@ -22,7 +22,7 @@ include $(ROOTDIR)/boards/board_common.mk
 libitem-y += $(ROOTDIR)/libs/libkernel_$(ARCH_MCU).a\r
 \r
 #linkfile\r
-ldcmdfile-y = -T $(ROOTDIR)/$(ARCH_PATH-y)/scripts/linkscript_gcc.ldf\r
+ldcmdfile-y = $(ROOTDIR)/$(ARCH_PATH-y)/scripts/linkscript_gcc.ldf\r
 \r
 # What I want to build\r
 build-exe-y = simple.elf\r
index 49f5cbc05df5e78b4ac846606935bb3e6ee90a7d..4f3dc6c0b2fce7559e04a5db8470df1015d5e433 100644 (file)
@@ -190,7 +190,7 @@ uint8_t pcb_list[PCB_T_SIZE*ARRAY_SIZE(rom_pcb_list)];
 uint8_t os_interrupt_stack[OS_INTERRUPT_STACK_SIZE] __attribute__ ((aligned (0x10)));\r
 \r
 // The vector table\r
-void * intc_vector_tbl[NUMBER_OF_INTERRUPTS_AND_EXCEPTIONS] __attribute__ ((aligned (0x1000),section(".data")))= {\r
+void * IntCtrl_VectorTable[NUMBER_OF_INTERRUPTS_AND_EXCEPTIONS] __attribute__ ((aligned (0x1000),section(".data")))= {\r
 };\r
 \r
 // The type of vector\r
index 9ab6acf7c1162ad15a9a891379e97a2551104580..6fec17c8efedc2d5c82843a420178fbb95746625 100644 (file)
@@ -33,7 +33,7 @@ inc-y += $(ROOTDIR)/components/switch
 libitem-y += $(ROOTDIR)/libs/libkernel_$(ARCH_MCU).a
 
 #linkfile
-ldcmdfile-y = -T $(ROOTDIR)/$(ARCH_PATH-y)/scripts/linkscript_gcc.ldf
+ldcmdfile-y = $(ROOTDIR)/$(ARCH_PATH-y)/scripts/linkscript_gcc.ldf
 
 # What I want to build
 build-exe-y = switch_node.elf
index da948dda7d2c3c9e97f0de37a0288c95b14537b4..1485fdfb97294b9836974317a4114f63065699eb 100644 (file)
@@ -22,7 +22,7 @@ include $(ROOTDIR)/boards/board_common.mk
 libitem-y += $(ROOTDIR)/libs/libkernel_$(ARCH_MCU).a\r
 \r
 #linkfile\r
-ldcmdfile-y = -T $(ROOTDIR)/$(ARCH_PATH-y)/scripts/linkscript_gcc.ldf\r
+ldcmdfile-y = $(ROOTDIR)/$(ARCH_PATH-y)/scripts/linkscript_gcc.ldf\r
 \r
 # What I want to build\r
 build-exe-y = tiny.elf\r
index a924c7dc94ab69f9fae394381220b42829f14e72..3630465d5786ea6c640565932d010e8c50e7e475 100644 (file)
@@ -482,7 +482,7 @@ int simple_printf(const char *format, ...);
 #define ARRAY_SIZE(_x) sizeof(_x)/sizeof((_x)[0])\r
 \r
 #define OS_STR__(x)    #x\r
-#define OS_STRSTR__(x) STR__(x)\r
+#define OS_STRSTR__(x) OS_STR__(x)\r
 \r
 \r
 TaskType Os_CreateIsr( void  (*entry)(void), uint8_t prio, const char *name );
diff --git a/include/arc.h b/include/arc.h
new file mode 100644 (file)
index 0000000..d2d473a
--- /dev/null
@@ -0,0 +1,15 @@
+/*\r
+ * arc.h\r
+ *\r
+ *  Created on: 28 sep 2009\r
+ *      Author: mahi\r
+ */\r
+\r
+#ifndef ARC_H_\r
+#define ARC_H_\r
+\r
+#include "arc.h"\r
+\r
+const char *Arc_StatusToString(StatusType);\r
+\r
+#endif /* ARC_H_ */\r
index cbff5fcf134c9607029781a258465212c09ebb7f..dba19558c2b72b2d94db9b123b376e666f5bbdd3 100644 (file)
  * -------------------------------- Arctic Core ------------------------------*/
 
 
-
-
-
-
-
-
-/*
- * int_ctrl.h
- *
- *  Created on: Jul 31, 2009
- *      Author: mahi
- */
-
 #ifndef INT_CTRL_H_
 #define INT_CTRL_H_
 
index 220709634979251f23e7a7c8870328806172df0d..8b3944aaa401b32d1b031a2ea92efc656ba83d8f 100644 (file)
     addi  sp,sp,EXC_SIZE;
 
 
-#define CALL_HANDLER() CALL_HANDLER_(intc_vector_tbl)
+#define CALL_HANDLER() CALL_HANDLER_(IntCtrl_VectorTable)
 
 //-------------------------------------------------------------------
 
index 243b44599ff62b82d755f398431888bd4ae18b1d..ce4cefe330b6c2a0c0ebcdb1baff057daf2966c5 100755 (executable)
@@ -7,7 +7,6 @@ function quit {
     exit $1
 }
 
-
 oo="aa $CROSS_COMPILE aa";
 echo "oo = $oo";
 if [ "aa $CROSS_COMPILE aa" == "aa  aa" ]; then
@@ -15,7 +14,7 @@ if [ "aa $CROSS_COMPILE aa" == "aa  aa" ]; then
   echo $os
   if [ "$os" == "Darwin" ]; then
     export CROSS_COMPILE=/opt/arm-elf/bin/arm-elf-
-  else
+  else  
     export CROSS_COMPILE=/cygdrive/c/devtools/CodeSourcery/Lite/bin/arm-none-eabi-
   fi
 fi;
index 4daed7c1ea95ca6aa150a13c95a8634c681bfcc9..c4c44cd2d2cd160f61134280b2a6dc9ea6d28571 100644 (file)
@@ -64,14 +64,15 @@ config:
        @echo $(MOD) ${def-y}\r
 \r
 # build- targets are "end" target that the included makefile want's to build\r
-all: $(build-exe-y) $(build-hex-y) $(build-lib-y) post_process\r
+all: $(build-exe-y) $(build-hex-y) $(build-lib-y)\r
+       @cp -v $(build-lib-y) $(build-exe-y) $(build-hex-y) $(ROOTDIR)/binaries\r
 \r
 $(ROOTDIR)/binaries:\r
        @mkdir -p $@\r
 \r
-.PHONY post_process:\r
-post_process: $(ROOTDIR)/binaries\r
-       @cp $(build-lib-y) $(build-exe-y) $(build-hex-y) $(ROOTDIR)/binaries \r
+#.PHONY post_process:\r
+#post_process:: $(ROOTDIR)/binaries\r
+        \r
 \r
 # Determine what kind of filetype to build from  \r
 VPATH += $(ROOTDIR)/$(SUBDIR)/src\r
@@ -123,9 +124,9 @@ $(build-hex-y): $(build-exe-y)
        $(Q)$(CROSS_COMPILE)objcopy -O ihex $< $@\r
 \r
 # Could use readelf -S instead of parsing the *.map file.\r
-$(build-exe-y): $(obj-y) $(sim-y) $(libitem-y) \r
+$(build-exe-y): $(obj-y) $(sim-y) $(libitem-y) $(ldcmdfile-y)\r
        @echo "  >> LD $@"\r
-       $(Q)$(LD) $(LDFLAGS) $(ldcmdfile-y) -o $@ $(libpath-y) --start-group $(obj-y) $(lib-y) $(libitem-y) --end-group $(LDMAPFILE)\r
+       $(Q)$(LD) $(LDFLAGS) -T $(ldcmdfile-y) -o $@ $(libpath-y) --start-group $(obj-y) $(lib-y) $(libitem-y) --end-group $(LDMAPFILE)\r
        @echo "Image size: (decimal)"\r
        @gawk --non-decimal-data        '/^\.text/ { print "  text:"  $$3+0 " bytes"; rom+=$$3 };\\r
                                                                /^\.data/ { print "  data:"  $$3+0 " bytes"; rom+=$$3; ram+=$$3}; \\r
index cd59484b0d1a08336f948726a6b2282e8a72848f..a45c98d7cd7778fef1674eeaae6824acae60a8b9 100644 (file)
  * for more details.
  * -------------------------------- Arctic Core ------------------------------*/
 
-
-
-
-
-
-
-
-/*\r
- * create.c\r
- *\r
- *  Created on: 2009-jan-16\r
- *      Author: mahi\r
- */\r
 \r
 #include <stdint.h>\r
 #include <stdlib.h>\r
 #include "sys.h"\r
 #include "pcb.h"\r
 #include "Os.h"\r
-\r
-#define os_alloc(_x)   malloc(_x)\r
+
+extern caddr_t *sbrk(int);\r
+
+#define os_alloc(_x)   sbrk(_x)\r
 \r
 pcb_t * os_alloc_new_pcb( void ) {\r
        void *h = os_alloc(sizeof(pcb_t));\r
index 1fc2c0287d581cdcaa21ac1a17f8a17edf45f9eb..f4e36dff0cf5298fcf9a2e2753b00a75889a16f2 100644 (file)
@@ -236,7 +236,6 @@ void StartOS( AppModeType Mode ) {
 
 }
 
-
 /**
  * OS shutdown
  *
@@ -249,7 +248,9 @@ void ShutdownOS( StatusType Error ) {
                os_sys.hooks->ShutdownHook(Error);
        }
        /* TODO: */
-       while(1);
+       while(1) {
+
+       }
 
 }
 
index 89c647fe4e89233b2277abf84b212c7ccc54c72e..46ee368b855959e30a8644fd6451ce988cbb038f 100644 (file)
@@ -1,2 +1,7 @@
 \r
-MOD_USE+=KERNEL MCU T32_TERM SIMPLE_PRINTF RAMLOG SIMPLE_PRINTF\r
+# Figure out the most of the modules to use.\r
+OPTIMAL_USE = T32_TERM SIMPLE_PRINTF RAMLOG\r
+MOD_USE+=KERNEL MCU $(filter $(OPTIMAL_USE),$(MOD_AVAIL))\r
+$(warning $(MOD_USE)) \r
+#MOD_USE+=KERNEL MCU T32_TERM SIMPLE_PRINTF RAMLOG\r
+\r
index a7d16bc418ef5f8d93896d384a8c35aa1989b194..84a0f6198244f454e30038afe4e001aaf528233f 100644 (file)
@@ -188,7 +188,7 @@ uint32 os_dbg_mask = \
 uint8_t os_interrupt_stack[OS_INTERRUPT_STACK_SIZE] __attribute__ ((aligned (0x10)));
 
 // The vector table
-void * intc_vector_tbl[NUMBER_OF_INTERRUPTS_AND_EXCEPTIONS] __attribute__ ((aligned (0x1000),section(".data")))= {
+void * IntCtrl_VectorTable[NUMBER_OF_INTERRUPTS_AND_EXCEPTIONS] __attribute__ ((aligned (0x1000),section(".data")))= {
 };
 
 // The type of vector
index 8a978ccb8b6eeb6c821c523d9687a6948dcbc573..959ff78370ac0be5f799f0bc182f7455f2f43436 100644 (file)
 #define TASK_ID_btask_sup_h                            7\r
 \r
 #define TASK_ID_os_tick                                        8\r
-\r
-#define PRIO_STACK_SIZE                1024\r
+
+#if defined(USE_SIMPLE_PRINTF)\r
+#define PRIO_STACK_SIZE                1024
+#else
+#define PRIO_STACK_SIZE                330
+#endif\r
 \r
 #define STACK_SIZE_OsIdle                                      ALIGN_16(PRIO_STACK_SIZE)\r
 #define STACK_SIZE_etask_master                                ALIGN_16(PRIO_STACK_SIZE)\r
index 8b83e04b05c044a5c6f80a8e64f2cb7421291b5f..1682c3e0233f3c72101717d979f1dcaba444f477 100644 (file)
@@ -39,8 +39,8 @@ VPATH += $(ROOTDIR)/$(SUBDIR)/config
 libitem-y += $(ROOTDIR)/libs/libkernel_$(ARCH_MCU).a\r
 \r
 #linkfile\r
-ldcmdfile-y = -T $(ROOTDIR)/$(ARCH_PATH-y)/scripts/linkscript_gcc.ldf\r
-#ldcmdfile-y = -T $(ROOTDIR)/$(ARCH_PATH-y)/scripts/linkscript_gcc.ldf\r
+ldcmdfile-y = $(ROOTDIR)/$(ARCH_PATH-y)/scripts/linkscript_gcc.ldf\r
+#ldcmdfile-y = $(ROOTDIR)/$(ARCH_PATH-y)/scripts/linkscript_gcc.ldf\r
 \r
 inc-y += ..\r
 inc-y += $(ROOTDIR)/system/kernel/$(objdir)\r
index 4b7c5cfcc3ccc4d2fd86cd040ae00704386fdcf3..eb249592116aa95214b3176033adb78dc3bbf019 100644 (file)
  * for more details.
  * -------------------------------- Arctic Core ------------------------------*/
 
-
-
-
-
-
-
-
-\r
-#include "Platform_Types.h"\r
+#include <stdint.h>\r
+#include "Platform_Types.h"
+#include "simple_printf.h"
 \r
 #define USE_DEBUG\r
 #include "Trace.h"\r
@@ -30,7 +24,16 @@ int test_suite = 1;
 int test_nr = 1;\r
 int _test_ok = 0;\r
 int _test_failed = 0;\r
+
+int testCnt = 0;
+struct test {
+       uint8_t testSuite;
+       uint8_t testNr;
+       uint16_t status;
+};
 \r
+struct test testTable[50] = { {0} };
+
 \r
 void test_done( void ) {\r
        dbg_printf(     "Test summary\n"\r
@@ -40,14 +43,21 @@ void test_done( void ) {
 \r
 }\r
 \r
-\r
 void test_fail( const char *text,char *file,  int line, const char *function ) {\r
        dbg_printf("%02d %02d FAILED, %s , %d, %s\n",test_suite, test_nr, file, line, function);\r
+       testTable[testCnt].testSuite = test_suite;
+       testTable[testCnt].testNr = test_nr;
+       testTable[testCnt].status = 0;
+       testCnt++;
        _test_failed++;\r
 }\r
 \r
 \r
 void test_ok( void ) {\r
-       dbg_printf("%02d %02d OK\n",test_suite, test_nr);\r
+       dbg_printf("%02d %02d OK\n",test_suite, test_nr);
+       testTable[testCnt].testSuite = test_suite;
+       testTable[testCnt].testNr = test_nr;
+       testTable[testCnt].status = 1;
+       testCnt++;\r
        _test_ok++;\r
 }\r
index 688d6caa27ae461ce06eca1843b0ad8748b4c1fe..d05bbba8a8927e32c25dc186b7827fc93d8113d5 100644 (file)
 #if defined(USE_GPT)\r
 #include "Gpt.h"\r
 #endif\r
+#include "simple_printf.h"
 \r
 #define USE_DEBUG\r
-#include "Trace.h"\r
+#include "Trace.h"
+#include "arc.h"\r
 \r
 extern void etask_sup_l_basic_02( void );\r
 extern void etask_sup_m_basic_02( void );\r
@@ -180,12 +182,18 @@ void StartupHook( void ) {
 \r
 void ShutdownHook( StatusType Error ) {\r
 //     dbg_printf("## ShutdownHook\n");\r
-       while(1);\r
+       const char *err;
+       err = Arc_StatusToString(Error);
+       while(1) {
+               err = err;
+       }
 }\r
 \r
 void ErrorHook( StatusType Error ) {\r
-//     dbg_printf("## ErrorHook err=%d\n",Error);\r
-       while(1);\r
+//     dbg_printf("## ErrorHook err=%d\n",Error);
+       const char *err;
+       err = Arc_StatusToString(Error);
+       while(1);
 }\r
 \r
 void PreTaskHook( void ) {\r