4.104.115
Last change
on this file since 0e5b446 was
0e5b446,
checked in by Joel Sherrill <joel.sherrill@…>, on 10/28/08 at 20:03:19
|
2008-10-28 Joel Sherrill <joel.sherrill@…>
- Makefile.am, preinstall.am, rtems/score/cpu.h: Now performs context
switches and many tests run.
- context_init.c, context_switch.S, cpu.c, cpu_asm.c: New files.
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | /* |
---|
2 | * COPYRIGHT (c) 1989-2008. |
---|
3 | * On-Line Applications Research Corporation (OAR). |
---|
4 | * |
---|
5 | * The license and distribution terms for this file may be |
---|
6 | * found in the file LICENSE in this distribution or at |
---|
7 | * http://www.rtems.com/license/LICENSE. |
---|
8 | * |
---|
9 | * $Id$ |
---|
10 | */ |
---|
11 | |
---|
12 | #include <stdint.h> |
---|
13 | #include <rtems/system.h> |
---|
14 | |
---|
15 | typedef struct { |
---|
16 | uint32_t marker; |
---|
17 | } Starting_Frame; |
---|
18 | |
---|
19 | #define _get_r12( _r12 ) \ |
---|
20 | asm volatile( "mv r12, %0" : "=r" (_r12)) |
---|
21 | |
---|
22 | void _CPU_Context_Initialize( |
---|
23 | Context_Control *the_context, |
---|
24 | uint32_t *stack_base, |
---|
25 | uint32_t size, |
---|
26 | uint32_t new_level, |
---|
27 | void *entry_point, |
---|
28 | bool is_fp |
---|
29 | ) |
---|
30 | { |
---|
31 | void *stackEnd = stack_base; |
---|
32 | Starting_Frame *frame; |
---|
33 | uint32_t r12; |
---|
34 | |
---|
35 | stackEnd += size; |
---|
36 | |
---|
37 | frame = (Starting_Frame *)stackEnd; |
---|
38 | frame--; |
---|
39 | frame->marker = 0xa5a5a5a5; |
---|
40 | |
---|
41 | _get_r12( r12 ); |
---|
42 | |
---|
43 | the_context->r8 = 0x88888888; |
---|
44 | the_context->r9 = 0x99999999; |
---|
45 | the_context->r10 = 0xaaaaaaaa; |
---|
46 | the_context->r11 = 0xbbbbbbbb; |
---|
47 | the_context->r12 = r12; |
---|
48 | the_context->r13_fp = 0; |
---|
49 | the_context->r14_lr = (uintptr_t) entry_point; |
---|
50 | the_context->r15_sp = (uintptr_t) frame; |
---|
51 | |
---|
52 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.