5
Last change
on this file since eb142fee was
c499856,
checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47
|
Change all references of rtems.com to rtems.org.
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief CPU Initialize Context |
---|
5 | */ |
---|
6 | |
---|
7 | /* |
---|
8 | * Copyright (c) 2011 Sebastian Huber. All rights reserved. |
---|
9 | * |
---|
10 | * embedded brains GmbH |
---|
11 | * Obere Lagerstr. 30 |
---|
12 | * 82178 Puchheim |
---|
13 | * Germany |
---|
14 | * <rtems@embedded-brains.de> |
---|
15 | * |
---|
16 | * The license and distribution terms for this file may be |
---|
17 | * found in the file LICENSE in this distribution or at |
---|
18 | * http://www.rtems.org/license/LICENSE. |
---|
19 | */ |
---|
20 | |
---|
21 | #ifdef HAVE_CONFIG_H |
---|
22 | #include "config.h" |
---|
23 | #endif |
---|
24 | |
---|
25 | #include <string.h> |
---|
26 | |
---|
27 | #include <rtems/score/armv7m.h> |
---|
28 | #include <rtems/score/thread.h> |
---|
29 | #include <rtems/score/tls.h> |
---|
30 | |
---|
31 | #ifdef ARM_MULTILIB_ARCH_V7M |
---|
32 | |
---|
33 | void _CPU_Context_Initialize( |
---|
34 | Context_Control *context, |
---|
35 | void *stack_area_begin, |
---|
36 | size_t stack_area_size, |
---|
37 | uint32_t new_level, |
---|
38 | void (*entry_point)( void ), |
---|
39 | bool is_fp, |
---|
40 | void *tls_area |
---|
41 | ) |
---|
42 | { |
---|
43 | char *stack_area_end = (char *) stack_area_begin + stack_area_size; |
---|
44 | |
---|
45 | memset(context, 0, sizeof(*context)); |
---|
46 | |
---|
47 | context->register_lr = entry_point; |
---|
48 | context->register_sp = stack_area_end; |
---|
49 | |
---|
50 | if ( tls_area != NULL ) { |
---|
51 | _TLS_TCB_at_area_begin_initialize( tls_area ); |
---|
52 | } |
---|
53 | } |
---|
54 | |
---|
55 | #endif /* ARM_MULTILIB_ARCH_V7M */ |
---|
Note: See
TracBrowser
for help on using the repository browser.