WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH] Add Cpuid.features_mask function.

To: xen-api <xen-api@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-API] [PATCH] Add Cpuid.features_mask function.
From: Rob Hoes <rob.hoes@xxxxxxxxxx>
Date: Fri, 19 Mar 2010 10:03:03 +0000
Delivery-date: Fri, 19 Mar 2010 03:03:07 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Rob Hoes <rob.hoes@xxxxxxxxxx>
Add Cpuid.features_mask function.

Signed-off-by: Rob Hoes <rob.hoes@xxxxxxxxxx>

diff -r 9ab11f4a89f1 cpuid/cpuid.ml
--- a/cpuid/cpuid.ml    Wed Mar 17 11:15:44 2010 +0000
+++ b/cpuid/cpuid.ml    Fri Mar 19 10:01:00 2010 +0000
@@ -179,6 +179,14 @@
        
 (* === Masking checks === *)
 
+let mask_features features mask =
+       {
+               base_ecx = logand features.base_ecx mask.base_ecx;
+               base_edx = logand features.base_edx mask.base_edx;
+               ext_ecx = logand features.ext_ecx mask.ext_ecx;
+               ext_edx = logand features.ext_edx mask.ext_edx;
+       }
+
 let assert_maskability cpu manufacturer features = 
        (* Manufacturers need to be the same *)
        if manufacturer != cpu.manufacturer then 
diff -r 9ab11f4a89f1 cpuid/cpuid.mli
--- a/cpuid/cpuid.mli   Wed Mar 17 11:15:44 2010 +0000
+++ b/cpuid/cpuid.mli   Fri Mar 19 10:01:00 2010 +0000
@@ -54,8 +54,11 @@
 
 (** {2 Masking Checks} *)
 
-(** Check that this CPU can be masked to fit the pool. Raises {!CannotMaskCpu} 
- *  including a reason string if this is not possible. *)
+(** Apply a mask to given features. *)
+val mask_features : features -> features -> features
+
+(** Check that this CPU can be masked to fit the pool. Raises exception
+ *  indicating the reason if this is not possible. *)
 val assert_maskability : cpu_info -> manufacturer -> features -> unit
 
 (** Return the CPU masking string to add to the Xen command-line, 

Attachment: cpuid-mask
Description: Text document

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-API] [PATCH] Add Cpuid.features_mask function., Rob Hoes <=