1 /* -------------------------------- Arctic Core ------------------------------
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
6 * This source code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published by the
8 * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * -------------------------------- Arctic Core ------------------------------*/
24 //#include "arch_offset.h"
\r
30 #include "arch_offset.h"
\r
31 #include "stm32f10x.h"
\r
32 #include "core_cm3.h"
\r
35 * Function make sure that we switch to supervisor mode(rfi) before
\r
36 * we call a task for the first time.
\r
39 void os_arch_first_call( void )
\r
41 // TODO: make swicth here... for now just call func.
\r
42 os_sys.curr_pcb->entry();
\r
45 void *os_arch_get_stackptr( void ) {
\r
50 unsigned int os_arch_get_sc_size( void ) {
\r
55 void os_arch_setup_context( pcb_t *pcb ) {
\r
56 // TODO: Add lots of things here, see ppc55xx
\r
57 uint32_t *context = (uint32_t *)pcb->stack.curr;
\r
58 context[C_CONTEXT_OFFS/4] = SC_PATTERN;
\r
60 /* Set LR to start function */
\r
61 if( pcb->proc_type == PROC_EXTENDED ) {
\r
62 context[C_LR_OFF/4] = (uint32_t)os_proc_start_extended;
\r
63 } else if( pcb->proc_type == PROC_BASIC ) {
\r
64 context[C_LR_OFF/4] = (uint32_t)os_proc_start_basic;
\r
66 // os_arch_setup_context_asm(pcb->stack.curr,NULL);
\r
69 void os_arch_init( void ) {
\r
70 // nothing to do here, yet :)
\r