Changeset 7e5c9b89 in rtems


Ignore:
Timestamp:
Nov 25, 2014, 1:58:13 PM (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
e681762
Parents:
7981a88
git-author:
Sebastian Huber <sebastian.huber@…> (11/25/14 13:58:13)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/25/14 15:08:16)
Message:

rtems: Move rtems_cache_aligned_malloc()

Make sure also the size is cache aligned since otherwise we may have
some overlap with the next allocation block. A cache invalidate on this
area would be fatal.

Files:
1 added
1 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libcpu/Makefile.am

    r7981a88 r7e5c9b89  
    33EXTRA_DIST =
    44EXTRA_DIST += shared/include/cache.h
    5 EXTRA_DIST += shared/src/cache_aligned_malloc.c
    65EXTRA_DIST += shared/src/cache_manager.c
    76
  • c/src/lib/libcpu/bfin/Makefile.am

    r7981a88 r7e5c9b89  
    5555include_libcpu_HEADERS += ../shared/include/cache.h
    5656noinst_PROGRAMS += cache.rel
    57 cache_rel_SOURCES = cache/cache.c ../shared/src/cache_aligned_malloc.c \
     57cache_rel_SOURCES = cache/cache.c \
    5858    ../shared/src/cache_manager.c cache/cache_.h
    5959cache_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/cache
  • c/src/lib/libcpu/i386/Makefile.am

    r7981a88 r7e5c9b89  
    1212
    1313noinst_PROGRAMS += cache.rel
    14 cache_rel_SOURCES = cache.c cache_.h ../shared/src/cache_aligned_malloc.c \
     14cache_rel_SOURCES = cache.c cache_.h \
    1515    ../shared/src/cache_manager.c ../shared/include/cache.h
    1616cache_rel_CPPFLAGS = $(AM_CPPFLAGS)
  • c/src/lib/libcpu/lm32/Makefile.am

    r7981a88 r7e5c9b89  
    1414noinst_PROGRAMS += shared/cache.rel
    1515shared_cache_rel_SOURCES = ../shared/src/no_cache.c shared/cache/cache_.h \
    16     ../shared/src/cache_aligned_malloc.c \
    1716    ../shared/src/cache_manager.c
    1817shared_cache_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/shared/cache
  • c/src/lib/libcpu/m68k/Makefile.am

    r7981a88 r7e5c9b89  
    1414shared_cache_rel_SOURCES = shared/cache/cache.c
    1515shared_cache_rel_SOURCES += shared/cache/cache_.h
    16 shared_cache_rel_SOURCES += ../shared/src/cache_aligned_malloc.c
    1716shared_cache_rel_SOURCES += ../shared/src/cache_manager.c
    1817shared_cache_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/shared/cache
  • c/src/lib/libcpu/mips/Makefile.am

    r7981a88 r7e5c9b89  
    1313
    1414noinst_PROGRAMS += shared/cache.rel
    15 shared_cache_rel_SOURCES = shared/cache/cache.c ../shared/src/cache_aligned_malloc.c \
     15shared_cache_rel_SOURCES = shared/cache/cache.c \
    1616    ../shared/src/cache_manager.c shared/cache/cache_.h
    1717shared_cache_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/shared/cache
  • c/src/lib/libcpu/nios2/Makefile.am

    r7981a88 r7e5c9b89  
    1414noinst_PROGRAMS += shared/cache.rel
    1515shared_cache_rel_SOURCES = ../shared/src/no_cache.c shared/cache/cache_.h \
    16     ../shared/src/cache_aligned_malloc.c \
    1716    ../shared/src/cache_manager.c
    1817shared_cache_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/shared/cache
  • c/src/lib/libcpu/powerpc/Makefile.am

    r7981a88 r7e5c9b89  
    7373noinst_PROGRAMS += shared/cache.rel
    7474shared_cache_rel_SOURCES = shared/src/cache_.h \
    75     ../shared/src/cache_aligned_malloc.c ../shared/src/cache_manager.c \
     75    ../shared/src/cache_manager.c \
    7676    ../shared/include/cache.h
    7777shared_cache_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/shared/src
  • c/src/lib/libcpu/sh/Makefile.am

    r7981a88 r7e5c9b89  
    99
    1010noinst_PROGRAMS += cache.rel
    11 cache_rel_SOURCES = ../shared/src/cache_aligned_malloc.c
    12 cache_rel_SOURCES += ../shared/src/cache_manager.c
     11cache_rel_SOURCES = ../shared/src/cache_manager.c
    1312cache_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/cache
    1413cache_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
  • c/src/lib/libcpu/sparc/Makefile.am

    r7981a88 r7e5c9b89  
    1212noinst_PROGRAMS += cache.rel
    1313cache_rel_SOURCES = cache/cache.c cache/cache_.h \
    14     ../shared/src/cache_aligned_malloc.c ../shared/src/cache_manager.c
     14    ../shared/src/cache_manager.c
    1515cache_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/cache
    1616cache_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
  • c/src/lib/libcpu/sparc64/Makefile.am

    r7981a88 r7e5c9b89  
    2828noinst_PROGRAMS += shared/cache.rel
    2929shared_cache_rel_SOURCES = shared/cache/cache.c shared/cache/cache_.h \
    30     ../shared/src/cache_aligned_malloc.c ../shared/src/cache_manager.c
     30    ../shared/src/cache_manager.c
    3131shared_cache_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/shared/cache
    3232shared_cache_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
  • cpukit/libcsupport/Makefile.am

    r7981a88 r7e5c9b89  
    109109    src/rtems_heap_extend.c \
    110110    src/rtems_heap_greedy.c
     111MALLOC_C_FILES += src/cachealignedalloc.c
    111112
    112113PASSWORD_GROUP_C_FILES = src/pwdgrp.c
  • testsuites/sptests/spcache01/init.c

    r7981a88 r7e5c9b89  
    1818
    1919#include <stdio.h>
     20#include <stdlib.h>
    2021#include <inttypes.h>
    2122
     
    380381}
    381382
     383static void test_cache_aligned_alloc(void)
     384{
     385  void *p0;
     386  void *p1;
     387  size_t cls;
     388
     389  printf("test rtems_cache_aligned_malloc()\n");
     390
     391  p0 = rtems_cache_aligned_malloc(1);
     392  p1 = rtems_cache_aligned_malloc(1);
     393
     394  rtems_test_assert(p0 != NULL);
     395  rtems_test_assert(p1 != NULL);
     396
     397  cls = rtems_cache_get_data_line_size();
     398  if (cls > 0) {
     399    size_t m = cls - 1;
     400    uintptr_t a0 = (uintptr_t) p0;
     401    uintptr_t a1 = (uintptr_t) p1;
     402
     403    rtems_test_assert(a1 - a0 > cls);
     404    rtems_test_assert((a0 & m) == 0);
     405    rtems_test_assert((a1 & m) == 0);
     406  }
     407
     408  free(p0);
     409  free(p1);
     410}
     411
    382412static void Init(rtems_task_argument arg)
    383413{
     
    386416  test_data_flush_and_invalidate();
    387417  test_timing();
     418  test_cache_aligned_alloc();
    388419
    389420  TEST_END();
  • testsuites/sptests/spcache01/spcache01.scn

    r7981a88 r7e5c9b89  
    4343  duration with warm cache 640 ns
    4444  duration with invalidated cache 2600 ns
     45test rtems_cache_aligned_malloc()
    4546*** END OF TEST SPCACHE 1 ***
Note: See TracChangeset for help on using the changeset viewer.