Path: blob/master/arch/blackfin/include/asm/blackfin.h
15126 views
/*1* Common header file for Blackfin family of processors.2*3* Copyright 2004-2009 Analog Devices Inc.4*5* Licensed under the GPL-2 or later.6*/78#ifndef _BLACKFIN_H_9#define _BLACKFIN_H_1011#include <mach/anomaly.h>1213#ifndef __ASSEMBLY__1415/* SSYNC implementation for C file */16static inline void SSYNC(void)17{18int _tmp;19if (ANOMALY_05000312)20__asm__ __volatile__(21"cli %0;"22"nop;"23"nop;"24"ssync;"25"sti %0;"26: "=d" (_tmp)27);28else if (ANOMALY_05000244)29__asm__ __volatile__(30"nop;"31"nop;"32"nop;"33"ssync;"34);35else36__asm__ __volatile__("ssync;");37}3839/* CSYNC implementation for C file */40static inline void CSYNC(void)41{42int _tmp;43if (ANOMALY_05000312)44__asm__ __volatile__(45"cli %0;"46"nop;"47"nop;"48"csync;"49"sti %0;"50: "=d" (_tmp)51);52else if (ANOMALY_05000244)53__asm__ __volatile__(54"nop;"55"nop;"56"nop;"57"csync;"58);59else60__asm__ __volatile__("csync;");61}6263#else /* __ASSEMBLY__ */6465#define LO(con32) ((con32) & 0xFFFF)66#define lo(con32) ((con32) & 0xFFFF)67#define HI(con32) (((con32) >> 16) & 0xFFFF)68#define hi(con32) (((con32) >> 16) & 0xFFFF)6970/* SSYNC & CSYNC implementations for assembly files */7172#define ssync(x) SSYNC(x)73#define csync(x) CSYNC(x)7475#if ANOMALY_0500031276#define SSYNC(scratch) cli scratch; nop; nop; SSYNC; sti scratch;77#define CSYNC(scratch) cli scratch; nop; nop; CSYNC; sti scratch;7879#elif ANOMALY_0500024480#define SSYNC(scratch) nop; nop; nop; SSYNC;81#define CSYNC(scratch) nop; nop; nop; CSYNC;8283#else84#define SSYNC(scratch) SSYNC;85#define CSYNC(scratch) CSYNC;8687#endif /* ANOMALY_05000312 & ANOMALY_05000244 handling */8889#endif /* __ASSEMBLY__ */9091#include <asm/mem_map.h>92#include <mach/blackfin.h>93#include <asm/bfin-global.h>9495#endif /* _BLACKFIN_H_ */969798