msrs.py revision 5149:356e00996637
15347Ssaidi@eecs.umich.edu# Copyright (c) 2007 The Hewlett-Packard Development Company
23395Shsul@eecs.umich.edu# All rights reserved.
33395Shsul@eecs.umich.edu#
43395Shsul@eecs.umich.edu# Redistribution and use of this software in source and binary forms,
53395Shsul@eecs.umich.edu# with or without modification, are permitted provided that the
63395Shsul@eecs.umich.edu# following conditions are met:
73395Shsul@eecs.umich.edu#
83395Shsul@eecs.umich.edu# The software must be used only for Non-Commercial Use which means any
93395Shsul@eecs.umich.edu# use which is NOT directed to receiving any direct monetary
103395Shsul@eecs.umich.edu# compensation for, or commercial advantage from such use.  Illustrative
113395Shsul@eecs.umich.edu# examples of non-commercial use are academic research, personal study,
123395Shsul@eecs.umich.edu# teaching, education and corporate research & development.
133395Shsul@eecs.umich.edu# Illustrative examples of commercial use are distributing products for
143395Shsul@eecs.umich.edu# commercial advantage and providing services using the software for
153395Shsul@eecs.umich.edu# commercial advantage.
163395Shsul@eecs.umich.edu#
173395Shsul@eecs.umich.edu# If you wish to use this software or functionality therein that may be
183395Shsul@eecs.umich.edu# covered by patents for commercial use, please contact:
193395Shsul@eecs.umich.edu#     Director of Intellectual Property Licensing
203395Shsul@eecs.umich.edu#     Office of Strategy and Technology
213395Shsul@eecs.umich.edu#     Hewlett-Packard Company
223395Shsul@eecs.umich.edu#     1501 Page Mill Road
233395Shsul@eecs.umich.edu#     Palo Alto, California  94304
243395Shsul@eecs.umich.edu#
253395Shsul@eecs.umich.edu# Redistributions of source code must retain the above copyright notice,
263395Shsul@eecs.umich.edu# this list of conditions and the following disclaimer.  Redistributions
273395Shsul@eecs.umich.edu# in binary form must reproduce the above copyright notice, this list of
283395Shsul@eecs.umich.edu# conditions and the following disclaimer in the documentation and/or
293395Shsul@eecs.umich.edu# other materials provided with the distribution.  Neither the name of
303509Shsul@eecs.umich.edu# the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its
313395Shsul@eecs.umich.edu# contributors may be used to endorse or promote products derived from
323395Shsul@eecs.umich.edu# this software without specific prior written permission.  No right of
333395Shsul@eecs.umich.edu# sublicense is granted herewith.  Derivatives of the software and
343395Shsul@eecs.umich.edu# output created using the software may be prepared, but only for
353481Shsul@eecs.umich.edu# Non-Commercial Uses.  Derivatives of the software may be shared with
363481Shsul@eecs.umich.edu# others provided: (i) the others agree to abide by the list of
373481Shsul@eecs.umich.edu# conditions herein which includes the Non-Commercial Use restrictions;
383481Shsul@eecs.umich.edu# and (ii) such Derivatives of the software include the above copyright
395347Ssaidi@eecs.umich.edu# notice to acknowledge the contribution from this software where
403481Shsul@eecs.umich.edu# applicable, this list of conditions and the disclaimer below.
413681Sktlim@umich.edu#
423681Sktlim@umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
433681Sktlim@umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
445347Ssaidi@eecs.umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
455869Sksewell@umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
465869Sksewell@umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
475869Sksewell@umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
485869Sksewell@umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
495869Sksewell@umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
503481Shsul@eecs.umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
515347Ssaidi@eecs.umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
523481Shsul@eecs.umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
533481Shsul@eecs.umich.edu#
543481Shsul@eecs.umich.edu# Authors: Gabe Black
553481Shsul@eecs.umich.edu
563481Shsul@eecs.umich.edumicrocode = '''
573481Shsul@eecs.umich.edudef macroop WRMSR
585369Ssaidi@eecs.umich.edu{
593481Shsul@eecs.umich.edu    limm t1, "IntAddrPrefixMSR >> 3"
605347Ssaidi@eecs.umich.edu    ld t2, intseg, [8, t1, rcx], dataSize=8, addressSize=4
613481Shsul@eecs.umich.edu    mov rax, rax, t2, dataSize=4
623481Shsul@eecs.umich.edu    srli t2, t2, 32, dataSize=8
633481Shsul@eecs.umich.edu    mov rdx, rdx, t2, dataSize=4
643481Shsul@eecs.umich.edu};
653481Shsul@eecs.umich.edu
663481Shsul@eecs.umich.edudef macroop RDMSR
673481Shsul@eecs.umich.edu{
683395Shsul@eecs.umich.edu    limm t1, "IntAddrPrefixMSR >> 3"
693395Shsul@eecs.umich.edu    mov t2, t2, rdx, dataSize=4
703395Shsul@eecs.umich.edu    slli t2, t2, 32, dataSize=8
714167Sbinkertn@umich.edu    mov t2, t2, rax, dataSize=4
723395Shsul@eecs.umich.edu    st t2, intseg, [8, t1, rcx], dataSize=8, addressSize=4
733395Shsul@eecs.umich.edu};
743395Shsul@eecs.umich.edu'''
753511Shsul@eecs.umich.edu