~ubuntu-branches/ubuntu/quantal/linux-lowlatency/quantal-proposed

« back to all changes in this revision

Viewing changes to arch/sparc/include/asm/smp_32.h

  • Committer: Package Import Robot
  • Author(s): Andy Whitcroft, Andy Whitcroft
  • Date: 2012-06-21 09:16:38 UTC
  • Revision ID: package-import@ubuntu.com-20120621091638-gubhv4nox8xez1ct
Tags: 3.5.0-1.1
[ Andy Whitcroft]

* Rebuild lowlatency against Ubuntu-3.5.0-1.1
* All new configuration system to allow configuration deltas to be
  exposed via debian.lowlatency/config-delta

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 
9
9
#include <linux/threads.h>
10
10
#include <asm/head.h>
11
 
#include <asm/btfixup.h>
12
11
 
13
12
#ifndef __ASSEMBLY__
14
13
 
58
57
void smp_bogo(struct seq_file *);
59
58
void smp_info(struct seq_file *);
60
59
 
61
 
BTFIXUPDEF_CALL(void, smp_cross_call, smpfunc_t, cpumask_t, unsigned long, unsigned long, unsigned long, unsigned long)
62
 
BTFIXUPDEF_CALL(int, __hard_smp_processor_id, void)
63
 
BTFIXUPDEF_CALL(void, smp_ipi_resched, int);
64
 
BTFIXUPDEF_CALL(void, smp_ipi_single, int);
65
 
BTFIXUPDEF_CALL(void, smp_ipi_mask_one, int);
66
 
BTFIXUPDEF_BLACKBOX(hard_smp_processor_id)
67
 
BTFIXUPDEF_BLACKBOX(load_current)
68
 
 
69
 
#define smp_cross_call(func,mask,arg1,arg2,arg3,arg4) BTFIXUP_CALL(smp_cross_call)(func,mask,arg1,arg2,arg3,arg4)
70
 
 
71
 
static inline void xc0(smpfunc_t func) { smp_cross_call(func, *cpu_online_mask, 0, 0, 0, 0); }
 
60
struct sparc32_ipi_ops {
 
61
        void (*cross_call)(smpfunc_t func, cpumask_t mask, unsigned long arg1,
 
62
                           unsigned long arg2, unsigned long arg3,
 
63
                           unsigned long arg4);
 
64
        void (*resched)(int cpu);
 
65
        void (*single)(int cpu);
 
66
        void (*mask_one)(int cpu);
 
67
};
 
68
extern const struct sparc32_ipi_ops *sparc32_ipi_ops;
 
69
 
 
70
static inline void xc0(smpfunc_t func)
 
71
{
 
72
        sparc32_ipi_ops->cross_call(func, *cpu_online_mask, 0, 0, 0, 0);
 
73
}
 
74
 
72
75
static inline void xc1(smpfunc_t func, unsigned long arg1)
73
 
{ smp_cross_call(func, *cpu_online_mask, arg1, 0, 0, 0); }
 
76
{
 
77
        sparc32_ipi_ops->cross_call(func, *cpu_online_mask, arg1, 0, 0, 0);
 
78
}
74
79
static inline void xc2(smpfunc_t func, unsigned long arg1, unsigned long arg2)
75
 
{ smp_cross_call(func, *cpu_online_mask, arg1, arg2, 0, 0); }
 
80
{
 
81
        sparc32_ipi_ops->cross_call(func, *cpu_online_mask, arg1, arg2, 0, 0);
 
82
}
 
83
 
76
84
static inline void xc3(smpfunc_t func, unsigned long arg1, unsigned long arg2,
77
 
                           unsigned long arg3)
78
 
{ smp_cross_call(func, *cpu_online_mask, arg1, arg2, arg3, 0); }
 
85
                       unsigned long arg3)
 
86
{
 
87
        sparc32_ipi_ops->cross_call(func, *cpu_online_mask,
 
88
                                    arg1, arg2, arg3, 0);
 
89
}
 
90
 
79
91
static inline void xc4(smpfunc_t func, unsigned long arg1, unsigned long arg2,
80
 
                           unsigned long arg3, unsigned long arg4)
81
 
{ smp_cross_call(func, *cpu_online_mask, arg1, arg2, arg3, arg4); }
 
92
                       unsigned long arg3, unsigned long arg4)
 
93
{
 
94
        sparc32_ipi_ops->cross_call(func, *cpu_online_mask,
 
95
                                    arg1, arg2, arg3, arg4);
 
96
}
82
97
 
83
98
extern void arch_send_call_function_single_ipi(int cpu);
84
99
extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
88
103
        return cpu;
89
104
}
90
105
 
91
 
static inline int hard_smp4m_processor_id(void)
92
 
{
93
 
        int cpuid;
94
 
 
95
 
        __asm__ __volatile__("rd %%tbr, %0\n\t"
96
 
                             "srl %0, 12, %0\n\t"
97
 
                             "and %0, 3, %0\n\t" :
98
 
                             "=&r" (cpuid));
99
 
        return cpuid;
100
 
}
101
 
 
102
 
static inline int hard_smp4d_processor_id(void)
103
 
{
104
 
        int cpuid;
105
 
 
106
 
        __asm__ __volatile__("lda [%%g0] %1, %0\n\t" :
107
 
                             "=&r" (cpuid) : "i" (ASI_M_VIKING_TMP1));
108
 
        return cpuid;
109
 
}
110
 
 
111
 
extern inline int hard_smpleon_processor_id(void)
112
 
{
113
 
        int cpuid;
114
 
        __asm__ __volatile__("rd     %%asr17,%0\n\t"
115
 
                             "srl    %0,28,%0" :
116
 
                             "=&r" (cpuid) : );
117
 
        return cpuid;
118
 
}
119
 
 
120
 
#ifndef MODULE
121
 
static inline int hard_smp_processor_id(void)
122
 
{
123
 
        int cpuid;
124
 
 
125
 
        /* Black box - sun4m
126
 
                __asm__ __volatile__("rd %%tbr, %0\n\t"
127
 
                                     "srl %0, 12, %0\n\t"
128
 
                                     "and %0, 3, %0\n\t" :
129
 
                                     "=&r" (cpuid));
130
 
                     - sun4d
131
 
                __asm__ __volatile__("lda [%g0] ASI_M_VIKING_TMP1, %0\n\t"
132
 
                                     "nop; nop" :
133
 
                                     "=&r" (cpuid));
134
 
                     - leon
135
 
                __asm__ __volatile__(   "rd %asr17, %0\n\t"
136
 
                                        "srl %0, 0x1c, %0\n\t"
137
 
                                        "nop\n\t" :
138
 
                                        "=&r" (cpuid));
139
 
           See btfixup.h and btfixupprep.c to understand how a blackbox works.
140
 
         */
141
 
        __asm__ __volatile__("sethi %%hi(___b_hard_smp_processor_id), %0\n\t"
142
 
                             "sethi %%hi(boot_cpu_id), %0\n\t"
143
 
                             "ldub [%0 + %%lo(boot_cpu_id)], %0\n\t" :
144
 
                             "=&r" (cpuid));
145
 
        return cpuid;
146
 
}
147
 
#else
148
 
static inline int hard_smp_processor_id(void)
149
 
{
150
 
        int cpuid;
151
 
 
152
 
        __asm__ __volatile__("mov %%o7, %%g1\n\t"
153
 
                             "call ___f___hard_smp_processor_id\n\t"
154
 
                             " nop\n\t"
155
 
                             "mov %%g2, %0\n\t" : "=r"(cpuid) : : "g1", "g2");
156
 
        return cpuid;
157
 
}
158
 
#endif
 
106
extern int hard_smp_processor_id(void);
159
107
 
160
108
#define raw_smp_processor_id()          (current_thread_info()->cpu)
161
109