app/extras/undervolt.py
def write_msr(val, msr=0x150):
    """
    Use /dev/cpu/*/msr interface provided by msr module to read/write
    values from register 0x150.
    Writes to all msr node on all CPUs available.
    """
    for i in range(multiprocessing.cpu_count()):
        c = '/dev/cpu/%d/msr' % i
        if not os.path.exists(c):
            raise OSError("msr module not loaded (run modprobe msr)")
        logging.info("Writing {val} to {msr}".format(val=hex(val), msr=c))
        f = os.open(c, os.O_WRONLY)
        os.lseek(f, msr, os.SEEK_SET)
        os.write(f, pack('Q', val))
        os.close(f)

    Use /dev/cpu/*/msr interface provided by msr module to read/write
    values from register 0x150.
    Writes to all msr node on all CPUs available.
    
Use /dev/cpu/msr interface provided by msr module to read/write
values from register 0x150.
Writes to all msr node on all CPUs available.
Use / dev / cpu / msr interface provided by msr module to read / write values from register 0x150 . Writes to all msr node on all CPUs available .
def write_msr(val, msr=0x150):
    for i in range(multiprocessing.cpu_count()):
        c = '/dev/cpu/%d/msr' % i
        if not os.path.exists(c):
            raise OSError("msr module not loaded (run modprobe msr)")
        logging.info("Writing {val} to {msr}".format(val=hex(val), msr=c))
        f = os.open(c, os.O_WRONLY)
        os.lseek(f, msr, os.SEEK_SET)
        os.write(f, pack('Q', val))
        os.close(f)
def write_msr ( val , msr = 0x150 ) : for i in range ( multiprocessing . cpu_count ( ) ) : c = '/dev/cpu/%d/msr' % i if not os . path . exists ( c ) : raise OSError ( "msr module not loaded (run modprobe msr)" ) logging . info ( "Writing {val} to {msr}" . format ( val = hex ( val ) , msr = c ) ) f = os . open ( c , os . O_WRONLY ) os . lseek ( f , msr , os . SEEK_SET ) os . write ( f , pack ( 'Q' , val ) ) os . close ( f )
Use /dev/cpu/*/msr interface provided by msr module to read/write
values from register 0x150.
Use / dev / cpu / * / msr interface provided by msr module to read / write values from register 0x150 .
"""
    Use /dev/cpu/*/msr interface provided by msr module to read/write
    values from register 0x150.
    Writes to all msr node on all CPUs available.
    """
val
msr