aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-20 16:45:53 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-20 16:45:53 -0400
commitede13d81b4dda409a6d271b34b8e2ec9383e255d (patch)
tree2e32142d5a8e076c64f1871f5ad162fffff5f357 /include
parent2008220879af095d00ca27eb168a55c8595fbc0b (diff)
parent486acd4850dde6d2f8c7f431432f3914c4bfb5f5 (diff)
Merge branch 'for-2.6.23' of master.kernel.org:/pub/scm/linux/kernel/git/arnd/cell-2.6
* 'for-2.6.23' of master.kernel.org:/pub/scm/linux/kernel/git/arnd/cell-2.6: (37 commits) [CELL] spufs: rework list management and associated locking [CELL] oprofile: add support to OProfile for profiling CELL BE SPUs [CELL] oprofile: enable SPU switch notification to detect currently active SPU tasks [CELL] spu_base: locking cleanup [CELL] cell: indexing of SPUs based on firmware vicinity properties [CELL] spufs: integration of SPE affinity with the scheduller [CELL] cell: add placement computation for scheduling of affinity contexts [CELL] spufs: extension of spu_create to support affinity definition [CELL] cell: add hardcoded spu vicinity information for QS20 [CELL] cell: add vicinity information on spus [CELL] cell: add per BE structure with info about its SPUs [CELL] spufs: use find_first_bit() instead of sched_find_first_bit() [CELL] spufs: remove unused file argument from spufs_run_spu() [CELL] spufs: change decrementer restore timing [CELL] spufs: dont halt decrementer at restore step 47 [CELL] spufs: limit saving MFC_CNTL bits [CELL] spufs: fix read and write for decr_status file [CELL] spufs: fix decr_status meanings [CELL] spufs: remove needless context save/restore code [CELL] spufs: fix array size of channel index ...
Diffstat (limited to 'include')
-rw-r--r--include/asm-powerpc/oprofile_impl.h10
-rw-r--r--include/asm-powerpc/pmi.h8
-rw-r--r--include/asm-powerpc/spu.h62
-rw-r--r--include/asm-powerpc/spu_csa.h8
-rw-r--r--include/linux/dcookies.h1
-rw-r--r--include/linux/elf-em.h3
-rw-r--r--include/linux/oprofile.h35
-rw-r--r--include/linux/syscalls.h2
8 files changed, 106 insertions, 23 deletions
diff --git a/include/asm-powerpc/oprofile_impl.h b/include/asm-powerpc/oprofile_impl.h
index 8d6b47f7b300..938fefb4c4bc 100644
--- a/include/asm-powerpc/oprofile_impl.h
+++ b/include/asm-powerpc/oprofile_impl.h
@@ -39,14 +39,16 @@ struct op_system_config {
39 39
40/* Per-arch configuration */ 40/* Per-arch configuration */
41struct op_powerpc_model { 41struct op_powerpc_model {
42 void (*reg_setup) (struct op_counter_config *, 42 int (*reg_setup) (struct op_counter_config *,
43 struct op_system_config *, 43 struct op_system_config *,
44 int num_counters); 44 int num_counters);
45 void (*cpu_setup) (struct op_counter_config *); 45 int (*cpu_setup) (struct op_counter_config *);
46 void (*start) (struct op_counter_config *); 46 int (*start) (struct op_counter_config *);
47 void (*global_start) (struct op_counter_config *); 47 int (*global_start) (struct op_counter_config *);
48 void (*stop) (void); 48 void (*stop) (void);
49 void (*global_stop) (void); 49 void (*global_stop) (void);
50 int (*sync_start)(void);
51 int (*sync_stop)(void);
50 void (*handle_interrupt) (struct pt_regs *, 52 void (*handle_interrupt) (struct pt_regs *,
51 struct op_counter_config *); 53 struct op_counter_config *);
52 int num_counters; 54 int num_counters;
diff --git a/include/asm-powerpc/pmi.h b/include/asm-powerpc/pmi.h
index cb0f8aa43088..2259d4ce3846 100644
--- a/include/asm-powerpc/pmi.h
+++ b/include/asm-powerpc/pmi.h
@@ -55,13 +55,13 @@ typedef struct {
55struct pmi_handler { 55struct pmi_handler {
56 struct list_head node; 56 struct list_head node;
57 u8 type; 57 u8 type;
58 void (*handle_pmi_message) (struct of_device *, pmi_message_t); 58 void (*handle_pmi_message) (pmi_message_t);
59}; 59};
60 60
61void pmi_register_handler(struct of_device *, struct pmi_handler *); 61int pmi_register_handler(struct pmi_handler *);
62void pmi_unregister_handler(struct of_device *, struct pmi_handler *); 62void pmi_unregister_handler(struct pmi_handler *);
63 63
64void pmi_send_message(struct of_device *, pmi_message_t); 64int pmi_send_message(pmi_message_t);
65 65
66#endif /* __KERNEL__ */ 66#endif /* __KERNEL__ */
67#endif /* _POWERPC_PMI_H */ 67#endif /* _POWERPC_PMI_H */
diff --git a/include/asm-powerpc/spu.h b/include/asm-powerpc/spu.h
index eedc828cef2d..8836c0f1f2f7 100644
--- a/include/asm-powerpc/spu.h
+++ b/include/asm-powerpc/spu.h
@@ -107,10 +107,10 @@ struct spu_runqueue;
107struct device_node; 107struct device_node;
108 108
109enum spu_utilization_state { 109enum spu_utilization_state {
110 SPU_UTIL_SYSTEM,
111 SPU_UTIL_USER, 110 SPU_UTIL_USER,
111 SPU_UTIL_SYSTEM,
112 SPU_UTIL_IOWAIT, 112 SPU_UTIL_IOWAIT,
113 SPU_UTIL_IDLE, 113 SPU_UTIL_IDLE_LOADED,
114 SPU_UTIL_MAX 114 SPU_UTIL_MAX
115}; 115};
116 116
@@ -121,9 +121,9 @@ struct spu {
121 unsigned long problem_phys; 121 unsigned long problem_phys;
122 struct spu_problem __iomem *problem; 122 struct spu_problem __iomem *problem;
123 struct spu_priv2 __iomem *priv2; 123 struct spu_priv2 __iomem *priv2;
124 struct list_head list; 124 struct list_head cbe_list;
125 struct list_head sched_list;
126 struct list_head full_list; 125 struct list_head full_list;
126 enum { SPU_FREE, SPU_USED } alloc_state;
127 int number; 127 int number;
128 unsigned int irqs[3]; 128 unsigned int irqs[3];
129 u32 node; 129 u32 node;
@@ -137,6 +137,7 @@ struct spu {
137 struct spu_runqueue *rq; 137 struct spu_runqueue *rq;
138 unsigned long long timestamp; 138 unsigned long long timestamp;
139 pid_t pid; 139 pid_t pid;
140 pid_t tgid;
140 int class_0_pending; 141 int class_0_pending;
141 spinlock_t register_lock; 142 spinlock_t register_lock;
142 143
@@ -165,11 +166,14 @@ struct spu {
165 166
166 struct sys_device sysdev; 167 struct sys_device sysdev;
167 168
169 int has_mem_affinity;
170 struct list_head aff_list;
171
168 struct { 172 struct {
169 /* protected by interrupt reentrancy */ 173 /* protected by interrupt reentrancy */
170 enum spu_utilization_state utilization_state; 174 enum spu_utilization_state util_state;
171 unsigned long tstamp; /* time of last ctx switch */ 175 unsigned long long tstamp;
172 unsigned long times[SPU_UTIL_MAX]; 176 unsigned long long times[SPU_UTIL_MAX];
173 unsigned long long vol_ctx_switch; 177 unsigned long long vol_ctx_switch;
174 unsigned long long invol_ctx_switch; 178 unsigned long long invol_ctx_switch;
175 unsigned long long min_flt; 179 unsigned long long min_flt;
@@ -181,13 +185,29 @@ struct spu {
181 } stats; 185 } stats;
182}; 186};
183 187
184struct spu *spu_alloc(void); 188struct cbe_spu_info {
185struct spu *spu_alloc_node(int node); 189 struct mutex list_mutex;
186void spu_free(struct spu *spu); 190 struct list_head spus;
191 int n_spus;
192 int nr_active;
193 atomic_t reserved_spus;
194};
195
196extern struct cbe_spu_info cbe_spu_info[];
197
198void spu_init_channels(struct spu *spu);
187int spu_irq_class_0_bottom(struct spu *spu); 199int spu_irq_class_0_bottom(struct spu *spu);
188int spu_irq_class_1_bottom(struct spu *spu); 200int spu_irq_class_1_bottom(struct spu *spu);
189void spu_irq_setaffinity(struct spu *spu, int cpu); 201void spu_irq_setaffinity(struct spu *spu, int cpu);
190 202
203#ifdef CONFIG_KEXEC
204void crash_register_spus(struct list_head *list);
205#else
206static inline void crash_register_spus(struct list_head *list)
207{
208}
209#endif
210
191extern void spu_invalidate_slbs(struct spu *spu); 211extern void spu_invalidate_slbs(struct spu *spu);
192extern void spu_associate_mm(struct spu *spu, struct mm_struct *mm); 212extern void spu_associate_mm(struct spu *spu, struct mm_struct *mm);
193 213
@@ -195,6 +215,20 @@ extern void spu_associate_mm(struct spu *spu, struct mm_struct *mm);
195struct mm_struct; 215struct mm_struct;
196extern void spu_flush_all_slbs(struct mm_struct *mm); 216extern void spu_flush_all_slbs(struct mm_struct *mm);
197 217
218/* This interface allows a profiler (e.g., OProfile) to store a ref
219 * to spu context information that it creates. This caching technique
220 * avoids the need to recreate this information after a save/restore operation.
221 *
222 * Assumes the caller has already incremented the ref count to
223 * profile_info; then spu_context_destroy must call kref_put
224 * on prof_info_kref.
225 */
226void spu_set_profile_private_kref(struct spu_context *ctx,
227 struct kref *prof_info_kref,
228 void ( * prof_info_release) (struct kref *kref));
229
230void *spu_get_profile_private_kref(struct spu_context *ctx);
231
198/* system callbacks from the SPU */ 232/* system callbacks from the SPU */
199struct spu_syscall_block { 233struct spu_syscall_block {
200 u64 nr_ret; 234 u64 nr_ret;
@@ -206,7 +240,8 @@ extern long spu_sys_callback(struct spu_syscall_block *s);
206struct file; 240struct file;
207extern struct spufs_calls { 241extern struct spufs_calls {
208 asmlinkage long (*create_thread)(const char __user *name, 242 asmlinkage long (*create_thread)(const char __user *name,
209 unsigned int flags, mode_t mode); 243 unsigned int flags, mode_t mode,
244 struct file *neighbor);
210 asmlinkage long (*spu_run)(struct file *filp, __u32 __user *unpc, 245 asmlinkage long (*spu_run)(struct file *filp, __u32 __user *unpc,
211 __u32 __user *ustatus); 246 __u32 __user *ustatus);
212 struct module *owner; 247 struct module *owner;
@@ -233,8 +268,10 @@ struct spu_coredump_calls {
233#define SPU_CREATE_GANG 0x0002 268#define SPU_CREATE_GANG 0x0002
234#define SPU_CREATE_NOSCHED 0x0004 269#define SPU_CREATE_NOSCHED 0x0004
235#define SPU_CREATE_ISOLATE 0x0008 270#define SPU_CREATE_ISOLATE 0x0008
271#define SPU_CREATE_AFFINITY_SPU 0x0010
272#define SPU_CREATE_AFFINITY_MEM 0x0020
236 273
237#define SPU_CREATE_FLAG_ALL 0x000f /* mask of all valid flags */ 274#define SPU_CREATE_FLAG_ALL 0x003f /* mask of all valid flags */
238 275
239 276
240#ifdef CONFIG_SPU_FS_MODULE 277#ifdef CONFIG_SPU_FS_MODULE
@@ -403,6 +440,7 @@ struct spu_priv2 {
403#define MFC_CNTL_RESUME_DMA_QUEUE (0ull << 0) 440#define MFC_CNTL_RESUME_DMA_QUEUE (0ull << 0)
404#define MFC_CNTL_SUSPEND_DMA_QUEUE (1ull << 0) 441#define MFC_CNTL_SUSPEND_DMA_QUEUE (1ull << 0)
405#define MFC_CNTL_SUSPEND_DMA_QUEUE_MASK (1ull << 0) 442#define MFC_CNTL_SUSPEND_DMA_QUEUE_MASK (1ull << 0)
443#define MFC_CNTL_SUSPEND_MASK (1ull << 4)
406#define MFC_CNTL_NORMAL_DMA_QUEUE_OPERATION (0ull << 8) 444#define MFC_CNTL_NORMAL_DMA_QUEUE_OPERATION (0ull << 8)
407#define MFC_CNTL_SUSPEND_IN_PROGRESS (1ull << 8) 445#define MFC_CNTL_SUSPEND_IN_PROGRESS (1ull << 8)
408#define MFC_CNTL_SUSPEND_COMPLETE (3ull << 8) 446#define MFC_CNTL_SUSPEND_COMPLETE (3ull << 8)
diff --git a/include/asm-powerpc/spu_csa.h b/include/asm-powerpc/spu_csa.h
index c48ae185c874..e87794d5d4ea 100644
--- a/include/asm-powerpc/spu_csa.h
+++ b/include/asm-powerpc/spu_csa.h
@@ -50,6 +50,12 @@
50#define SPU_STOPPED_STATUS_P_I 8 50#define SPU_STOPPED_STATUS_P_I 8
51#define SPU_STOPPED_STATUS_R 9 51#define SPU_STOPPED_STATUS_R 9
52 52
53/*
54 * Definitions for software decrementer status flag.
55 */
56#define SPU_DECR_STATUS_RUNNING 0x1
57#define SPU_DECR_STATUS_WRAPPED 0x2
58
53#ifndef __ASSEMBLY__ 59#ifndef __ASSEMBLY__
54/** 60/**
55 * spu_reg128 - generic 128-bit register definition. 61 * spu_reg128 - generic 128-bit register definition.
@@ -63,7 +69,7 @@ struct spu_reg128 {
63 * @gprs: Array of saved registers. 69 * @gprs: Array of saved registers.
64 * @fpcr: Saved floating point status control register. 70 * @fpcr: Saved floating point status control register.
65 * @decr: Saved decrementer value. 71 * @decr: Saved decrementer value.
66 * @decr_status: Indicates decrementer run status. 72 * @decr_status: Indicates software decrementer status flags.
67 * @ppu_mb: Saved PPU mailbox data. 73 * @ppu_mb: Saved PPU mailbox data.
68 * @ppuint_mb: Saved PPU interrupting mailbox data. 74 * @ppuint_mb: Saved PPU interrupting mailbox data.
69 * @tag_mask: Saved tag group mask. 75 * @tag_mask: Saved tag group mask.
diff --git a/include/linux/dcookies.h b/include/linux/dcookies.h
index 0fe7cdf326f7..98c69ab80c84 100644
--- a/include/linux/dcookies.h
+++ b/include/linux/dcookies.h
@@ -12,6 +12,7 @@
12 12
13#ifdef CONFIG_PROFILING 13#ifdef CONFIG_PROFILING
14 14
15#include <linux/dcache.h>
15#include <linux/types.h> 16#include <linux/types.h>
16 17
17struct dcookie_user; 18struct dcookie_user;
diff --git a/include/linux/elf-em.h b/include/linux/elf-em.h
index 0311bad838b1..5834e843a946 100644
--- a/include/linux/elf-em.h
+++ b/include/linux/elf-em.h
@@ -20,7 +20,8 @@
20#define EM_PARISC 15 /* HPPA */ 20#define EM_PARISC 15 /* HPPA */
21#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */ 21#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */
22#define EM_PPC 20 /* PowerPC */ 22#define EM_PPC 20 /* PowerPC */
23#define EM_PPC64 21 /* PowerPC64 */ 23#define EM_PPC64 21 /* PowerPC64 */
24#define EM_SPU 23 /* Cell BE SPU */
24#define EM_SH 42 /* SuperH */ 25#define EM_SH 42 /* SuperH */
25#define EM_SPARCV9 43 /* SPARC v9 64-bit */ 26#define EM_SPARCV9 43 /* SPARC v9 64-bit */
26#define EM_IA_64 50 /* HP/Intel IA-64 */ 27#define EM_IA_64 50 /* HP/Intel IA-64 */
diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h
index 0d514b252454..041bb31100f4 100644
--- a/include/linux/oprofile.h
+++ b/include/linux/oprofile.h
@@ -17,6 +17,26 @@
17#include <linux/spinlock.h> 17#include <linux/spinlock.h>
18#include <asm/atomic.h> 18#include <asm/atomic.h>
19 19
20/* Each escaped entry is prefixed by ESCAPE_CODE
21 * then one of the following codes, then the
22 * relevant data.
23 * These #defines live in this file so that arch-specific
24 * buffer sync'ing code can access them.
25 */
26#define ESCAPE_CODE ~0UL
27#define CTX_SWITCH_CODE 1
28#define CPU_SWITCH_CODE 2
29#define COOKIE_SWITCH_CODE 3
30#define KERNEL_ENTER_SWITCH_CODE 4
31#define KERNEL_EXIT_SWITCH_CODE 5
32#define MODULE_LOADED_CODE 6
33#define CTX_TGID_CODE 7
34#define TRACE_BEGIN_CODE 8
35#define TRACE_END_CODE 9
36#define XEN_ENTER_SWITCH_CODE 10
37#define SPU_PROFILING_CODE 11
38#define SPU_CTX_SWITCH_CODE 12
39
20struct super_block; 40struct super_block;
21struct dentry; 41struct dentry;
22struct file_operations; 42struct file_operations;
@@ -35,6 +55,14 @@ struct oprofile_operations {
35 int (*start)(void); 55 int (*start)(void);
36 /* Stop delivering interrupts. */ 56 /* Stop delivering interrupts. */
37 void (*stop)(void); 57 void (*stop)(void);
58 /* Arch-specific buffer sync functions.
59 * Return value = 0: Success
60 * Return value = -1: Failure
61 * Return value = 1: Run generic sync function
62 */
63 int (*sync_start)(void);
64 int (*sync_stop)(void);
65
38 /* Initiate a stack backtrace. Optional. */ 66 /* Initiate a stack backtrace. Optional. */
39 void (*backtrace)(struct pt_regs * const regs, unsigned int depth); 67 void (*backtrace)(struct pt_regs * const regs, unsigned int depth);
40 /* CPU identification string. */ 68 /* CPU identification string. */
@@ -56,6 +84,13 @@ int oprofile_arch_init(struct oprofile_operations * ops);
56void oprofile_arch_exit(void); 84void oprofile_arch_exit(void);
57 85
58/** 86/**
87 * Add data to the event buffer.
88 * The data passed is free-form, but typically consists of
89 * file offsets, dcookies, context information, and ESCAPE codes.
90 */
91void add_event_entry(unsigned long data);
92
93/**
59 * Add a sample. This may be called from any context. Pass 94 * Add a sample. This may be called from any context. Pass
60 * smp_processor_id() as cpu. 95 * smp_processor_id() as cpu.
61 */ 96 */
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 7a8b1e3322e0..61def7c8fbb3 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -549,7 +549,7 @@ asmlinkage long sys_inotify_rm_watch(int fd, u32 wd);
549asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, 549asmlinkage long sys_spu_run(int fd, __u32 __user *unpc,
550 __u32 __user *ustatus); 550 __u32 __user *ustatus);
551asmlinkage long sys_spu_create(const char __user *name, 551asmlinkage long sys_spu_create(const char __user *name,
552 unsigned int flags, mode_t mode); 552 unsigned int flags, mode_t mode, int fd);
553 553
554asmlinkage long sys_mknodat(int dfd, const char __user * filename, int mode, 554asmlinkage long sys_mknodat(int dfd, const char __user * filename, int mode,
555 unsigned dev); 555 unsigned dev);