I am working with MaRTE OS (a Hard RTOS with a Minimal RT POSIX.13 subset [marte webpage] ) and at a low level programing.
I use IA32_CLOCK_MODULATION MSR to change the CPU frecuency. It allows to me to modulate the dutycycle of the on-demand clock. The dutycycle field encoding is 3 bits. Then, I have a set of fixed dutycycle values.