RTEMS 6.1-rc1
asm.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
19/*
20 * Copyright (C) 2020 On-Line Applications Research Corporation (OAR)
21 * Written by Kinsey Moore <kinsey.moore@oarcorp.com>
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the above copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 *
32 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
33 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
34 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
35 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
36 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
37 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
38 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
39 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
40 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
41 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
42 * POSSIBILITY OF SUCH DAMAGE.
43 */
44
45#ifndef _RTEMS_ASM_H
46#define _RTEMS_ASM_H
47
48/*
49 * Indicate we are in an assembly file and get the basic CPU definitions.
50 */
51
52#ifndef ASM
53#define ASM
54#endif
55#include <rtems/score/percpu.h>
56
66/*
67 * Following must be tailor for a particular flavor of the C compiler.
68 * They may need to put underscores in front of the symbols.
69 */
70
71#define FUNCTION_ENTRY(name) \
72 .align 8; \
73 .globl name; \
74 .type name, %function; \
75 name:
76
77#define FUNCTION_END(name) \
78 .size name, . - name
79
80#define DEFINE_FUNCTION_AARCH64(name) \
81 .align 8 ; .globl name ; name: ; .globl name ## _aarch64 ; name ## _aarch64:
82
83.macro GET_SELF_CPU_CONTROL REG
84#ifdef RTEMS_SMP
85 /* Use Thread ID Register (TPIDR_EL1) */
86 mrs \REG, TPIDR_EL1
87#else
89#endif
90.endm
91
94#endif /* _RTEMS_ASM_H */
#define REG(x)
Definition: asm.h:72
macro GET_CPU_ID REG movl REG endm macro GET_SELF_CPU_CONTROL REG leal _Per_CPU_Information
Set of Per CPU Core Information.
Definition: asm.h:171
This header file provides the interfaces of the Per-CPU Information.