17090Sbde/*-
27090Sbde * Copyright (c) 1995 Bruce D. Evans.
37090Sbde * All rights reserved.
47090Sbde *
57090Sbde * Redistribution and use in source and binary forms, with or without
67090Sbde * modification, are permitted provided that the following conditions
77090Sbde * are met:
87090Sbde * 1. Redistributions of source code must retain the above copyright
97090Sbde *    notice, this list of conditions and the following disclaimer.
107090Sbde * 2. Redistributions in binary form must reproduce the above copyright
117090Sbde *    notice, this list of conditions and the following disclaimer in the
127090Sbde *    documentation and/or other materials provided with the distribution.
137090Sbde * 3. Neither the name of the author nor the names of contributors
147090Sbde *    may be used to endorse or promote products derived from this software
157090Sbde *    without specific prior written permission.
167090Sbde *
177090Sbde * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
187090Sbde * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
197090Sbde * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
207090Sbde * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
217090Sbde * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
227090Sbde * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
237090Sbde * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
247090Sbde * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
257090Sbde * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
267090Sbde * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
277090Sbde * SUCH DAMAGE.
287090Sbde *
2950477Speter * $FreeBSD: releng/11.0/sys/i386/include/md_var.h 297399 2016-03-29 19:56:48Z kib $
307090Sbde */
317090Sbde
327090Sbde#ifndef _MACHINE_MD_VAR_H_
337090Sbde#define	_MACHINE_MD_VAR_H_
347090Sbde
35291949Skib#include <x86/x86_var.h>
367090Sbde
37271076Sjhbextern	u_int	cyrix_did;
38271076Sjhb#if defined(I586_CPU) && !defined(NO_F00F_HACK)
39271076Sjhbextern	int	has_f00f_bug;
40271076Sjhb#endif
41105950Speter#ifdef COMPAT_FREEBSD4
42105950Speterextern	int	szfreebsd4_sigcode;
43105950Speter#endif
44105950Speter#ifdef COMPAT_43
45105950Speterextern	int	szosigcode;
46105950Speter#endif
47157909Speterextern	uint32_t *vm_page_dump;
487090Sbde
49284918Skibstruct	segment_descriptor;
50291949Skibunion savefpu;
517090Sbde
5292761Salfredvoid	bcopyb(const void *from, void *to, size_t len);
5392761Salfredvoid	cpu_switch_load_gs(void) __asm(__STRING(cpu_switch_load_gs));
5492761Salfredvoid	doreti_iret(void) __asm(__STRING(doreti_iret));
5592761Salfredvoid	doreti_iret_fault(void) __asm(__STRING(doreti_iret_fault));
5692761Salfredvoid	doreti_popl_ds(void) __asm(__STRING(doreti_popl_ds));
5792761Salfredvoid	doreti_popl_ds_fault(void) __asm(__STRING(doreti_popl_ds_fault));
5892761Salfredvoid	doreti_popl_es(void) __asm(__STRING(doreti_popl_es));
5992761Salfredvoid	doreti_popl_es_fault(void) __asm(__STRING(doreti_popl_es_fault));
6092761Salfredvoid	doreti_popl_fs(void) __asm(__STRING(doreti_popl_fs));
6192761Salfredvoid	doreti_popl_fs_fault(void) __asm(__STRING(doreti_popl_fs_fault));
62271076Sjhbvoid	finishidentcpu(void);
63284918Skibvoid	fill_based_sd(struct segment_descriptor *sdp, uint32_t base);
6492761Salfredvoid	i686_pagezero(void *addr);
65120620Sjeffvoid	sse2_pagezero(void *addr);
66101235Sphkvoid	init_AMD_Elan_sc520(void);
67112569Sjakevm_paddr_t kvtop(void *addr);
68271408Sjhbvoid	ppro_reenable_apic(void);
6993018Sbdevoid	setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int selec);
70273995Sjhbunion savefpu *get_pcb_user_save_td(struct thread *td);
71273995Sjhbunion savefpu *get_pcb_user_save_pcb(struct pcb *pcb);
72273995Sjhbstruct pcb *get_pcb_td(struct thread *td);
737090Sbde
747090Sbde#endif /* !_MACHINE_MD_VAR_H_ */
75