ALSA: hda - Add the top speaker pin config for HP Spectre x360
[linux/fpc-iii.git] / arch / tile / include / asm / jump_label.h
blobcde7573f397b9edfde5127499e101fdbb1335c33
1 /*
2 * Copyright 2015 Tilera Corporation. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation, version 2.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
11 * NON INFRINGEMENT. See the GNU General Public License for
12 * more details.
15 #ifndef _ASM_TILE_JUMP_LABEL_H
16 #define _ASM_TILE_JUMP_LABEL_H
18 #include <arch/opcode.h>
20 #define JUMP_LABEL_NOP_SIZE TILE_BUNDLE_SIZE_IN_BYTES
22 static __always_inline bool arch_static_branch(struct static_key *key,
23 bool branch)
25 asm_volatile_goto("1:\n\t"
26 "nop" "\n\t"
27 ".pushsection __jump_table, \"aw\"\n\t"
28 ".quad 1b, %l[l_yes], %0 + %1 \n\t"
29 ".popsection\n\t"
30 : : "i" (key), "i" (branch) : : l_yes);
31 return false;
32 l_yes:
33 return true;
36 static __always_inline bool arch_static_branch_jump(struct static_key *key,
37 bool branch)
39 asm_volatile_goto("1:\n\t"
40 "j %l[l_yes]" "\n\t"
41 ".pushsection __jump_table, \"aw\"\n\t"
42 ".quad 1b, %l[l_yes], %0 + %1 \n\t"
43 ".popsection\n\t"
44 : : "i" (key), "i" (branch) : : l_yes);
45 return false;
46 l_yes:
47 return true;
50 typedef u64 jump_label_t;
52 struct jump_entry {
53 jump_label_t code;
54 jump_label_t target;
55 jump_label_t key;
58 #endif /* _ASM_TILE_JUMP_LABEL_H */