"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "arch/mips/oprofile/op_model_mipsxx.c" between
linux-5.3-rc3.tar.gz and linux-5.3-rc4.tar.gz

About: The full source of the development Linux kernel 5.3 (release candidate).

op_model_mipsxx.c  (linux-5.3-rc3):op_model_mipsxx.c  (linux-5.3-rc4)
skipping to change at line 175 skipping to change at line 175
{ {
unsigned int counters = op_model_mipsxx_ops.num_counters; unsigned int counters = op_model_mipsxx_ops.num_counters;
if (oprofile_skip_cpu(smp_processor_id())) if (oprofile_skip_cpu(smp_processor_id()))
return; return;
switch (counters) { switch (counters) {
case 4: case 4:
w_c0_perfctrl3(0); w_c0_perfctrl3(0);
w_c0_perfcntr3(reg.counter[3]); w_c0_perfcntr3(reg.counter[3]);
/* fall through */
case 3: case 3:
w_c0_perfctrl2(0); w_c0_perfctrl2(0);
w_c0_perfcntr2(reg.counter[2]); w_c0_perfcntr2(reg.counter[2]);
/* fall through */
case 2: case 2:
w_c0_perfctrl1(0); w_c0_perfctrl1(0);
w_c0_perfcntr1(reg.counter[1]); w_c0_perfcntr1(reg.counter[1]);
/* fall through */
case 1: case 1:
w_c0_perfctrl0(0); w_c0_perfctrl0(0);
w_c0_perfcntr0(reg.counter[0]); w_c0_perfcntr0(reg.counter[0]);
} }
} }
/* Start all counters on current CPU */ /* Start all counters on current CPU */
static void mipsxx_cpu_start(void *args) static void mipsxx_cpu_start(void *args)
{ {
unsigned int counters = op_model_mipsxx_ops.num_counters; unsigned int counters = op_model_mipsxx_ops.num_counters;
if (oprofile_skip_cpu(smp_processor_id())) if (oprofile_skip_cpu(smp_processor_id()))
return; return;
switch (counters) { switch (counters) {
case 4: case 4:
w_c0_perfctrl3(WHAT | reg.control[3]); w_c0_perfctrl3(WHAT | reg.control[3]);
/* fall through */
case 3: case 3:
w_c0_perfctrl2(WHAT | reg.control[2]); w_c0_perfctrl2(WHAT | reg.control[2]);
/* fall through */
case 2: case 2:
w_c0_perfctrl1(WHAT | reg.control[1]); w_c0_perfctrl1(WHAT | reg.control[1]);
/* fall through */
case 1: case 1:
w_c0_perfctrl0(WHAT | reg.control[0]); w_c0_perfctrl0(WHAT | reg.control[0]);
} }
} }
/* Stop all counters on current CPU */ /* Stop all counters on current CPU */
static void mipsxx_cpu_stop(void *args) static void mipsxx_cpu_stop(void *args)
{ {
unsigned int counters = op_model_mipsxx_ops.num_counters; unsigned int counters = op_model_mipsxx_ops.num_counters;
if (oprofile_skip_cpu(smp_processor_id())) if (oprofile_skip_cpu(smp_processor_id()))
return; return;
switch (counters) { switch (counters) {
case 4: case 4:
w_c0_perfctrl3(0); w_c0_perfctrl3(0);
/* fall through */
case 3: case 3:
w_c0_perfctrl2(0); w_c0_perfctrl2(0);
/* fall through */
case 2: case 2:
w_c0_perfctrl1(0); w_c0_perfctrl1(0);
/* fall through */
case 1: case 1:
w_c0_perfctrl0(0); w_c0_perfctrl0(0);
} }
} }
static int mipsxx_perfcount_handler(void) static int mipsxx_perfcount_handler(void)
{ {
unsigned int counters = op_model_mipsxx_ops.num_counters; unsigned int counters = op_model_mipsxx_ops.num_counters;
unsigned int control; unsigned int control;
unsigned int counter; unsigned int counter;
int handled = IRQ_NONE; int handled = IRQ_NONE;
if (cpu_has_mips_r2 && !(read_c0_cause() & CAUSEF_PCI)) if (cpu_has_mips_r2 && !(read_c0_cause() & CAUSEF_PCI))
return handled; return handled;
switch (counters) { switch (counters) {
#define HANDLE_COUNTER(n) \ #define HANDLE_COUNTER(n) \
/* fall through */ \
case n + 1: \ case n + 1: \
control = r_c0_perfctrl ## n(); \ control = r_c0_perfctrl ## n(); \
counter = r_c0_perfcntr ## n(); \ counter = r_c0_perfcntr ## n(); \
if ((control & MIPS_PERFCTRL_IE) && \ if ((control & MIPS_PERFCTRL_IE) && \
(counter & M_COUNTER_OVERFLOW)) { \ (counter & M_COUNTER_OVERFLOW)) { \
oprofile_add_sample(get_irq_regs(), n); \ oprofile_add_sample(get_irq_regs(), n); \
w_c0_perfcntr ## n(reg.counter[n]); \ w_c0_perfcntr ## n(reg.counter[n]); \
handled = IRQ_HANDLED; \ handled = IRQ_HANDLED; \
} }
HANDLE_COUNTER(3) HANDLE_COUNTER(3)
skipping to change at line 300 skipping to change at line 310
return counters; return counters;
} }
static void reset_counters(void *arg) static void reset_counters(void *arg)
{ {
int counters = (int)(long)arg; int counters = (int)(long)arg;
switch (counters) { switch (counters) {
case 4: case 4:
w_c0_perfctrl3(0); w_c0_perfctrl3(0);
w_c0_perfcntr3(0); w_c0_perfcntr3(0);
/* fall through */
case 3: case 3:
w_c0_perfctrl2(0); w_c0_perfctrl2(0);
w_c0_perfcntr2(0); w_c0_perfcntr2(0);
/* fall through */
case 2: case 2:
w_c0_perfctrl1(0); w_c0_perfctrl1(0);
w_c0_perfcntr1(0); w_c0_perfcntr1(0);
/* fall through */
case 1: case 1:
w_c0_perfctrl0(0); w_c0_perfctrl0(0);
w_c0_perfcntr0(0); w_c0_perfcntr0(0);
} }
} }
static irqreturn_t mipsxx_perfcount_int(int irq, void *dev_id) static irqreturn_t mipsxx_perfcount_int(int irq, void *dev_id)
{ {
return mipsxx_perfcount_handler(); return mipsxx_perfcount_handler();
} }
 End of changes. 13 change blocks. 
0 lines changed or deleted 13 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)