~ubuntu-branches/ubuntu/precise/linux-lowlatency/precise

« back to all changes in this revision

Viewing changes to arch/mips/include/asm/jump_label.h

  • Committer: Package Import Robot
  • Author(s): Alessio Igor Bogani
  • Date: 2011-10-26 11:13:05 UTC
  • Revision ID: package-import@ubuntu.com-20111026111305-tz023xykf0i6eosh
Tags: upstream-3.2.0
ImportĀ upstreamĀ versionĀ 3.2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
23
static __always_inline bool arch_static_branch(struct jump_label_key *key)
 
24
{
 
25
        asm goto("1:\tnop\n\t"
 
26
                "nop\n\t"
 
27
                ".pushsection __jump_table,  \"aw\"\n\t"
 
28
                WORD_INSN " 1b, %l[l_yes], %0\n\t"
 
29
                ".popsection\n\t"
 
30
                : :  "i" (key) : : l_yes);
 
31
        return false;
 
32
l_yes:
 
33
        return true;
 
34
}
 
35
 
 
36
#endif /* __KERNEL__ */
 
37
 
 
38
#ifdef CONFIG_64BIT
 
39
typedef u64 jump_label_t;
 
40
#else
 
41
typedef u32 jump_label_t;
 
42
#endif
 
43
 
 
44
struct jump_entry {
 
45
        jump_label_t code;
 
46
        jump_label_t target;
 
47
        jump_label_t key;
 
48
};
 
49
 
 
50
#endif /* _ASM_MIPS_JUMP_LABEL_H */