summary refs log tree commit diff
path: root/x86_64/host_cpuid.c
blob: 3230c9010c938111e2c5d7645bcc11fff6a3d07b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
// Copyright 2018 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <stdint.h>

void host_cpuid(uint32_t func, uint32_t func2, uint32_t *pEax,
                uint32_t *pEbx, uint32_t *pEcx, uint32_t *pEdx) {
    asm volatile("cpuid" : "=a"(*pEax), "=b"(*pEbx), "=c"(*pEcx), "=d"(*pEdx) :
                 "0"(func), "2"(func2) : "cc");
}