Path: blob/main/sys/compat/linuxkpi/common/include/asm/processor.h
39604 views
/*-1* SPDX-License-Identifier: BSD-2-Clause2*3* Copyright (c) 2021 Vladimir Kondratyev <[email protected]>4*5* Redistribution and use in source and binary forms, with or without6* modification, are permitted provided that the following conditions7* are met:8*9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11* 2. Redistributions in binary form must reproduce the above copyright12* notice, this list of conditions and the following disclaimer in the13* documentation and/or other materials provided with the distribution.14*15* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR16* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES17* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.18* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,19* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT20* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,21* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY22* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF24* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.25*/2627#ifndef _LINUXKPI_ASM_PROCESSOR_H_28#define _LINUXKPI_ASM_PROCESSOR_H_2930#include <sys/types.h>31#include <machine/cpufunc.h>32#include <machine/cpu.h>3334#if defined(__i386__) || defined(__amd64__)35#define X86_VENDOR_INTEL 036#define X86_VENDOR_CYRIX 137#define X86_VENDOR_AMD 238#define X86_VENDOR_UMC 339#define X86_VENDOR_CENTAUR 540#define X86_VENDOR_TRANSMETA 741#define X86_VENDOR_NSC 842#define X86_VENDOR_HYGON 943#define X86_VENDOR_NUM 124445#define X86_VENDOR_UNKNOWN 0xff4647struct cpuinfo_x86 {48uint8_t x86;49uint8_t x86_model;50uint16_t x86_clflush_size;51uint16_t x86_max_cores;52uint8_t x86_vendor;53};5455extern struct cpuinfo_x86 boot_cpu_data;56extern struct cpuinfo_x86 *__cpu_data;57#define cpu_data(cpu) __cpu_data[cpu]58#endif5960#define cpu_relax() cpu_spinwait()6162#endif /* _LINUXKPI_ASM_PROCESSOR_H_ */636465