Beispiel #1
0
        public static bool ReadMsr(uint index, out uint eax, out uint edx, ulong threadAffinityMask)
        {
            ulong mask   = ThreadAffinity.Set(threadAffinityMask);
            bool  result = ReadMsr(index, out eax, out edx);

            ThreadAffinity.Set(mask);
            return(result);
        }
Beispiel #2
0
        public static bool ReadMsr(uint index, out uint eax, out uint edx, GroupAffinity affinity)
        {
            GroupAffinity previousAffinity = ThreadAffinity.Set(affinity);
            bool          result           = ReadMsr(index, out eax, out edx);

            ThreadAffinity.Set(previousAffinity);
            return(result);
        }
Beispiel #3
0
        public static bool CpuIdTx(uint index, uint ecxValue, out uint eax, out uint ebx, out uint ecx, out uint edx, GroupAffinity affinity)
        {
            GroupAffinity previousAffinity = ThreadAffinity.Set(affinity);

            if (previousAffinity == GroupAffinity.Undefined)
            {
                eax = ebx = ecx = edx = 0;
                return(false);
            }

            CpuId(index, ecxValue, out eax, out ebx, out ecx, out edx);
            ThreadAffinity.Set(previousAffinity);
            return(true);
        }
Beispiel #4
0
        public static bool CpuidTx(uint index, uint ecxValue, out uint eax, out uint ebx, out uint ecx, out uint edx, ulong threadAffinityMask)
        {
            ulong mask = ThreadAffinity.Set(threadAffinityMask);

            if (mask == 0)
            {
                eax = ebx = ecx = edx = 0;
                return(false);
            }

            Cpuid(index, ecxValue, out eax, out ebx, out ecx, out edx);
            ThreadAffinity.Set(mask);
            return(true);
        }
Beispiel #5
0
 public static ulong ThreadAffinitySet(ulong mask)
 {
     return(ThreadAffinity.Set(mask));
 }