1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Move OProfile dependencies from spufs module to the kernel so it
4 * can run on non-cell PPC.
6 * Copyright (C) IBM 2005
11 #include <linux/export.h>
12 #include <linux/notifier.h>
14 #include "spufs/spufs.h"
16 static BLOCKING_NOTIFIER_HEAD(spu_switch_notifier
);
18 void spu_switch_notify(struct spu
*spu
, struct spu_context
*ctx
)
20 blocking_notifier_call_chain(&spu_switch_notifier
,
21 ctx
? ctx
->object_id
: 0, spu
);
23 EXPORT_SYMBOL_GPL(spu_switch_notify
);
25 int spu_switch_event_register(struct notifier_block
*n
)
28 ret
= blocking_notifier_chain_register(&spu_switch_notifier
, n
);
33 EXPORT_SYMBOL_GPL(spu_switch_event_register
);
35 int spu_switch_event_unregister(struct notifier_block
*n
)
37 return blocking_notifier_chain_unregister(&spu_switch_notifier
, n
);
39 EXPORT_SYMBOL_GPL(spu_switch_event_unregister
);
41 void spu_set_profile_private_kref(struct spu_context
*ctx
,
42 struct kref
*prof_info_kref
,
43 void (* prof_info_release
) (struct kref
*kref
))
45 ctx
->prof_priv_kref
= prof_info_kref
;
46 ctx
->prof_priv_release
= prof_info_release
;
48 EXPORT_SYMBOL_GPL(spu_set_profile_private_kref
);
50 void *spu_get_profile_private_kref(struct spu_context
*ctx
)
52 return ctx
->prof_priv_kref
;
54 EXPORT_SYMBOL_GPL(spu_get_profile_private_kref
);