• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  arch/arm/asmlib.h
3  *
4  *  Adapted from Linux arch/arm/include/assembler.h
5  *
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 /*
20  * 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 /*
30  * 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  */
59 #if 1	/* TODO: differentiate once libpayload supports more ARM versions */
60 #define PLD(code...)	code
61 #else
62 #define PLD(code...)
63 #endif
64 
65 /*
66  * 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.
69  */
70 #define CALGN(code...)
71 
72 #endif	/* __ARM_ASMLIB_H */
73