mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
[POWERPC] spufs: add infrastructure for finding elf objects
This adds an 'object-id' file that the spe library can use to store a pointer to its ELF object. This was originally meant for use by oprofile, but is now also used by the GNU debugger, if available. In order for oprofile to find the location in an spu-elf binary where an event counter triggered, we need a way to identify the binary in the first place. Unfortunately, that binary itself can be embedded in a powerpc ELF binary. Since we can assume it is mapped into the effective address space of the running process, have that one write the pointer value into a new spufs file. When a context switch occurs, pass the user value to the profiler so that can look at the mapped file (with some care). Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
This commit is contained in:
parent
7650f2f2c3
commit
8676727779
4 changed files with 58 additions and 1 deletions
|
|
@ -200,6 +200,24 @@ static inline void unregister_spu_syscalls(struct spufs_calls *calls)
|
|||
#endif /* MODULE */
|
||||
|
||||
|
||||
/*
|
||||
* Notifier blocks:
|
||||
*
|
||||
* oprofile can get notified when a context switch is performed
|
||||
* on an spe. The notifer function that gets called is passed
|
||||
* a pointer to the SPU structure as well as the object-id that
|
||||
* identifies the binary running on that SPU now.
|
||||
*
|
||||
* For a context save, the object-id that is passed is zero,
|
||||
* identifying that the kernel will run from that moment on.
|
||||
*
|
||||
* For a context restore, the object-id is the value written
|
||||
* to object-id spufs file from user space and the notifer
|
||||
* function can assume that spu->ctx is valid.
|
||||
*/
|
||||
int spu_switch_event_register(struct notifier_block * n);
|
||||
int spu_switch_event_unregister(struct notifier_block * n);
|
||||
|
||||
/*
|
||||
* This defines the Local Store, Problem Area and Privlege Area of an SPU.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue