]> err.no Git - linux-2.6/blobdiff - include/asm-powerpc/spu.h
[NETPOLL]: Don't need rx_flags.
[linux-2.6] / include / asm-powerpc / spu.h
index 18e558bef98ef4b1870f7f3559f1dc5afb954d6e..34b7807f068b3a0f1300bebdbd1046baad1da8d0 100644 (file)
@@ -121,16 +121,16 @@ struct spu {
        unsigned long problem_phys;
        struct spu_problem __iomem *problem;
        struct spu_priv2 __iomem *priv2;
-       struct list_head list;
        struct list_head cbe_list;
-       struct list_head sched_list;
        struct list_head full_list;
+       enum { SPU_FREE, SPU_USED } alloc_state;
        int number;
        unsigned int irqs[3];
        u32 node;
        u64 flags;
        u64 dar;
        u64 dsisr;
+       u64 class_0_pending;
        size_t ls_size;
        unsigned int slb_replace;
        struct mm_struct *mm;
@@ -138,7 +138,7 @@ struct spu {
        struct spu_runqueue *rq;
        unsigned long long timestamp;
        pid_t pid;
-       int class_0_pending;
+       pid_t tgid;
        spinlock_t register_lock;
 
        void (* wbox_callback)(struct spu *spu);
@@ -186,17 +186,16 @@ struct spu {
 };
 
 struct cbe_spu_info {
+       struct mutex list_mutex;
        struct list_head spus;
-       struct list_head free_spus;
        int n_spus;
+       int nr_active;
        atomic_t reserved_spus;
 };
 
 extern struct cbe_spu_info cbe_spu_info[];
 
-struct spu *spu_alloc(void);
-struct spu *spu_alloc_node(int node);
-void spu_free(struct spu *spu);
+void spu_init_channels(struct spu *spu);
 int spu_irq_class_0_bottom(struct spu *spu);
 int spu_irq_class_1_bottom(struct spu *spu);
 void spu_irq_setaffinity(struct spu *spu, int cpu);
@@ -216,6 +215,20 @@ extern void spu_associate_mm(struct spu *spu, struct mm_struct *mm);
 struct mm_struct;
 extern void spu_flush_all_slbs(struct mm_struct *mm);
 
+/* This interface allows a profiler (e.g., OProfile) to store a ref
+ * to spu context information that it creates. This caching technique
+ * avoids the need to recreate this information after a save/restore operation.
+ *
+ * Assumes the caller has already incremented the ref count to
+ * profile_info; then spu_context_destroy must call kref_put
+ * on prof_info_kref.
+ */
+void spu_set_profile_private_kref(struct spu_context *ctx,
+                                 struct kref *prof_info_kref,
+                                 void ( * prof_info_release) (struct kref *kref));
+
+void *spu_get_profile_private_kref(struct spu_context *ctx);
+
 /* system callbacks from the SPU */
 struct spu_syscall_block {
        u64 nr_ret;
@@ -225,18 +238,15 @@ extern long spu_sys_callback(struct spu_syscall_block *s);
 
 /* syscalls implemented in spufs */
 struct file;
-extern struct spufs_calls {
-       asmlinkage long (*create_thread)(const char __user *name,
-                                       unsigned int flags, mode_t mode);
-       asmlinkage long (*spu_run)(struct file *filp, __u32 __user *unpc,
+struct spufs_calls {
+       long (*create_thread)(const char __user *name,
+                                       unsigned int flags, mode_t mode,
+                                       struct file *neighbor);
+       long (*spu_run)(struct file *filp, __u32 __user *unpc,
                                                __u32 __user *ustatus);
-       struct module *owner;
-} spufs_calls;
-
-/* coredump calls implemented in spufs */
-struct spu_coredump_calls {
-       asmlinkage int (*arch_notes_size)(void);
-       asmlinkage void (*arch_write_notes)(struct file *file);
+       int (*coredump_extra_notes_size)(void);
+       int (*coredump_extra_notes_write)(struct file *file, loff_t *foffset);
+       void (*notify_spus_active)(void);
        struct module *owner;
 };
 
@@ -254,25 +264,14 @@ struct spu_coredump_calls {
 #define SPU_CREATE_GANG                        0x0002
 #define SPU_CREATE_NOSCHED             0x0004
 #define SPU_CREATE_ISOLATE             0x0008
+#define SPU_CREATE_AFFINITY_SPU                0x0010
+#define SPU_CREATE_AFFINITY_MEM                0x0020
 
-#define SPU_CREATE_FLAG_ALL            0x000f /* mask of all valid flags */
+#define SPU_CREATE_FLAG_ALL            0x003f /* mask of all valid flags */
 
 
-#ifdef CONFIG_SPU_FS_MODULE
 int register_spu_syscalls(struct spufs_calls *calls);
 void unregister_spu_syscalls(struct spufs_calls *calls);
-#else
-static inline int register_spu_syscalls(struct spufs_calls *calls)
-{
-       return 0;
-}
-static inline void unregister_spu_syscalls(struct spufs_calls *calls)
-{
-}
-#endif /* MODULE */
-
-int register_arch_coredump_calls(struct spu_coredump_calls *calls);
-void unregister_arch_coredump_calls(struct spu_coredump_calls *calls);
 
 int spu_add_sysdev_attr(struct sysdev_attribute *attr);
 void spu_remove_sysdev_attr(struct sysdev_attribute *attr);
@@ -300,6 +299,9 @@ struct notifier_block;
 int spu_switch_event_register(struct notifier_block * n);
 int spu_switch_event_unregister(struct notifier_block * n);
 
+extern void notify_spus_active(void);
+extern void do_notify_spus_active(void);
+
 /*
  * This defines the Local Store, Problem Area and Privlege Area of an SPU.
  */