Path: blob/main/sys/compat/linuxkpi/common/include/asm/smp.h
39604 views
/*-1* Copyright (c) 2017 Mark Johnston <[email protected]>2*3* Redistribution and use in source and binary forms, with or without4* modification, are permitted provided that the following conditions are5* met:6* 1. Redistributions of source code must retain the above copyright7* notice, this list of conditions and the following disclaimer.8* 2. Redistributions in binary form must reproduce the above copyright9* notice, this list of conditions and the following disclaimer in10* the documentation and/or other materials provided with the11* distribution.12*13* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND14* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE15* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE16* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE17* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL18* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS19* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)20* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT21* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY22* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF23* SUCH DAMAGE.24*/2526#ifndef _LINUXKPI_ASM_SMP_H_27#define _LINUXKPI_ASM_SMP_H_2829#include <linux/jump_label.h>30#include <linux/preempt.h>31#include <asm/fpu/api.h>3233#if defined(__i386__) || defined(__amd64__)3435#define wbinvd_on_all_cpus() linux_wbinvd_on_all_cpus()3637int linux_wbinvd_on_all_cpus(void);3839#endif4041#define get_cpu() ({ \42critical_enter(); \43PCPU_GET(cpuid); \44})4546#define put_cpu() \47critical_exit()4849#endif /* _LINUXKPI_ASM_SMP_H_ */505152