Changeset 57740ce8 in rtems


Ignore:
Timestamp:
Apr 7, 2014, 12:50:24 PM (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
fb9e98e
Parents:
d507c037
git-author:
Sebastian Huber <sebastian.huber@…> (04/07/14 12:50:24)
git-committer:
Sebastian Huber <sebastian.huber@…> (04/07/14 12:51:31)
Message:

score: Clarify CPU port alignment requirements

Location:
cpukit/score
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/cpu/no_cpu/rtems/score/cpu.h

    rd507c037 r57740ce8  
    734734/**
    735735 * CPU's worst alignment requirement for data types on a byte boundary.  This
    736  * alignment does not take into account the requirements for the stack.
     736 * alignment does not take into account the requirements for the stack.  It
     737 * must be a power of two greater than or equal to two.  The power of two
     738 * requirement makes it possible to align values easily using simple bit
     739 * operations.
    737740 *
    738741 * Port Specific Information:
     
    750753 * the heap, then this should be set to @ref CPU_ALIGNMENT.
    751754 *
    752  * NOTE:  This does not have to be a power of 2 although it should be
    753  *        a multiple of 2 greater than or equal to 2.  The requirement
    754  *        to be a multiple of 2 is because the heap uses the least
    755  *        significant field of the front and back flags to indicate
    756  *        that a block is in use or free.  So you do not want any odd
    757  *        length blocks really putting length data in that bit.
     755 * NOTE:  It must be a power of two greater than or equal to two.  The
     756 *        requirement to be a multiple of two is because the heap uses the
     757 *        least significant field of the front and back flags to indicate that
     758 *        a block is in use or free.  So you do not want any odd length blocks
     759 *        really putting length data in that bit.
    758760 *
    759761 *        On byte oriented architectures, @ref CPU_HEAP_ALIGNMENT normally will
  • cpukit/score/src/percpuasm.c

    rd507c037 r57740ce8  
    11/*
    2  * Copyright (c) 2012 embedded brains GmbH.  All rights reserved.
     2 * Copyright (c) 2012-2014 embedded brains GmbH.  All rights reserved.
    33 *
    44 *  embedded brains GmbH
    5  *  Obere Lagerstr. 30
     5 *  Dornierstr. 4
    66 *  82178 Puchheim
    77 *  Germany
     
    2121#define _RTEMS_PERCPU_DEFINE_OFFSETS
    2222#include <rtems/score/percpu.h>
     23
     24/*
     25 * In case a CPU port needs another alignment, then add this here and make sure
     26 * it is a power of two greater than or equal to two.
     27 */
     28RTEMS_STATIC_ASSERT(
     29  CPU_ALIGNMENT == 2
     30    || CPU_ALIGNMENT == 4
     31    || CPU_ALIGNMENT == 8
     32    || CPU_ALIGNMENT == 16
     33    || CPU_ALIGNMENT == 32,
     34  CPU_ALIGNMENT
     35);
     36
     37/*
     38 * In case a CPU port needs another heap alignment, then add this here and make
     39 * sure it is a power of two greater than or equal to two.
     40 */
     41RTEMS_STATIC_ASSERT(
     42  CPU_HEAP_ALIGNMENT == 2
     43    || CPU_HEAP_ALIGNMENT == 4
     44    || CPU_HEAP_ALIGNMENT == 8
     45    || CPU_HEAP_ALIGNMENT == 16
     46    || CPU_HEAP_ALIGNMENT == 32,
     47  CPU_HEAP_ALIGNMENT_0
     48);
     49
     50RTEMS_STATIC_ASSERT(
     51  CPU_HEAP_ALIGNMENT >= CPU_ALIGNMENT,
     52  CPU_HEAP_ALIGNMENT_1
     53);
    2354
    2455RTEMS_STATIC_ASSERT(
Note: See TracChangeset for help on using the changeset viewer.