xref: /optee_os/lib/libutee/arch/arm/utee_syscalls_a64.S (revision 1bb929836182ecb96d2d9d268daa807c67596396)
1*1bb92983SJerome Forissier/* SPDX-License-Identifier: BSD-2-Clause */
2f74a4a2bSJens Wiklander/*
3f74a4a2bSJens Wiklander * Copyright (c) 2015, Linaro Limited
4f74a4a2bSJens Wiklander * All rights reserved.
5f74a4a2bSJens Wiklander *
6f74a4a2bSJens Wiklander * Redistribution and use in source and binary forms, with or without
7f74a4a2bSJens Wiklander * modification, are permitted provided that the following conditions are met:
8f74a4a2bSJens Wiklander *
9f74a4a2bSJens Wiklander * 1. Redistributions of source code must retain the above copyright notice,
10f74a4a2bSJens Wiklander * this list of conditions and the following disclaimer.
11f74a4a2bSJens Wiklander *
12f74a4a2bSJens Wiklander * 2. Redistributions in binary form must reproduce the above copyright notice,
13f74a4a2bSJens Wiklander * this list of conditions and the following disclaimer in the documentation
14f74a4a2bSJens Wiklander * and/or other materials provided with the distribution.
15f74a4a2bSJens Wiklander *
16f74a4a2bSJens Wiklander * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17f74a4a2bSJens Wiklander * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18f74a4a2bSJens Wiklander * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19f74a4a2bSJens Wiklander * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20f74a4a2bSJens Wiklander * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21f74a4a2bSJens Wiklander * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22f74a4a2bSJens Wiklander * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23f74a4a2bSJens Wiklander * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24f74a4a2bSJens Wiklander * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25f74a4a2bSJens Wiklander * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26f74a4a2bSJens Wiklander * POSSIBILITY OF SUCH DAMAGE.
27f74a4a2bSJens Wiklander */
28f74a4a2bSJens Wiklander
29f74a4a2bSJens Wiklander#include <tee_syscall_numbers.h>
30a0fdab65SJens Wiklander#include <asm.S>
31f74a4a2bSJens Wiklander
32f74a4a2bSJens Wiklander        .section .text
33f74a4a2bSJens Wiklander
34f74a4a2bSJens Wiklander        .macro UTEE_SYSCALL name, scn, num_args
35a0fdab65SJens Wiklander	FUNC \name , :
36f74a4a2bSJens Wiklander
37f74a4a2bSJens Wiklander	.if \num_args > TEE_SVC_MAX_ARGS || \num_args > 8
38f74a4a2bSJens Wiklander	.error "Too many arguments for syscall"
39f74a4a2bSJens Wiklander	.endif
40f74a4a2bSJens Wiklander        mov     x8, #(\scn)
41f74a4a2bSJens Wiklander        svc #0
42f74a4a2bSJens Wiklander        ret
43a0fdab65SJens Wiklander        END_FUNC \name
44f74a4a2bSJens Wiklander        .endm
45f74a4a2bSJens Wiklander
460e1c6e8eSJerome Forissier	FUNC utee_panic, :
470e1c6e8eSJerome Forissier	stp	x29, x30, [sp, #-16]!
480e1c6e8eSJerome Forissier	mov	x1, sp
490e1c6e8eSJerome Forissier	bl	__utee_panic
500e1c6e8eSJerome Forissier	/* Not reached */
510e1c6e8eSJerome Forissier	END_FUNC utee_panic
520e1c6e8eSJerome Forissier
53f74a4a2bSJens Wiklander#include "utee_syscalls_asm.S"
54f74a4a2bSJens Wiklander
55