md_var.h revision 214903
1178172Simp/*-
2178172Simp * Copyright (c) 1995 Bruce D. Evans.
3178172Simp * All rights reserved.
4178172Simp *
5178172Simp * Redistribution and use in source and binary forms, with or without
6178172Simp * modification, are permitted provided that the following conditions
7178172Simp * are met:
8178172Simp * 1. Redistributions of source code must retain the above copyright
9178172Simp *    notice, this list of conditions and the following disclaimer.
10178172Simp * 2. Redistributions in binary form must reproduce the above copyright
11178172Simp *    notice, this list of conditions and the following disclaimer in the
12178172Simp *    documentation and/or other materials provided with the distribution.
13178172Simp * 3. Neither the name of the author nor the names of contributors
14178172Simp *    may be used to endorse or promote products derived from this software
15178172Simp *    without specific prior written permission.
16178172Simp *
17178172Simp * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18178172Simp * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19178172Simp * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20178172Simp * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21178172Simp * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22178172Simp * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23178172Simp * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24178172Simp * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25178172Simp * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26178172Simp * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27178172Simp * SUCH DAMAGE.
28178172Simp *
29178172Simp *	from: src/sys/i386/include/md_var.h,v 1.35 2000/02/20 20:51:23 bsd
30178172Simp *	JNPR: md_var.h,v 1.4 2006/10/16 12:30:34 katta
31178172Simp * $FreeBSD: head/sys/mips/include/md_var.h 214903 2010-11-07 03:09:02Z gonzo $
32178172Simp */
33178172Simp
34178172Simp#ifndef _MACHINE_MD_VAR_H_
35178172Simp#define	_MACHINE_MD_VAR_H_
36178172Simp
37178172Simp#include <machine/reg.h>
38178172Simp
39178172Simp/*
40178172Simp * Miscellaneous machine-dependent declarations.
41178172Simp */
42202031Simpextern	long	Maxmem;
43178172Simpextern	char	sigcode[];
44178172Simpextern	int	szsigcode, szosigcode;
45214903Sgonzoextern	uint32_t *vm_page_dump;
46214903Sgonzoextern	int vm_page_dump_size;
47178172Simp
48178172Simpextern vm_offset_t kstack0;
49202909Sgonzoextern vm_offset_t kernel_kseg0_end;
50178172Simp
51178172Simpvoid	MipsSaveCurFPState(struct thread *);
52178172Simpvoid	fork_trampoline(void);
53178172Simpvoid	cpu_swapin(struct proc *);
54202031Simpuintptr_t MipsEmulateBranch(struct trapframe *, uintptr_t, int, uintptr_t);
55202031Simpvoid MipsSwitchFPState(struct thread *, struct trapframe *);
56178172Simpu_long	kvtop(void *addr);
57212777Sneelint	is_cacheable_mem(vm_offset_t addr);
58202830Simpvoid	mips_generic_reset(void);
59178172Simp
60178172Simp#define	MIPS_DEBUG   0
61178172Simp
62178172Simp#if MIPS_DEBUG
63178172Simp#define	MIPS_DEBUG_PRINT(fmt, args...)	printf("%s: " fmt "\n" , __FUNCTION__ , ## args)
64178172Simp#else
65178172Simp#define	MIPS_DEBUG_PRINT(fmt, args...)
66178172Simp#endif
67178172Simp
68178172Simpvoid	mips_vector_init(void);
69178172Simpvoid	mips_cpu_init(void);
70202031Simpvoid	mips_pcpu0_init(void);
71178172Simpvoid	mips_proc0_init(void);
72202909Sgonzovoid	mips_postboot_fixup(void);
73178172Simp
74178172Simp/* Platform call-downs. */
75178172Simpvoid	platform_identify(void);
76178172Simp
77202031Simpextern int busdma_swi_pending;
78212532Sjchandravoid	busdma_swi(void);
79214903Sgonzo
80214903Sgonzostruct dumperinfo;
81214903Sgonzovoid minidumpsys(struct dumperinfo *);
82178172Simp#endif /* !_MACHINE_MD_VAR_H_ */
83