source: rtems/cpukit/score/cpu/nios2/nios2-context-initialize.c @ 67518231

4.115
Last change on this file since 67518231 was 36c187a0, checked in by Sebastian Huber <sebastian.huber@…>, on 09/02/11 at 07:52:30

2011-09-02 Sebastian Huber <sebastian.huber@…>

  • rtems/score/nios2-utility.h: Avoid redefines with Altera HAL. Declare _Nios2_ISR_Set_level().
  • nios2-context-initialize.c: Use _Nios2_ISR_Set_level().
  • nios2-isr-set-level.c: Define _Nios2_ISR_Set_level().
  • Property mode set to 100644
File size: 953 bytes
Line 
1/*
2 * Copyright (c) 2011 embedded brains GmbH
3 *
4 * Copyright (c) 2006 Kolja Waschk (rtemsdev/ixo.de)
5 *
6 * COPYRIGHT (c) 1989-2006
7 * On-Line Applications Research Corporation (OAR).
8 *
9 * The license and distribution terms for this file may be
10 * found in the file LICENSE in this distribution or at
11 * http://www.rtems.com/license/LICENSE.
12 *
13 * $Id$
14 */
15
16#ifdef HAVE_CONFIG_H
17  #include "config.h"
18#endif
19
20#include <string.h>
21
22#include <rtems/score/cpu.h>
23#include <rtems/score/nios2-utility.h>
24
25void _CPU_Context_Initialize(
26  Context_Control *context,
27  void *stack_area_begin,
28  size_t stack_area_size,
29  uint32_t new_level,
30  void (*entry_point)( void ),
31  bool is_fp
32)
33{
34  uint32_t stack = (uint32_t) stack_area_begin + stack_area_size - 4;
35
36  memset(context, 0, sizeof(*context));
37
38  context->fp = stack;
39  context->status = _Nios2_ISR_Set_level( new_level, NIOS2_STATUS_PIE );
40  context->sp = stack;
41  context->ra = (uint32_t) entry_point;
42}
Note: See TracBrowser for help on using the repository browser.