00001 /* 00002 Copyright (C) 2002,2003 Axis Communications AB 00003 00004 Authors: Martin P Andersson (martin.andersson@linux.nu) 00005 Jens-Henrik Lindskov (mumrick@linux.nu) 00006 00007 This program is free software; you can redistribute it and/or modify 00008 it under the terms of version 2 of the GNU General Public License as 00009 published by the Free Software Foundation. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 00020 -------------------------------------------------------------------------- 00021 Acknowledgements 00022 - Paolo Mantegazza (mantegazza@aero.polimi.it) 00023 creator of RTAI 00024 -------------------------------------------------------------------------- 00025 */ 00026 00027 #ifndef _RTAI_ASM_CRIS_RTAI_SCHED_H_ 00028 #define _RTAI_ASM_CRIS_RTAI_SCHED_H_ 00029 00030 extern void up_task_sw(void *, void *); 00031 #define rt_switch_to(new_task) up_task_sw(&rt_current, (new_task)); 00032 #define rt_exchange_tasks(old_task, new_task) up_task_sw(&(old_task), (new_task)); 00033 00034 #define init_arch_stack() \ 00035 do { \ 00036 *(task->stack - 12) = data; \ 00037 *(task->stack - 11) = (int)rt_thread; \ 00038 *(task->stack - 0) = (int)rt_startup; \ 00039 task->stack -= 12; \ 00040 } while(0) 00041 00042 /* Initial stack frame: 00043 * 00044 * r11 data : second argument 00045 * r10 rt_thread: first argument 00046 * r9 00047 * | 00048 * | 00049 * | 00050 * | 00051 * | 00052 * | 00053 * | 00054 * V 00055 * r0 00056 * srp rt_startup: function to call 00057 * 00058 * After the initial setup, only r0-r9 and srp are saved. 00059 */ 00060 00061 /* FIX if floating point is ever needed */ 00062 #define DEFINE_LINUX_CR0 00063 #define DEFINE_LINUX_SMP_CR0 00064 #define init_fp_env() 00065 00066 /* read the current stackpointer */ 00067 static inline void *get_stack_pointer(void) 00068 { 00069 void *sp; 00070 __asm__ __volatile__("move.d $sp,%0" : "=rm" (sp)); 00071 return sp; 00072 } 00073 00074 #define RT_SET_RTAI_TRAP_HANDLER(x) rt_set_rtai_trap_handler(x) 00075 00076 #define DO_TIMER_PROPER_OP() 00077 00078 #endif 00079 00080 00081 00082