diff options
author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2013-02-15 10:43:11 -0500 |
---|---|---|
committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2013-02-15 10:43:11 -0500 |
commit | 574cad9d2ac20c8df24aa008eecca39331df0bd6 (patch) | |
tree | 446f4a3595f77b78e463fcd54d20e3f71e459c43 /litmus | |
parent | 60efc2b2302096a7c388a2c5c16a728ae6c9cf7e (diff) |
PCP: allow NULL config parameter
When the config parameter is NULL, just default to the local CPU,
which is what we want in 99% of the cases anyway.
Diffstat (limited to 'litmus')
-rw-r--r-- | litmus/sched_pfp.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/litmus/sched_pfp.c b/litmus/sched_pfp.c index 0e875a3b5cba..e3c3bd770efa 100644 --- a/litmus/sched_pfp.c +++ b/litmus/sched_pfp.c | |||
@@ -1292,7 +1292,9 @@ int pfp_pcp_open(struct litmus_lock* l, void* __user config) | |||
1292 | /* we need to know the real-time priority */ | 1292 | /* we need to know the real-time priority */ |
1293 | return -EPERM; | 1293 | return -EPERM; |
1294 | 1294 | ||
1295 | if (get_user(cpu, (int*) config)) | 1295 | if (!config) |
1296 | cpu = get_partition(t); | ||
1297 | else if (get_user(cpu, (int*) config)) | ||
1296 | return -EFAULT; | 1298 | return -EFAULT; |
1297 | 1299 | ||
1298 | /* make sure the resource location matches */ | 1300 | /* make sure the resource location matches */ |
@@ -1613,7 +1615,9 @@ static long pfp_allocate_lock(struct litmus_lock **lock, int type, | |||
1613 | 1615 | ||
1614 | case PCP_SEM: | 1616 | case PCP_SEM: |
1615 | /* Priority Ceiling Protocol */ | 1617 | /* Priority Ceiling Protocol */ |
1616 | if (get_user(cpu, (int*) config)) | 1618 | if (!config) |
1619 | cpu = get_partition(current); | ||
1620 | else if (get_user(cpu, (int*) config)) | ||
1617 | return -EFAULT; | 1621 | return -EFAULT; |
1618 | 1622 | ||
1619 | if (!cpu_online(cpu)) | 1623 | if (!cpu_online(cpu)) |