This commit also converts our own copyright headers to directly use SPDX, but leaves all other copyright header intact, only adding the SPDX ident. As far as possible this commit also merges multiple Data61 copyright statements/headers into one for consistency.
42 lines
900 B
C
42 lines
900 B
C
/*
|
|
* Copyright 2014, General Dynamics C4 Systems
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-only
|
|
*/
|
|
|
|
#ifndef __MACHINE_ASSEMBLER_H__
|
|
#define __MACHINE_ASSEMBLER_H__
|
|
|
|
/* This file contains useful macros for assembly code. */
|
|
|
|
#ifdef __ASSEMBLER__
|
|
|
|
/*
|
|
* Use BEGIN_FUNC(), END_FUNC() around assembly functions to annotate them
|
|
* correctly to the assembler.
|
|
*/
|
|
#define BEGIN_FUNC(_name) \
|
|
.global _name ; \
|
|
.type _name, %function ; \
|
|
_name:
|
|
|
|
#define END_FUNC(_name) \
|
|
.size _name, .-_name
|
|
|
|
/*
|
|
* BEGIN_FUNC_STATIC() and END_FUNC_STATIC() do as above, but without making a
|
|
* global declaration. (c.f. static functions in C).
|
|
*/
|
|
#define BEGIN_FUNC_STATIC(_name) \
|
|
.type _name, %function ; \
|
|
_name:
|
|
|
|
#define END_FUNC_STATIC(_name) \
|
|
.size _name, .-_name
|
|
|
|
#else /* !__ASSEMBLER__ */
|
|
#warning "Including assembly-specific header in C code"
|
|
#endif
|
|
|
|
#endif /* __MACHINE_ASSEMBLER_H__ */
|
|
|