mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-04-11 16:37:45 -04:00
Mostly motivated by PP needing CACHEALIGN_SIZE in linker scripts, which can't include system.h, so move these to cpu.h instead. Also gets rid of the default 32 byte line size that was used if the target didn't define alignment itself. RK24xx, DM320, and JZ4740 were missing this but have been confirmed (from datasheets) to use 32-byte cache lines. Add checks to make sure the macros are appropriately (un)defined based on the HAVE_CPU_CACHE_ALIGN define, and make sure their values are consistent when they are defined. Disable HAVE_CPU_CACHE_ALIGN for hosted targets since it arguably doesn't matter if there's a cache, if we aren't responsible for cache maintenance. A few files in rbcodec use CACHEALIGN_SIZE, but these can be converted to MEM_ALIGN_SIZE, which is identical to CACHEALIGN_SIZE if the latter is defined. On other targets, it aligns to at least sizeof(intptr_t). Change-Id: If8cf8f6ec327dc3732f4cd5022a858546b9e63d6
84 lines
2.5 KiB
C
84 lines
2.5 KiB
C
/***************************************************************************
|
|
* __________ __ ___.
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
* \/ \/ \/ \/ \/
|
|
* $Id$
|
|
*
|
|
* Copyright (C) 2004 by Linus Nielsen Feltzing
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; either version 2
|
|
* of the License, or (at your option) any later version.
|
|
*
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
* KIND, either express or implied.
|
|
*
|
|
****************************************************************************/
|
|
#ifndef __CPU_H
|
|
#define __CPU_H
|
|
|
|
#include "config.h"
|
|
|
|
#if CONFIG_CPU == MCF5249
|
|
#include "mcf5249.h"
|
|
#elif CONFIG_CPU == MCF5250
|
|
#include "mcf5250.h"
|
|
#elif (CONFIG_CPU == PP5020) || (CONFIG_CPU == PP5022)
|
|
#include "pp5020.h"
|
|
#elif CONFIG_CPU == PP5002
|
|
#include "pp5002.h"
|
|
#elif CONFIG_CPU == PP5024
|
|
#include "pp5024.h"
|
|
#elif CONFIG_CPU == PP6100
|
|
#include "pp6100.h"
|
|
#elif CONFIG_CPU == S3C2440
|
|
#include "s3c2440.h"
|
|
#elif CONFIG_CPU == DM320
|
|
#include "dm320.h"
|
|
#elif CONFIG_CPU == IMX31L
|
|
#include "imx31l.h"
|
|
#elif defined(CPU_TCC780X)
|
|
#include "tcc780x.h"
|
|
#elif defined(CPU_S5L87XX)
|
|
#include "s5l87xx.h"
|
|
#elif CONFIG_CPU == JZ4732
|
|
#include "jz4740.h"
|
|
#elif CONFIG_CPU == JZ4760B
|
|
#include "jz4760b.h"
|
|
#elif CONFIG_CPU == AS3525
|
|
#include "as3525.h"
|
|
#elif CONFIG_CPU == AS3525v2
|
|
#include "as3525v2.h"
|
|
#elif CONFIG_CPU == IMX233
|
|
#include "imx233.h"
|
|
#elif CONFIG_CPU == RK27XX
|
|
#include "rk27xx.h"
|
|
#elif CONFIG_CPU == X1000
|
|
#include "x1000.h"
|
|
#elif CONFIG_CPU == STM32H743
|
|
#include "stm32h743.h"
|
|
#endif
|
|
|
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE) && (defined(CPU_ARM) || defined(CPU_MIPS))
|
|
# define HAVE_CPU_CACHE_ALIGN
|
|
#endif
|
|
|
|
#if defined(HAVE_CPU_CACHE_ALIGN)
|
|
# if !defined(CACHEALIGN_BITS)
|
|
# error "CPU header must define CACHEALIGN_BITS"
|
|
# elif !defined(CACHEALIGN_SIZE)
|
|
# error "CPU header must define CACHEALIGN_SIZE"
|
|
# elif CACHEALIGN_SIZE != (1u << CACHEALIGN_BITS)
|
|
# error "CACHEALIGN_SIZE and CACHEALIGN_BITS are inconsistent"
|
|
# endif
|
|
#else
|
|
# if defined(CACHEALIGN_BITS) && defined(CACHEALIGN_SIZE)
|
|
# error "CACHEALIGN_BITS and CACHEALIGN_SIZE must not be defined for targets with no CPU cache"
|
|
# endif
|
|
#endif
|
|
|
|
#endif /* __CPU_H */
|