Changeset d2d02961 in rtems for c/src/lib/libcpu/arm


Ignore:
Timestamp:
May 2, 2013, 3:40:45 PM (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
544615d
Parents:
962e0fac
git-author:
Sebastian Huber <sebastian.huber@…> (05/02/13 15:40:45)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/03/13 15:30:54)
Message:

bsps/arm: Add arm_cp15_get_min_cache_line_size()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libcpu/arm/shared/include/arm-cp15.h

    r962e0fac rd2d02961  
    88
    99/*
    10  * Copyright (c) 2009, 2010
    11  * embedded brains GmbH
    12  * Obere Lagerstr. 30
    13  * D-82178 Puchheim
    14  * Germany
    15  * <rtems@embedded-brains.de>
     10 * Copyright (c) 2009-2013 embedded brains GmbH.  All rights reserved.
     11 *
     12 *  embedded brains GmbH
     13 *  Dornierstr. 4
     14 *  82178 Puchheim
     15 *  Germany
     16 *  <info@embedded-brains.de>
    1617 *
    1718 * The license and distribution terms for this file may be
     
    444445}
    445446
     447static inline uint32_t arm_cp15_get_min_cache_line_size(void)
     448{
     449  uint32_t mcls = 0;
     450  uint32_t ct = arm_cp15_get_cache_type();
     451  uint32_t format = (ct >> 29) & 0x7U;
     452
     453  if (format == 0x4) {
     454    mcls = (1U << (ct & 0xf)) * 4;
     455  } else if (format == 0x0) {
     456    uint32_t mask = (1U << 12) - 1;
     457    uint32_t dcls = (ct >> 12) & mask;
     458    uint32_t icls = ct & mask;
     459
     460    mcls = dcls <= icls ? dcls : icls;
     461  }
     462
     463  return mcls;
     464}
     465
    446466static inline void arm_cp15_cache_invalidate(void)
    447467{
Note: See TracChangeset for help on using the changeset viewer.