blob: a0a7a2c72bd4f9a405b935a217b6b817337428b1 [file] [log] [blame]
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00001/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __ASM_LINKAGE_H
3#define __ASM_LINKAGE_H
4
Olivier Deprez157378f2022-04-04 15:47:50 +02005#include <asm/asm-const.h>
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00006#include <linux/stringify.h>
7
8#define __ALIGN .align 4, 0x07
9#define __ALIGN_STR __stringify(__ALIGN)
10
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000011/*
12 * Helper macro for exception table entries
13 */
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000014
Olivier Deprez157378f2022-04-04 15:47:50 +020015#define __EX_TABLE(_section, _fault, _target) \
16 stringify_in_c(.section _section,"a";) \
17 stringify_in_c(.align 8;) \
18 stringify_in_c(.long (_fault) - .;) \
19 stringify_in_c(.long (_target) - .;) \
20 stringify_in_c(.quad 0;) \
21 stringify_in_c(.previous)
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000022
Olivier Deprez157378f2022-04-04 15:47:50 +020023#define EX_TABLE(_fault, _target) \
24 __EX_TABLE(__ex_table, _fault, _target)
25#define EX_TABLE_DMA(_fault, _target) \
26 __EX_TABLE(.dma.ex_table, _fault, _target)
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000027
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000028#endif