source: rtems/cpukit/score/cpu/m32r/context_init.c @ 4990792

4.104.115
Last change on this file since 4990792 was 4990792, checked in by Joel Sherrill <joel.sherrill@…>, on 03/27/10 at 15:02:02

2010-03-27 Joel Sherrill <joel.sherrill@…>

  • context_init.c, context_switch.S, cpu.c, cpu_asm.c: Add include of config.h
  • Property mode set to 100644
File size: 1.2 KB
RevLine 
[0e5b446]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
[4990792]12#ifdef HAVE_CONFIG_H
13#include "config.h"
14#endif
15
[0e5b446]16#include <stdint.h>
17#include <rtems/system.h>
18
19typedef struct {
20  uint32_t marker;
21} Starting_Frame;
22
23#define _get_r12( _r12 ) \
24  asm volatile( "mv r12, %0" : "=r" (_r12))
25
26void _CPU_Context_Initialize(
27  Context_Control  *the_context,
28  uint32_t         *stack_base,
29  uint32_t          size,
30  uint32_t          new_level,
31  void             *entry_point,
32  bool              is_fp
33)
34{
35  void *stackEnd = stack_base;
36  Starting_Frame *frame;
37  uint32_t r12;
38
39  stackEnd += size;
40
41  frame = (Starting_Frame *)stackEnd;
42  frame--;
43  frame->marker = 0xa5a5a5a5;
44
45  _get_r12( r12 );
46
47  the_context->r8     = 0x88888888;
48  the_context->r9     = 0x99999999;
49  the_context->r10    = 0xaaaaaaaa;
50  the_context->r11    = 0xbbbbbbbb;
51  the_context->r12    = r12;
52  the_context->r13_fp = 0;
53  the_context->r14_lr = (uintptr_t) entry_point;
54  the_context->r15_sp = (uintptr_t) frame;
55
56}
Note: See TracBrowser for help on using the repository browser.