From patchwork Wed Sep 16 09:25:55 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 47884 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8G9QjFt009681 for ; Wed, 16 Sep 2009 09:26:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758314AbZIPJ0e (ORCPT ); Wed, 16 Sep 2009 05:26:34 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932094AbZIPJ0d (ORCPT ); Wed, 16 Sep 2009 05:26:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:30110 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758311AbZIPJ0L (ORCPT ); Wed, 16 Sep 2009 05:26:11 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8G9QFiH026461 for ; Wed, 16 Sep 2009 05:26:15 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8G9QE4n022871; Wed, 16 Sep 2009 05:26:14 -0400 Received: from localhost.localdomain (cleopatra.tlv.redhat.com [10.35.255.11]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id 9C2C3250AD8; Wed, 16 Sep 2009 12:26:11 +0300 (IDT) From: Avi Kivity To: Marcelo Tosatti Cc: kvm@vger.kernel.org Subject: [PATCH QEMU-KVM 20/34] test: Add fwcfg interface for getting the cpu count Date: Wed, 16 Sep 2009 12:25:55 +0300 Message-Id: <1253093169-1423-21-git-send-email-avi@redhat.com> In-Reply-To: <1253093169-1423-1-git-send-email-avi@redhat.com> References: <1253093169-1423-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Signed-off-by: Avi Kivity --- kvm/user/test/lib/x86/fwcfg.c | 5 +++++ kvm/user/test/lib/x86/fwcfg.h | 2 ++ 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/kvm/user/test/lib/x86/fwcfg.c b/kvm/user/test/lib/x86/fwcfg.c index a9a2ce2..2cf7cec 100644 --- a/kvm/user/test/lib/x86/fwcfg.c +++ b/kvm/user/test/lib/x86/fwcfg.c @@ -33,3 +33,8 @@ uint64_t fwcfg_get_u64(unsigned index) { return fwcfg_get_u(index, 8); } + +unsigned fwcfg_get_nb_cpus(void) +{ + return fwcfg_get_u16(FW_CFG_NB_CPUS); +} diff --git a/kvm/user/test/lib/x86/fwcfg.h b/kvm/user/test/lib/x86/fwcfg.h index c7245e2..e0836ca 100644 --- a/kvm/user/test/lib/x86/fwcfg.h +++ b/kvm/user/test/lib/x86/fwcfg.h @@ -38,5 +38,7 @@ uint16_t fwcfg_get_u16(unsigned index); uint32_t fwcfg_get_u32(unsigned index); uint64_t fwcfg_get_u64(unsigned index); +unsigned fwcfg_get_nb_cpus(void); + #endif