~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to arch/powerpc/platforms/cell/spu_base.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#include <linux/io.h>
33
33
#include <linux/mutex.h>
34
34
#include <linux/linux_logo.h>
 
35
#include <linux/syscore_ops.h>
35
36
#include <asm/spu.h>
36
37
#include <asm/spu_priv1.h>
37
38
#include <asm/spu_csa.h>
521
522
}
522
523
EXPORT_SYMBOL_GPL(spu_init_channels);
523
524
 
524
 
static int spu_shutdown(struct sys_device *sysdev)
525
 
{
526
 
        struct spu *spu = container_of(sysdev, struct spu, sysdev);
527
 
 
528
 
        spu_free_irqs(spu);
529
 
        spu_destroy_spu(spu);
530
 
        return 0;
531
 
}
532
 
 
533
525
static struct sysdev_class spu_sysdev_class = {
534
526
        .name = "spu",
535
 
        .shutdown = spu_shutdown,
536
527
};
537
528
 
538
529
int spu_add_sysdev_attr(struct sysdev_attribute *attr)
797
788
}
798
789
#endif
799
790
 
 
791
static void spu_shutdown(void)
 
792
{
 
793
        struct spu *spu;
 
794
 
 
795
        mutex_lock(&spu_full_list_mutex);
 
796
        list_for_each_entry(spu, &spu_full_list, full_list) {
 
797
                spu_free_irqs(spu);
 
798
                spu_destroy_spu(spu);
 
799
        }
 
800
        mutex_unlock(&spu_full_list_mutex);
 
801
}
 
802
 
 
803
static struct syscore_ops spu_syscore_ops = {
 
804
        .shutdown = spu_shutdown,
 
805
};
 
806
 
800
807
static int __init init_spu_base(void)
801
808
{
802
809
        int i, ret = 0;
830
837
        crash_register_spus(&spu_full_list);
831
838
        mutex_unlock(&spu_full_list_mutex);
832
839
        spu_add_sysdev_attr(&attr_stat);
 
840
        register_syscore_ops(&spu_syscore_ops);
833
841
 
834
842
        spu_init_affinity();
835
843