cpu_session: fix semantic of scale_priority
Remove "inverse" argument from function, because its documented behaviour wasn't implemented correctly, nor was it used by any code.
This commit is contained in:
parent
265ec48c20
commit
5a42f40f04
|
@ -199,25 +199,13 @@ namespace Genode {
|
||||||
* be power of 2
|
* be power of 2
|
||||||
* \param prio generic priority value as used by the CPU
|
* \param prio generic priority value as used by the CPU
|
||||||
* session interface
|
* session interface
|
||||||
* \param inverse order of platform priorities, if true
|
|
||||||
* 'pf_prio_limit' corresponds to the highest
|
|
||||||
* priority, otherwise it refers to the
|
|
||||||
* lowest priority.
|
|
||||||
* \return platform-specific priority value
|
* \return platform-specific priority value
|
||||||
*/
|
*/
|
||||||
static unsigned scale_priority(unsigned pf_prio_limit, unsigned prio,
|
static unsigned scale_priority(unsigned pf_prio_limit, unsigned prio)
|
||||||
bool inverse = true)
|
|
||||||
{
|
{
|
||||||
/* if no priorities are used, use the platform priority limit */
|
/* if no priorities are used, use the platform priority limit */
|
||||||
if (prio == 0) return pf_prio_limit;
|
if (prio == 0) return pf_prio_limit;
|
||||||
|
|
||||||
/*
|
|
||||||
* Generic priority values are (0 is highest, 'PRIORITY_LIMIT'
|
|
||||||
* is lowest. On platforms where priority levels are defined
|
|
||||||
* the other way round, we have to invert the priority value.
|
|
||||||
*/
|
|
||||||
prio = inverse ? Cpu_session::PRIORITY_LIMIT - prio : prio;
|
|
||||||
|
|
||||||
/* scale value to platform priority range 0..pf_prio_limit */
|
/* scale value to platform priority range 0..pf_prio_limit */
|
||||||
return (prio*pf_prio_limit)/Cpu_session::PRIORITY_LIMIT;
|
return (prio*pf_prio_limit)/Cpu_session::PRIORITY_LIMIT;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue