diff options
author | Bob Nelson <rrnelson@linux.vnet.ibm.com> | 2007-12-14 09:27:30 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-12-27 23:07:52 -0500 |
commit | aed3a8c9bb1a8623a618232087c5ff62718e3b9a (patch) | |
tree | 3998117906b40887ce7739288403927f461bf4f4 /arch/powerpc/platforms/cell/spu_notify.c | |
parent | c68cb23dde29fb107575656effa46f7b9440ac04 (diff) |
[POWERPC] Oprofile: Remove dependency on spufs module
This removes an OProfile dependency on the spufs module. This
dependency was causing a problem for multiplatform systems that are
built with support for Oprofile on Cell but try to load the oprofile
module on a non-Cell system.
Signed-off-by: Bob Nelson <rrnelson@us.ibm.com>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Acked-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/cell/spu_notify.c')
-rw-r--r-- | arch/powerpc/platforms/cell/spu_notify.c | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/cell/spu_notify.c b/arch/powerpc/platforms/cell/spu_notify.c new file mode 100644 index 000000000000..34d156959f39 --- /dev/null +++ b/arch/powerpc/platforms/cell/spu_notify.c | |||
@@ -0,0 +1,67 @@ | |||
1 | /* | ||
2 | * Move OProfile dependencies from spufs module to the kernel so it | ||
3 | * can run on non-cell PPC. | ||
4 | * | ||
5 | * Copyright (C) IBM 2005 | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2, or (at your option) | ||
10 | * any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
20 | */ | ||
21 | |||
22 | #undef DEBUG | ||
23 | |||
24 | #include <linux/module.h> | ||
25 | #include <asm/spu.h> | ||
26 | #include "spufs/spufs.h" | ||
27 | |||
28 | static BLOCKING_NOTIFIER_HEAD(spu_switch_notifier); | ||
29 | |||
30 | void spu_switch_notify(struct spu *spu, struct spu_context *ctx) | ||
31 | { | ||
32 | blocking_notifier_call_chain(&spu_switch_notifier, | ||
33 | ctx ? ctx->object_id : 0, spu); | ||
34 | } | ||
35 | EXPORT_SYMBOL_GPL(spu_switch_notify); | ||
36 | |||
37 | int spu_switch_event_register(struct notifier_block *n) | ||
38 | { | ||
39 | int ret; | ||
40 | ret = blocking_notifier_chain_register(&spu_switch_notifier, n); | ||
41 | if (!ret) | ||
42 | notify_spus_active(); | ||
43 | return ret; | ||
44 | } | ||
45 | EXPORT_SYMBOL_GPL(spu_switch_event_register); | ||
46 | |||
47 | int spu_switch_event_unregister(struct notifier_block *n) | ||
48 | { | ||
49 | return blocking_notifier_chain_unregister(&spu_switch_notifier, n); | ||
50 | } | ||
51 | EXPORT_SYMBOL_GPL(spu_switch_event_unregister); | ||
52 | |||
53 | void spu_set_profile_private_kref(struct spu_context *ctx, | ||
54 | struct kref *prof_info_kref, | ||
55 | void (* prof_info_release) (struct kref *kref)) | ||
56 | { | ||
57 | ctx->prof_priv_kref = prof_info_kref; | ||
58 | ctx->prof_priv_release = prof_info_release; | ||
59 | } | ||
60 | EXPORT_SYMBOL_GPL(spu_set_profile_private_kref); | ||
61 | |||
62 | void *spu_get_profile_private_kref(struct spu_context *ctx) | ||
63 | { | ||
64 | return ctx->prof_priv_kref; | ||
65 | } | ||
66 | EXPORT_SYMBOL_GPL(spu_get_profile_private_kref); | ||
67 | |||