#define _GNU_SOURCE #include #include #include #include #include #include #include "proc.h" #include "die.h" void cpu_affinity(int cpu) { int ret; cpu_set_t cpu_bitmask; CPU_ZERO(&cpu_bitmask); CPU_SET(cpu, &cpu_bitmask); ret = sched_setaffinity(getpid(), sizeof(cpu_bitmask), &cpu_bitmask); if (ret) panic("Can't set this cpu affinity!\n"); } int set_proc_prio(int priority) { int ret = setpriority(PRIO_PROCESS, getpid(), priority); if (ret) panic("Can't set nice val to %i!\n", priority); return 0; } int set_sched_status(int policy, int priority) { int ret, min_prio, max_prio; struct sched_param sp; max_prio = sched_get_priority_max(policy); min_prio = sched_get_priority_min(policy); if (max_prio == -1 || min_prio == -1) printf("Cannot determine scheduler prio limits!\n"); else if (priority < min_prio) priority = min_prio; else if (priority > max_prio) priority = max_prio; memset(&sp, 0, sizeof(sp)); sp.sched_priority = priority; ret = sched_setscheduler(getpid(), policy, &sp); if (ret) { printf("Cannot set scheduler policy!\n"); return -EINVAL; } ret = sched_setparam(getpid(), &sp); if (ret) { printf("Cannot set scheduler prio!\n"); return -EINVAL; } return 0; } tion> net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2016-05-18 00:08:49 +0100
committerRalf Baechle <ralf@linux-mips.org>2016-05-28 12:35:03 +0200
commit0f2d988d231373bd53d5102bf40792552ed11d87 (patch)
treeacdcfe06aa9b2d3324812e59f746d04f2e3d0ed9
parentba01cf0e1244fc3e4a24b4a111148c0d70025b36 (diff)
MIPS: Fix incomplete separation of XPA CPU feature
Commit 12822570a29b ("MIPS: Separate XPA CPU feature into LPA and MVH") wasn't fully applied, possibly due to a conflict with commit f270d881fa55 ("MIPS: Detect MIPSr6 Virtual Processor support"). This left decode_config5() referring to the non-existent MIPS_CPU_XPA, which breaks the build when XPA is enabled: arch/mips/kernel/cpu-probe.c In function ‘decode_config5’: arch/mips/kernel/cpu-probe.c:838:17: error: ‘MIPS_CPU_XPA’ undeclared (first use in this function) c->options |= MIPS_CPU_XPA; ^ Apply the missing hunk, dropping the CONFIG_XPA ifdef and setting the MIPS_CPU_MVH option when Config5.MVH is set. Fixes: 12822570a29b ("MIPS: Separate XPA CPU feature into LPA and MVH") Signed-off-by: James Hogan <james.hogan@imgtec.com> Cc: Paul Burton <paul.burton@imgtec.com> Cc: linux-mips@linux-mips.org Link: https://patchwork.linux-mips.org/patch/13112/ Patchwork: https://patchwork.linux-mips.org/patch/13277/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>