Changeset 04698eb in rtems


Ignore:
Timestamp:
Jun 27, 2018, 6:42:48 AM (10 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
2987c4f
Parents:
a49a3c8e
git-author:
Sebastian Huber <sebastian.huber@…> (06/27/18 06:42:48)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/29/18 08:04:37)
Message:

riscv: Properly align the thread stack

Update #3433.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/cpu/riscv/riscv-context-initialize.c

    ra49a3c8e r04698eb  
    11/*
     2 * Copyright (c) 2018 embedded brains GmbH
    23 *
    34 * Copyright (c) 2015 University of York.
     
    3435
    3536#include <rtems/score/cpu.h>
     37#include <rtems/score/address.h>
    3638#include <rtems/score/riscv-utility.h>
    3739
     
    4648)
    4749{
    48   uintptr_t stack = ((uintptr_t) stack_area_begin);
     50  void *stack;
    4951
    50   uintptr_t stack_high = stack + stack_area_size;
     52  stack = _Addresses_Add_offset( stack_area_begin, stack_area_size );
     53  stack = _Addresses_Align_down( stack, CPU_STACK_ALIGNMENT );
    5154
    5255  /* Stack Pointer - sp/x2 */
    53   context->x[2] = stack_high;
     56  context->x[2] = (uintptr_t) stack;
     57
    5458  /* Frame Pointer - fp/x8 */
    5559  context->x[8] = stack_high;
Note: See TracChangeset for help on using the changeset viewer.