machsystm.h revision ae115bc77f6fcde83175c75b4206dc2e50747966
2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A
2N/A/*
2N/A * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
2N/A * Use is subject to license terms.
2N/A */
2N/A
2N/A#ifndef _SYS_MACHSYSTM_H
2N/A#define _SYS_MACHSYSTM_H
2N/A
2N/A#pragma ident "%Z%%M% %I% %E% SMI"
2N/A
2N/A/*
2N/A * Numerous platform-dependent interfaces that don't seem to belong
2N/A * in any other header file.
2N/A *
2N/A * This file should not be included by code that purports to be
2N/A * platform-independent.
2N/A *
2N/A */
2N/A
2N/A#include <sys/machparam.h>
2N/A#include <sys/varargs.h>
2N/A#include <sys/thread.h>
2N/A#include <sys/cpuvar.h>
2N/A#include <sys/privregs.h>
2N/A#include <sys/systm.h>
2N/A#include <sys/traptrace.h>
2N/A#include <vm/page.h>
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/A#ifdef _KERNEL
2N/A
2N/Aextern void mach_cpu_idle(void);
2N/Aextern void mach_cpu_halt(char *);
2N/Aextern int mach_cpu_start(cpu_t *, void *);
2N/A
2N/Aextern int Cpudelay;
2N/Aextern void setcpudelay(void);
2N/A
2N/Aextern void send_dirint(int, int);
2N/Aextern void siron(void);
2N/A
2N/Aextern void return_instr(void);
2N/A
2N/Aextern int kcpc_hw_load_pcbe(void);
2N/Aextern void kcpc_hw_init(cpu_t *cp);
2N/Aextern void kcpc_hw_fini(cpu_t *cp);
2N/Aextern int kcpc_hw_overflow_intr_installed;
2N/A
2N/Astruct memconf {
2N/A pfn_t mcf_spfn; /* begin page frame number */
2N/A pfn_t mcf_epfn; /* end page frame number */
2N/A};
2N/A
2N/Astruct system_hardware {
2N/A int hd_nodes; /* number of nodes */
2N/A int hd_cpus_per_node; /* max cpus in a node */
2N/A struct memconf hd_mem[MAXNODES];
2N/A /*
2N/A * memory layout for each
2N/A * node.
2N/A */
2N/A};
2N/Aextern struct system_hardware system_hardware;
2N/Aextern void get_system_configuration(void);
2N/Aextern void mmu_init(void);
2N/Aextern int cpuid2nodeid(int);
2N/Aextern void map_kaddr(caddr_t, pfn_t, int, int);
2N/A
2N/Aextern void memscrub_init(void);
2N/Aextern void trap(struct regs *, caddr_t, processorid_t);
2N/A
2N/Aextern void do_interrupt(struct regs *, trap_trace_rec_t *);
2N/Aextern void memscrub_disable(void);
2N/A
2N/Aextern unsigned int microdata;
2N/Aextern int use_mp;
2N/A
2N/Aextern struct cpu cpus[]; /* pointer to other cpus */
2N/Aextern struct cpu *cpu[]; /* pointer to all cpus */
2N/A
2N/Aextern int mach_cpucontext_init(void);
2N/Aextern void mach_cpucontext_fini(void);
2N/Aextern void *mach_cpucontext_alloc(struct cpu *);
2N/Aextern void mach_cpucontext_free(struct cpu *, void *, int);
2N/A
2N/Aextern uintptr_t hole_start, hole_end;
2N/A
2N/A#define INVALID_VADDR(a) \
2N/A (((a) >= (caddr_t)hole_start && (a) < (caddr_t)hole_end))
2N/A
2N/A/* kpm mapping window */
2N/Aextern size_t kpm_size;
2N/Aextern uchar_t kpm_size_shift;
2N/Aextern caddr_t kpm_vbase;
2N/A
2N/Astruct memlist;
2N/Aextern void memlist_add(uint64_t, uint64_t, struct memlist *,
2N/A struct memlist **);
2N/Aextern page_t *page_get_physical(uintptr_t);
2N/A
2N/A#endif /* _KERNEL */
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _SYS_MACHSYSTM_H */
2N/A