1/*
2 * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include "pico.h"
8
9# note we don't do this by default in this file for backwards comaptibility with user code
10# that may include this file, but not use unified syntax. Note that this macro does equivalent
11# setup to the pico_default_asm macro for inline assembly in C code.
12.macro pico_default_asm_setup
13.syntax unified
14.cpu cortex-m0plus
15.thumb
16.endm
17
18// do not put align in here as it is used mid function sometimes
19.macro regular_func x
20.global \x
21.type \x,%function
22.thumb_func
23\x:
24.endm
25
26.macro weak_func x
27.weak \x
28.type \x,%function
29.thumb_func
30\x:
31.endm
32
33.macro regular_func_with_section x
34.section .text.\x
35regular_func \x
36.endm
37
38// do not put align in here as it is used mid function sometimes
39.macro wrapper_func x
40regular_func WRAPPER_FUNC_NAME(\x)
41.endm
42
43.macro weak_wrapper_func x
44weak_func WRAPPER_FUNC_NAME(\x)
45.endm
46
47# backwards compatibility
48.macro __pre_init func, priority_string
49.section .preinit_array.\priority_string
50.p2align 2
51.word \func
52.endm
53