180708Sjake/*-
282899Sjake * Copyright (c) 1995 Bruce D. Evans.
380708Sjake * All rights reserved.
480708Sjake *
580708Sjake * Redistribution and use in source and binary forms, with or without
680708Sjake * modification, are permitted provided that the following conditions
780708Sjake * are met:
880708Sjake * 1. Redistributions of source code must retain the above copyright
980708Sjake *    notice, this list of conditions and the following disclaimer.
1080708Sjake * 2. Redistributions in binary form must reproduce the above copyright
1180708Sjake *    notice, this list of conditions and the following disclaimer in the
1280708Sjake *    documentation and/or other materials provided with the distribution.
1382899Sjake * 3. Neither the name of the author nor the names of contributors
1482899Sjake *    may be used to endorse or promote products derived from this software
1582899Sjake *    without specific prior written permission.
1680708Sjake *
1781334Sobrien * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1880708Sjake * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1980708Sjake * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2081334Sobrien * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
2180708Sjake * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2280708Sjake * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2380708Sjake * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2480708Sjake * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2580708Sjake * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2680708Sjake * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2780708Sjake * SUCH DAMAGE.
2880708Sjake *
2982899Sjake *	from: FreeBSD: src/sys/i386/include/md_var.h,v 1.40 2001/07/12
3080708Sjake * $FreeBSD$
3180708Sjake */
3280708Sjake
3380708Sjake#ifndef	_MACHINE_MD_VAR_H_
3480708Sjake#define	_MACHINE_MD_VAR_H_
3580708Sjake
36113166Sjaketypedef void cpu_block_copy_t(const void *src, void *dst, size_t len);
37113166Sjaketypedef void cpu_block_zero_t(void *dst, size_t len);
38113166Sjake
3989039Sjakeextern	char	tl0_base[];
4089039Sjakeextern	char	_end[];
4189039Sjake
42102600Speterextern	long	Maxmem;
4380708Sjake
4489039Sjakeextern	vm_offset_t kstack0;
45113238Sjakeextern	vm_paddr_t kstack0_phys;
4689039Sjake
4789039Sjakestruct	pcpu;
48140485Sjhbstruct	md_utrap;
4980708Sjake
50204152Smariusconst char *cpu_cpuid_prop(u_int cpu_impl);
51204152Smariusuint32_t cpu_get_mid(u_int cpu_impl);
5291359Sjakevoid	cpu_identify(u_long vers, u_int clock, u_int id);
5389039Sjakevoid	cpu_setregs(struct pcpu *pc);
54113238Sjakeint	is_physical_memory(vm_paddr_t addr);
55140485Sjhbstruct md_utrap *utrap_alloc(void);
56140485Sjhbvoid	utrap_free(struct md_utrap *ut);
57140485Sjhbstruct md_utrap *utrap_hold(struct md_utrap *ut);
5880708Sjake
59113166Sjakecpu_block_copy_t spitfire_block_copy;
60113166Sjakecpu_block_zero_t spitfire_block_zero;
61212709Smariuscpu_block_copy_t zeus_block_copy;
62212709Smariuscpu_block_zero_t zeus_block_zero;
63113166Sjake
64113166Sjakeextern	cpu_block_copy_t *cpu_block_copy;
65113166Sjakeextern	cpu_block_zero_t *cpu_block_zero;
66113166Sjake
67176197Smarius/*
68230665Smarius * Given that the VTOC8 disk label only uses 16-bit fields for cylinders,
69230665Smarius * heads and sectors we might need to adjust the geometry of large disks.
70176197Smarius */
71230665Smariusstruct ccb_calc_geometry;
72230665Smariusint scsi_da_bios_params(struct ccb_calc_geometry *ccg);
73176197Smariusstruct disk;
74208349Smariusvoid sparc64_ata_disk_firmware_geom_adjust(struct disk *disk);
75208349Smarius#define	ata_disk_firmware_geom_adjust(disk)				\
76208349Smarius	sparc64_ata_disk_firmware_geom_adjust(disk)
77176197Smarius
7880708Sjake#endif /* !_MACHINE_MD_VAR_H_ */
79