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

« back to all changes in this revision

Viewing changes to arch/x86/oprofile/nmi_timer_int.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati
  • Date: 2011-12-06 15:56:07 UTC
  • Revision ID: package-import@ubuntu.com-20111206155607-pcf44kv5fmhk564f
Tags: 3.2.0-1401.1
[ Paolo Pisati ]

* Rebased on top of Ubuntu-3.2.0-3.8
* Tilt-tracking @ ef2487af4bb15bdd0689631774b5a5e3a59f74e2
* Delete debian.ti-omap4/control, it shoudln't be tracked
* Fix architecture spelling (s/armel/armhf/)
* [Config] Update configs following 3.2 import
* [Config] Fix compilation: disable CODA and ARCH_OMAP3
* [Config] Fix compilation: disable Ethernet Faraday
* Update series to precise

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#include <asm/apic.h>
19
19
#include <asm/ptrace.h>
20
20
 
21
 
static int profile_timer_exceptions_notify(struct notifier_block *self,
22
 
                                           unsigned long val, void *data)
 
21
static int profile_timer_exceptions_notify(unsigned int val, struct pt_regs *regs)
23
22
{
24
 
        struct die_args *args = (struct die_args *)data;
25
 
        int ret = NOTIFY_DONE;
26
 
 
27
 
        switch (val) {
28
 
        case DIE_NMI:
29
 
                oprofile_add_sample(args->regs, 0);
30
 
                ret = NOTIFY_STOP;
31
 
                break;
32
 
        default:
33
 
                break;
34
 
        }
35
 
        return ret;
 
23
        oprofile_add_sample(regs, 0);
 
24
        return NMI_HANDLED;
36
25
}
37
26
 
38
 
static struct notifier_block profile_timer_exceptions_nb = {
39
 
        .notifier_call = profile_timer_exceptions_notify,
40
 
        .next = NULL,
41
 
        .priority = NMI_LOW_PRIOR,
42
 
};
43
 
 
44
27
static int timer_start(void)
45
28
{
46
 
        if (register_die_notifier(&profile_timer_exceptions_nb))
 
29
        if (register_nmi_handler(NMI_LOCAL, profile_timer_exceptions_notify,
 
30
                                        0, "oprofile-timer"))
47
31
                return 1;
48
32
        return 0;
49
33
}
51
35
 
52
36
static void timer_stop(void)
53
37
{
54
 
        unregister_die_notifier(&profile_timer_exceptions_nb);
 
38
        unregister_nmi_handler(NMI_LOCAL, "oprofile-timer");
55
39
        synchronize_sched();  /* Allow already-started NMIs to complete. */
56
40
}
57
41