From patchwork Wed Oct 24 04:04:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 193660 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 139BD2C0080 for ; Wed, 24 Oct 2012 15:06:53 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6AAC44A419; Wed, 24 Oct 2012 06:06:32 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9MXuyQZ0ZH-4; Wed, 24 Oct 2012 06:06:32 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 377CD4A4B1; Wed, 24 Oct 2012 06:05:36 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 64C614A3D9 for ; Wed, 24 Oct 2012 06:05:18 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iC-tcb+uLN96 for ; Wed, 24 Oct 2012 06:05:16 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-yh0-f74.google.com (mail-yh0-f74.google.com [209.85.213.74]) by theia.denx.de (Postfix) with ESMTPS id 8D43A4A3CB for ; Wed, 24 Oct 2012 06:05:07 +0200 (CEST) Received: by mail-yh0-f74.google.com with SMTP id 10so8920yhl.3 for ; Tue, 23 Oct 2012 21:05:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=SpBLyCkhQRewCzBXntpc1yetCzw5vAcZIBYt0vwNq1U=; b=Fctm9bu/oxLJxPTzJSH1q3WQF0bjC1GgvBRVTwb3CmI0xE5SFIwOi5U9IbukxB246M CWHsbnDaYN8eQANr72Yf1K7Q/HWxNuUwHas+9RC2z0BdfYKfPuv5LE0bqwdmjI4bAntY Z++bx9WUWt//5ffV2/NYmi0Qfck7ji93fvfvXTHLQ3D2mjLRoHpyand5MSzGQfMKj1bS WrCF2IymuCxZ2RDSLn1U589R98cVqls4nYSvAFqjkQF5psU2yUWpY8aU9lXuvi4s8Wws Xf1etCu9bCxPBG0v6/rQ9/wBf3hlSOSV/Qd1Ut4DWZpfNhyyHuwrrRviVu1y1gf+nDRv N82w== Received: by 10.236.82.9 with SMTP id n9mr10075100yhe.24.1351051506191; Tue, 23 Oct 2012 21:05:06 -0700 (PDT) Received: from wpzn3.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id m9si1222800yhc.5.2012.10.23.21.05.06 (version=TLSv1/SSLv3 cipher=AES128-SHA); Tue, 23 Oct 2012 21:05:06 -0700 (PDT) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.73.79]) by wpzn3.hot.corp.google.com (Postfix) with ESMTP id 0CCE3100047; Tue, 23 Oct 2012 21:05:06 -0700 (PDT) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id AC204161DE9; Tue, 23 Oct 2012 21:05:05 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Tue, 23 Oct 2012 21:04:38 -0700 Message-Id: <1351051486-6980-8-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1351051486-6980-1-git-send-email-sjg@chromium.org> References: <1351051486-6980-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQmAOxlGwZoWnSO75X0Q2qZL/JTyZIPEN0rYPOfNn00dYSv1DE3gvRQQxdzgdrNWmW4LtQUb6OilxqCn5WCyG5C3QSDiCaXLGlRobp6z+erlp5PXdII0mMM/5+vEG3VfobbT8Nn8M7tI9I0WNALguVf+6lfYZb9j7aljR2KvIP4H2mNb5R4ve72GhidWMuJ4bi93hmnv Cc: Stefan Reinauer Subject: [U-Boot] [PATCH 07/15] x86: Add functions to access MSRs X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Stefan Reinauer Provide basic functions to access these registers. Signed-off-by: Stefan Reinauer Signed-off-by: Simon Glass --- arch/x86/include/asm/msr.h | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+), 0 deletions(-) create mode 100644 arch/x86/include/asm/msr.h diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h new file mode 100644 index 0000000..0a681d1 --- /dev/null +++ b/arch/x86/include/asm/msr.h @@ -0,0 +1,25 @@ +#ifndef CPU_X86_ASM_MSR_H +#define CPU_X86_ASM_MSR_H + +static inline uint64_t rdmsr(unsigned index) +{ + uint64_t result; + + asm volatile ( + "rdmsr" + : "=A" (result) + : "c" (index) + ); + return result; +} + +static inline void wrmsr(unsigned index, uint64_t msr) +{ + asm volatile ( + "wrmsr" + : /* No outputs */ + : "c" (index), "A" (msr) + ); +} + +#endif /* CPU_X86_ASM_MSR_H */