blob: cef0e7ea1afa0e021d0415161ee4d7112edda0c3 [file] [log] [blame]
Stefan Reinauer8af0d032012-12-14 13:05:21 -08001/*
Julius Wernerd65e2142013-12-13 12:59:57 -08002 * arch/arm/asmlib.h
3 *
4 * Adapted from Linux arch/arm/include/assembler.h
Stefan Reinauer8af0d032012-12-14 13:05:21 -08005 *
6 * Copyright (C) 1996-2000 Russell King
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * This file contains arm architecture specific defines
13 * for the different processors.
14 *
15 * Do not include any C declarations in this file - it is included by
16 * assembler source.
17 */
18
19/*
Julius Wernerd65e2142013-12-13 12:59:57 -080020 * WARNING: This file is *only* meant for memcpy.S and friends which were copied
21 * from Linux and require some weird macros. It does unspeakable things like
22 * redefining "push", so do *not* try to turn it into a general assembly macro
23 * file, and keep it out of global include directories.
24 */
25
26#ifndef __ARM_ASMLIB_H__
27#define __ARM_ASMLIB_H__
28
29/*
Stefan Reinauer8af0d032012-12-14 13:05:21 -080030 * Endian independent macros for shifting bytes within registers.
31 */
32#ifndef __ARMEB__
33#define pull lsr
34#define push lsl
35#define get_byte_0 lsl #0
36#define get_byte_1 lsr #8
37#define get_byte_2 lsr #16
38#define get_byte_3 lsr #24
39#define put_byte_0 lsl #0
40#define put_byte_1 lsl #8
41#define put_byte_2 lsl #16
42#define put_byte_3 lsl #24
43#else
44#define pull lsl
45#define push lsr
46#define get_byte_0 lsr #24
47#define get_byte_1 lsr #16
48#define get_byte_2 lsr #8
49#define get_byte_3 lsl #0
50#define put_byte_0 lsl #24
51#define put_byte_1 lsl #16
52#define put_byte_2 lsl #8
53#define put_byte_3 lsl #0
54#endif
55
56/*
57 * Data preload for architectures that support it
58 */
Julius Wernerd65e2142013-12-13 12:59:57 -080059#if __COREBOOT_ARM_ARCH__ >= 5
Stefan Reinauer8af0d032012-12-14 13:05:21 -080060#define PLD(code...) code
61#else
62#define PLD(code...)
63#endif
64
65/*
Julius Wernerd65e2142013-12-13 12:59:57 -080066 * This can be used to enable code to cacheline align the destination
67 * pointer when bulk writing to memory. Linux doesn't enable this except
68 * for the "Feroceon" processor, so we better just leave it out.
Stefan Reinauer8af0d032012-12-14 13:05:21 -080069 */
Julius Wernerd65e2142013-12-13 12:59:57 -080070#define CALGN(code...)
71
72#endif /* __ARM_ASMLIB_H */