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$
307090Sbde */
317090Sbde
327090Sbde#ifndef _MACHINE_MD_VAR_H_
337090Sbde#define	_MACHINE_MD_VAR_H_
347090Sbde
357090Sbde/*
367090Sbde * Miscellaneous machine-dependent declarations.
377090Sbde */
387090Sbde
39102600Speterextern	long	Maxmem;
40121999Sjhbextern	u_int	basemem;	/* PA of original top of base memory */
4133008Sbdeextern	int	busdma_swi_pending;
42108947Sjhbextern	u_int	cpu_exthigh;
43147691Speterextern	u_int	cpu_feature;
44147691Speterextern	u_int	cpu_feature2;
45147691Speterextern	u_int	amd_feature;
46151348Sjkimextern	u_int	amd_feature2;
47184101Sjkimextern	u_int	amd_pminfo;
48160309Smrextern	u_int	via_feature_rng;
49160309Smrextern	u_int	via_feature_xcrypt;
50195940Skibextern	u_int	cpu_clflush_line_size;
51109700Sjhbextern	u_int	cpu_fxsr;
5237553Sbdeextern	u_int	cpu_high;
53109700Sjhbextern	u_int	cpu_id;
54159087Sdavidxuextern	u_int	cpu_mxcsr_mask;
55109696Sjhbextern	u_int	cpu_procinfo;
56151348Sjkimextern	u_int	cpu_procinfo2;
577090Sbdeextern	char	cpu_vendor[];
58185341Sjkimextern	u_int	cpu_vendor_id;
5937553Sbdeextern	u_int	cyrix_did;
60253747Savgextern	u_int	cpu_mon_mwait_flags;
61253747Savgextern	u_int	cpu_mon_min_size;
62253747Savgextern	u_int	cpu_mon_max_size;
637090Sbdeextern	char	kstack[];
6414331Speterextern	char	sigcode[];
65105950Speterextern	int	szsigcode;
66105950Speter#ifdef COMPAT_FREEBSD4
67105950Speterextern	int	szfreebsd4_sigcode;
68105950Speter#endif
69105950Speter#ifdef COMPAT_43
70105950Speterextern	int	szosigcode;
71105950Speter#endif
72157909Speterextern	uint32_t *vm_page_dump;
73157909Speterextern	int	vm_page_dump_size;
74205573Salcextern	int	workaround_erratum383;
757090Sbde
7692761Salfredtypedef void alias_for_inthand_t(u_int cs, u_int ef, u_int esp, u_int ss);
7783366Sjulianstruct	thread;
787090Sbdestruct	reg;
7939197Sjdpstruct	fpreg;
8048691Sjlemonstruct  dbreg;
81157909Speterstruct	dumperinfo;
827090Sbde
8392761Salfredvoid	bcopyb(const void *from, void *to, size_t len);
8492761Salfredvoid	busdma_swi(void);
8592761Salfredvoid	cpu_setregs(void);
8692761Salfredvoid	cpu_switch_load_gs(void) __asm(__STRING(cpu_switch_load_gs));
8792761Salfredvoid	doreti_iret(void) __asm(__STRING(doreti_iret));
8892761Salfredvoid	doreti_iret_fault(void) __asm(__STRING(doreti_iret_fault));
8992761Salfredvoid	doreti_popl_ds(void) __asm(__STRING(doreti_popl_ds));
9092761Salfredvoid	doreti_popl_ds_fault(void) __asm(__STRING(doreti_popl_ds_fault));
9192761Salfredvoid	doreti_popl_es(void) __asm(__STRING(doreti_popl_es));
9292761Salfredvoid	doreti_popl_es_fault(void) __asm(__STRING(doreti_popl_es_fault));
9392761Salfredvoid	doreti_popl_fs(void) __asm(__STRING(doreti_popl_fs));
9492761Salfredvoid	doreti_popl_fs_fault(void) __asm(__STRING(doreti_popl_fs_fault));
95157909Spetervoid	dump_add_page(vm_paddr_t);
96157909Spetervoid	dump_drop_page(vm_paddr_t);
97235622Siwasakivoid	initializecpu(void);
98109700Sjhbvoid	enable_sse(void);
9992761Salfredvoid	fillw(int /*u_short*/ pat, void *base, size_t cnt);
10092761Salfredvoid	i686_pagezero(void *addr);
101120620Sjeffvoid	sse2_pagezero(void *addr);
102101235Sphkvoid	init_AMD_Elan_sc520(void);
103128100Salcint	is_physical_memory(vm_paddr_t addr);
104121999Sjhbint	isa_nmi(int cd);
105112569Sjakevm_paddr_t kvtop(void *addr);
10693018Sbdevoid	setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int selec);
10792761Salfredint     user_dbreg_trap(void);
108157909Spetervoid	minidumpsys(struct dumperinfo *);
1097090Sbde
1107090Sbde#endif /* !_MACHINE_MD_VAR_H_ */
111