md_var.h revision 109700
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: head/sys/i386/include/md_var.h 109700 2003-01-22 18:18:45Z jhb $ 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; 4016875Sbdeextern u_int atdevbase; /* offset in virtual memory of ISA io mem */ 4192761Salfredextern void (*bcopy_vector)(const void *from, void *to, size_t len); 4233008Sbdeextern int busdma_swi_pending; 4393018Sbdeextern int (*copyin_vector)(const void *udaddr, void *kaddr, size_t len); 4493018Sbdeextern int (*copyout_vector)(const void *kaddr, void *udaddr, size_t len); 45108947Sjhbextern u_int cpu_exthigh; 4637553Sbdeextern u_int cpu_feature; 47109700Sjhbextern u_int cpu_fxsr; 4837553Sbdeextern u_int cpu_high; 49109700Sjhbextern u_int cpu_id; 50109696Sjhbextern u_int cpu_procinfo; 517090Sbdeextern char cpu_vendor[]; 5237553Sbdeextern u_int cyrix_did; 53101054Sphkextern uint16_t *elan_mmcr; 547090Sbdeextern char kstack[]; 5537553Sbde#ifdef PC98 5637553Sbdeextern int need_pre_dma_flush; 5737553Sbdeextern int need_post_dma_flush; 5837553Sbde#endif 5992761Salfredextern void (*ovbcopy_vector)(const void *from, void *to, size_t len); 6014331Speterextern char sigcode[]; 61105950Speterextern int szsigcode; 62105950Speter#ifdef COMPAT_FREEBSD4 63105950Speterextern int szfreebsd4_sigcode; 64105950Speter#endif 65105950Speter#ifdef COMPAT_43 66105950Speterextern int szosigcode; 67105950Speter#endif 687090Sbde 6992761Salfredtypedef void alias_for_inthand_t(u_int cs, u_int ef, u_int esp, u_int ss); 7083366Sjulianstruct thread; 717090Sbdestruct reg; 7239197Sjdpstruct fpreg; 7348691Sjlemonstruct dbreg; 747090Sbde 7592761Salfredvoid bcopyb(const void *from, void *to, size_t len); 7692761Salfredvoid busdma_swi(void); 7792761Salfredvoid cpu_halt(void); 7892761Salfredvoid cpu_reset(void); 7992761Salfredvoid cpu_setregs(void); 8092761Salfredvoid cpu_switch_load_gs(void) __asm(__STRING(cpu_switch_load_gs)); 8192761Salfredvoid doreti_iret(void) __asm(__STRING(doreti_iret)); 8292761Salfredvoid doreti_iret_fault(void) __asm(__STRING(doreti_iret_fault)); 8392761Salfredvoid doreti_popl_ds(void) __asm(__STRING(doreti_popl_ds)); 8492761Salfredvoid doreti_popl_ds_fault(void) __asm(__STRING(doreti_popl_ds_fault)); 8592761Salfredvoid doreti_popl_es(void) __asm(__STRING(doreti_popl_es)); 8692761Salfredvoid doreti_popl_es_fault(void) __asm(__STRING(doreti_popl_es_fault)); 8792761Salfredvoid doreti_popl_fs(void) __asm(__STRING(doreti_popl_fs)); 8892761Salfredvoid doreti_popl_fs_fault(void) __asm(__STRING(doreti_popl_fs_fault)); 89109700Sjhbvoid enable_sse(void); 9092761Salfredvoid fillw(int /*u_short*/ pat, void *base, size_t cnt); 9192761Salfredvoid i486_bzero(void *buf, size_t len); 9292761Salfredvoid i586_bcopy(const void *from, void *to, size_t len); 9392761Salfredvoid i586_bzero(void *buf, size_t len); 9492761Salfredint i586_copyin(const void *udaddr, void *kaddr, size_t len); 9592761Salfredint i586_copyout(const void *kaddr, void *udaddr, size_t len); 9692761Salfredvoid i686_pagezero(void *addr); 97101235Sphkvoid init_AMD_Elan_sc520(void); 9892761Salfredint is_physical_memory(vm_offset_t addr); 9992761Salfredu_long kvtop(void *addr); 10093018Sbdevoid setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int selec); 10192761Salfredvoid swi_vm(void *); 10292761Salfredint user_dbreg_trap(void); 1037090Sbde 1047090Sbde#endif /* !_MACHINE_MD_VAR_H_ */ 105