/*
 *	Copyright © 2015 Matthieu DUVAL, Rudy DUCHE
 *
 *	This file is part of RizzleHash.
 *
 *	RizzleHash is free software: you can redistribute it and/or modify
 *	it under the terms of the GNU General Public License as published by
 *	the Free Software Foundation, either version 3 of the License, or
 *	(at your option) any later version.
 *
 *	RizzleHash is distributed in the hope that it will be useful,
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *	GNU General Public License for more details.
 *
 *	You should have received a copy of the GNU General Public License
 *	along with RizzleHash.  If not, see 
 */
#ifndef CPUID_H_INCLUDED
#define CPUID_H_INCLUDED
#include 
#include 
#include 
//#include 
class CPUID{
    uint32_t regs[4];
public:
    explicit CPUID(unsigned eax , unsigned ecx)
    {
        asm volatile ("cpuid":"=a"(regs[0]),
                            "=b"(regs[1]),
                            "=c"(regs[2]),
                            "=d"(regs[3]):
                            "a"(eax),"c"(ecx));
    }
    const uint32_t &EAX() const {return regs[0];}
    const uint32_t &EBX() const {return regs[1];}
    const uint32_t &ECX() const {return regs[2];}
    const uint32_t &EDX() const {return regs[3];}
};
#endif // CPUID_H_INCLUDED