xref: /optee_os/lib/libutils/isoc/arch/arm/arm32_aeabi_divmod_a32.S (revision 5a913ee74d3c71af2a2860ce8a4e7aeab2916f9b)
1/* SPDX-License-Identifier: BSD-2-Clause */
2/*
3 * Copyright (c) 2014, STMicroelectronics International N.V.
4 */
5
6#include <asm.S>
7
8/*
9 * This assembly source is used both in kernel and userland
10 * hence define unwind resources that match both environments.
11 */
12#if defined(CFG_UNWIND)
13#define LOCAL_UNWIND(...)	__VA_ARGS__
14#else
15#define LOCAL_UNWIND(...)
16#endif
17
18/*
19 * signed ret_idivmod_values(signed quot, signed rem);
20 * return quotient and remaining the EABI way (regs r0,r1)
21 */
22.section .text.ret_idivmod_values
23FUNC ret_idivmod_values , :
24LOCAL_UNWIND(.fnstart)
25        bx lr
26LOCAL_UNWIND(.fnend)
27END_FUNC ret_idivmod_values
28
29/*
30 * unsigned ret_uidivmod_values(unsigned quot, unsigned rem);
31 * return quotient and remaining the EABI way (regs r0,r1)
32 */
33.section .text.ret_uidivmod_values
34FUNC ret_uidivmod_values , :
35LOCAL_UNWIND(.fnstart)
36        bx      lr
37LOCAL_UNWIND(.fnend)
38END_FUNC ret_uidivmod_values
39