]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/blame - arch/mips/include/asm/jump_label.h
Merge remote-tracking branches 'spi/topic/mxs', 'spi/topic/pxa', 'spi/topic/rockchip...
[mirror_ubuntu-eoan-kernel.git] / arch / mips / include / asm / jump_label.h
CommitLineData
94bb0c1a
DD
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (c) 2010 Cavium Networks, Inc.
7 */
8#ifndef _ASM_MIPS_JUMP_LABEL_H
9#define _ASM_MIPS_JUMP_LABEL_H
10
11#include <linux/types.h>
12
13#ifdef __KERNEL__
14
15#define JUMP_LABEL_NOP_SIZE 4
16
17#ifdef CONFIG_64BIT
18#define WORD_INSN ".dword"
19#else
20#define WORD_INSN ".word"
21#endif
22
935c2dbe
MR
23#ifdef CONFIG_CPU_MICROMIPS
24#define NOP_INSN "nop32"
25#else
26#define NOP_INSN "nop"
27#endif
28
c5905afb 29static __always_inline bool arch_static_branch(struct static_key *key)
d430d3d7 30{
935c2dbe 31 asm_volatile_goto("1:\t" NOP_INSN "\n\t"
d430d3d7
JB
32 "nop\n\t"
33 ".pushsection __jump_table, \"aw\"\n\t"
34 WORD_INSN " 1b, %l[l_yes], %0\n\t"
35 ".popsection\n\t"
36 : : "i" (key) : : l_yes);
37 return false;
38l_yes:
39 return true;
40}
94bb0c1a
DD
41
42#endif /* __KERNEL__ */
43
44#ifdef CONFIG_64BIT
45typedef u64 jump_label_t;
46#else
47typedef u32 jump_label_t;
48#endif
49
50struct jump_entry {
51 jump_label_t code;
52 jump_label_t target;
53 jump_label_t key;
54};
55
56#endif /* _ASM_MIPS_JUMP_LABEL_H */