• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2022 Nanjing Xiaoxiongpai Intelligent Technology Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16#define __ALIGN .align 0
17#define __ALIGN_STR ".align 0"
18
19#define ALIGN __ALIGN
20#define ALIGN_STR __ALIGN_STR
21
22#ifndef ASM_NL
23#define ASM_NL		 ;
24#endif
25
26#ifndef ENTRY
27#define ENTRY(name) \
28	.globl name ASM_NL \
29	ALIGN ASM_NL \
30	name:
31#endif
32
33#ifndef END
34#define END(name) \
35	.size name, .-name
36#endif
37
38#define ENDPROC(name) \
39  .type name, %function; \
40  END(name)
41
42	.macro SMCCC_SMC
43	smc #0
44	.endm
45
46	.macro SMCCC instr
47	mov	r12, sp
48	push	{r4-r7}
49	ldm	r12, {r4-r7}
50	\instr
51	pop	{r4-r7}
52	ldr	r12, [sp, #(4 * 4)]
53	stm	r12, {r0-r3}
54	bx	lr
55	.endm
56
57ENTRY(__smp_smc)
58	SMCCC SMCCC_SMC
59ENDPROC(__smp_smc)
60