xref: /openbmc/qemu/tests/tcg/multiarch/nop_func.h (revision aaa90fede5d10e2a3c3fc7f2df608128d2cba761)
1*d4846c33SIlya Leoshkevich /*
2*d4846c33SIlya Leoshkevich  * No-op functions that can be safely copied.
3*d4846c33SIlya Leoshkevich  *
4*d4846c33SIlya Leoshkevich  * SPDX-License-Identifier: GPL-2.0-or-later
5*d4846c33SIlya Leoshkevich  */
6*d4846c33SIlya Leoshkevich #ifndef NOP_FUNC_H
7*d4846c33SIlya Leoshkevich #define NOP_FUNC_H
8*d4846c33SIlya Leoshkevich 
9*d4846c33SIlya Leoshkevich static const char nop_func[] = {
10*d4846c33SIlya Leoshkevich #if defined(__aarch64__)
11*d4846c33SIlya Leoshkevich     0xc0, 0x03, 0x5f, 0xd6,     /* ret */
12*d4846c33SIlya Leoshkevich #elif defined(__alpha__)
13*d4846c33SIlya Leoshkevich     0x01, 0x80, 0xFA, 0x6B,     /* ret */
14*d4846c33SIlya Leoshkevich #elif defined(__arm__)
15*d4846c33SIlya Leoshkevich     0x1e, 0xff, 0x2f, 0xe1,     /* bx lr */
16*d4846c33SIlya Leoshkevich #elif defined(__riscv)
17*d4846c33SIlya Leoshkevich     0x67, 0x80, 0x00, 0x00,     /* ret */
18*d4846c33SIlya Leoshkevich #elif defined(__s390__)
19*d4846c33SIlya Leoshkevich     0x07, 0xfe,                 /* br %r14 */
20*d4846c33SIlya Leoshkevich #elif defined(__i386__) || defined(__x86_64__)
21*d4846c33SIlya Leoshkevich     0xc3,                       /* ret */
22*d4846c33SIlya Leoshkevich #endif
23*d4846c33SIlya Leoshkevich };
24*d4846c33SIlya Leoshkevich 
25*d4846c33SIlya Leoshkevich #endif
26