\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>\r
+ Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
\r
#endif\r
\r
+#define _ASM_FUNC(Name, Section) \\r
+ .global Name ; \\r
+ .section #Section, "ax" ; \\r
+ .type Name, %function ; \\r
+ .p2align 2 ; \\r
+ Name:\r
+\r
+#define ASM_FUNC(Name) _ASM_FUNC(ASM_PFX(Name), .text. ## Name)\r
+\r
+#define MOV32(Reg, Val) \\r
+ movw Reg, #(Val) & 0xffff ; \\r
+ movt Reg, #(Val) >> 16\r
+\r
+#define ADRL(Reg, Sym) \\r
+ movw Reg, #:lower16:(Sym) - (. + 16) ; \\r
+ movt Reg, #:upper16:(Sym) - (. + 12) ; \\r
+ add Reg, Reg, pc\r
+\r
+#define LDRL(Reg, Sym) \\r
+ movw Reg, #:lower16:(Sym) - (. + 16) ; \\r
+ movt Reg, #:upper16:(Sym) - (. + 12) ; \\r
+ ldr Reg, [pc, Reg]\r
+\r
#endif\r