msrs.py revision 5325
15325Sgblack@eecs.umich.edu# Copyright (c) 2008 The Regents of The University of Michigan 25325Sgblack@eecs.umich.edu# All rights reserved. 35325Sgblack@eecs.umich.edu# 45325Sgblack@eecs.umich.edu# Redistribution and use in source and binary forms, with or without 55325Sgblack@eecs.umich.edu# modification, are permitted provided that the following conditions are 65325Sgblack@eecs.umich.edu# met: redistributions of source code must retain the above copyright 75325Sgblack@eecs.umich.edu# notice, this list of conditions and the following disclaimer; 85325Sgblack@eecs.umich.edu# redistributions in binary form must reproduce the above copyright 95325Sgblack@eecs.umich.edu# notice, this list of conditions and the following disclaimer in the 105325Sgblack@eecs.umich.edu# documentation and/or other materials provided with the distribution; 115325Sgblack@eecs.umich.edu# neither the name of the copyright holders nor the names of its 125325Sgblack@eecs.umich.edu# contributors may be used to endorse or promote products derived from 135325Sgblack@eecs.umich.edu# this software without specific prior written permission. 145325Sgblack@eecs.umich.edu# 155325Sgblack@eecs.umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 165325Sgblack@eecs.umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 175325Sgblack@eecs.umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 185325Sgblack@eecs.umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 195325Sgblack@eecs.umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 205325Sgblack@eecs.umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 215325Sgblack@eecs.umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 225325Sgblack@eecs.umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 235325Sgblack@eecs.umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 245325Sgblack@eecs.umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 255325Sgblack@eecs.umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 265325Sgblack@eecs.umich.edu# 275325Sgblack@eecs.umich.edu# Authors: Gabe Black 285325Sgblack@eecs.umich.edu 295325Sgblack@eecs.umich.edu# Copyright (c) 2007-2008 The Hewlett-Packard Development Company 305149Sgblack@eecs.umich.edu# All rights reserved. 315149Sgblack@eecs.umich.edu# 325149Sgblack@eecs.umich.edu# Redistribution and use of this software in source and binary forms, 335149Sgblack@eecs.umich.edu# with or without modification, are permitted provided that the 345149Sgblack@eecs.umich.edu# following conditions are met: 355149Sgblack@eecs.umich.edu# 365149Sgblack@eecs.umich.edu# The software must be used only for Non-Commercial Use which means any 375149Sgblack@eecs.umich.edu# use which is NOT directed to receiving any direct monetary 385149Sgblack@eecs.umich.edu# compensation for, or commercial advantage from such use. Illustrative 395149Sgblack@eecs.umich.edu# examples of non-commercial use are academic research, personal study, 405149Sgblack@eecs.umich.edu# teaching, education and corporate research & development. 415149Sgblack@eecs.umich.edu# Illustrative examples of commercial use are distributing products for 425149Sgblack@eecs.umich.edu# commercial advantage and providing services using the software for 435149Sgblack@eecs.umich.edu# commercial advantage. 445149Sgblack@eecs.umich.edu# 455149Sgblack@eecs.umich.edu# If you wish to use this software or functionality therein that may be 465149Sgblack@eecs.umich.edu# covered by patents for commercial use, please contact: 475149Sgblack@eecs.umich.edu# Director of Intellectual Property Licensing 485149Sgblack@eecs.umich.edu# Office of Strategy and Technology 495149Sgblack@eecs.umich.edu# Hewlett-Packard Company 505149Sgblack@eecs.umich.edu# 1501 Page Mill Road 515149Sgblack@eecs.umich.edu# Palo Alto, California 94304 525149Sgblack@eecs.umich.edu# 535149Sgblack@eecs.umich.edu# Redistributions of source code must retain the above copyright notice, 545149Sgblack@eecs.umich.edu# this list of conditions and the following disclaimer. Redistributions 555149Sgblack@eecs.umich.edu# in binary form must reproduce the above copyright notice, this list of 565149Sgblack@eecs.umich.edu# conditions and the following disclaimer in the documentation and/or 575149Sgblack@eecs.umich.edu# other materials provided with the distribution. Neither the name of 585149Sgblack@eecs.umich.edu# the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its 595149Sgblack@eecs.umich.edu# contributors may be used to endorse or promote products derived from 605149Sgblack@eecs.umich.edu# this software without specific prior written permission. No right of 615149Sgblack@eecs.umich.edu# sublicense is granted herewith. Derivatives of the software and 625149Sgblack@eecs.umich.edu# output created using the software may be prepared, but only for 635149Sgblack@eecs.umich.edu# Non-Commercial Uses. Derivatives of the software may be shared with 645149Sgblack@eecs.umich.edu# others provided: (i) the others agree to abide by the list of 655149Sgblack@eecs.umich.edu# conditions herein which includes the Non-Commercial Use restrictions; 665149Sgblack@eecs.umich.edu# and (ii) such Derivatives of the software include the above copyright 675149Sgblack@eecs.umich.edu# notice to acknowledge the contribution from this software where 685149Sgblack@eecs.umich.edu# applicable, this list of conditions and the disclaimer below. 695149Sgblack@eecs.umich.edu# 705149Sgblack@eecs.umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 715149Sgblack@eecs.umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 725149Sgblack@eecs.umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 735149Sgblack@eecs.umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 745149Sgblack@eecs.umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 755149Sgblack@eecs.umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 765149Sgblack@eecs.umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 775149Sgblack@eecs.umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 785149Sgblack@eecs.umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 795149Sgblack@eecs.umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 805149Sgblack@eecs.umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 815149Sgblack@eecs.umich.edu# 825149Sgblack@eecs.umich.edu# Authors: Gabe Black 835149Sgblack@eecs.umich.edu 845149Sgblack@eecs.umich.edumicrocode = ''' 855243Sgblack@eecs.umich.edudef macroop RDMSR 865149Sgblack@eecs.umich.edu{ 875149Sgblack@eecs.umich.edu limm t1, "IntAddrPrefixMSR >> 3" 885149Sgblack@eecs.umich.edu ld t2, intseg, [8, t1, rcx], dataSize=8, addressSize=4 895149Sgblack@eecs.umich.edu mov rax, rax, t2, dataSize=4 905149Sgblack@eecs.umich.edu srli t2, t2, 32, dataSize=8 915149Sgblack@eecs.umich.edu mov rdx, rdx, t2, dataSize=4 925149Sgblack@eecs.umich.edu}; 935149Sgblack@eecs.umich.edu 945243Sgblack@eecs.umich.edudef macroop WRMSR 955149Sgblack@eecs.umich.edu{ 965149Sgblack@eecs.umich.edu limm t1, "IntAddrPrefixMSR >> 3" 975149Sgblack@eecs.umich.edu mov t2, t2, rax, dataSize=4 985325Sgblack@eecs.umich.edu slli t3, rdx, 32, dataSize=8 995325Sgblack@eecs.umich.edu or t2, t2, t3, dataSize=8 1005149Sgblack@eecs.umich.edu st t2, intseg, [8, t1, rcx], dataSize=8, addressSize=4 1015149Sgblack@eecs.umich.edu}; 1025149Sgblack@eecs.umich.edu''' 103