/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_CPU_MODULE_H
#define _SYS_CPU_MODULE_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _KERNEL
/*
* The are functions that are expected of the cpu modules.
*/
extern struct module_ops *moduleops;
struct kdi;
/*
* module initialization
*/
void cpu_setup(void);
void cpu_kdi_init(struct kdi *);
/*
* set CPU implementation details
*
* set Panther CPU implementation details
*
* On Panther-only domains and Olympus-C, mmu_init_mmu_page_sizes
* changes the mmu_page_sizes variable from the default 4 page sizes
* to 6 page sizes and is called from fillsysinfo.c:check_cpus_set
* at early bootup time.
*/
void cpu_fix_allpanther(void);
void cpu_fix_alljupiter(void);
int mmu_init_mmu_page_sizes(int cinfo);
/*
* virtual demap flushes (tlbs & virtual tag caches)
*/
void vtag_flushall(void);
void vtag_flushall_uctxs(void);
/*
* virtual alias flushes (virtual address caches)
*/
/*
* sending x-calls
*/
void send_one_mondo(int cpuid);
#ifdef _MACHDEP
#endif
/*
* flag to support optimal dtlb pagesize setting, for ISM and mpss, to support
* cpus with non-fully-associative dtlbs. Page size is stored in hat sfmmu_cext
*/
extern uint_t cpu_impl_dual_pgsz;
/*
* flush instruction cache if needed
*/
/*
* flush instruction and data caches
*/
void kdi_flush_caches(void);
/*
* take pending fp traps if fpq present
* this function is also defined in fpusystm.h
*/
void syncfpu(void);
/*
* Cpu-specific error and ecache handling routines
*/
void ce_err(void);
void ce_err_tl1(void);
void async_err(void);
void cpu_flush_ecache(void);
void cpu_disable_errors(void);
/* It could be removed later if prom enables errors */
void cpu_enable_errors(void);
void cpu_faulted_enter(struct cpu *);
void cpu_faulted_exit(struct cpu *);
void cpu_ue_log_err(struct async_flt *);
int cpu_aflt_size(void);
void cpu_async_panic_callb(void);
/* Interfaces for getting memory-related information */
/*
* FMA Event Memory Routines
*
* The following routines are used by FMA Event generators to retrieve data
* to store in memory ereports. These routines may call through to platform-
* level interrupt context, or panic context. They may grab adaptive locks,
* but should not be allocating new data structures or calling cv_wait().
*/
/* add clr_datapath to aviod lint warning for ac_test.c temporarily */
void clr_datapath(void);
void itlb_parity_trap(void);
void dtlb_parity_trap(void);
/*
* FMA Protocol and error handling support routines
*/
void cpu_ereport_post(struct async_flt *);
void cpu_run_bus_error_handlers(struct async_flt *, int);
/*
* retrieve information from the specified tlb entry. these functions are
* called by "cpr" module
*/
/*
* this symbol appears as a second label for vtag_flushall
* only for cpus that implement DEMAP_ALL_TYPE
*/
/*
* change cpu speed
*/
/*
* ecache scrub operations
*/
void cpu_init_cache_scrub(void);
void cpu_idle_ecache_scrub(struct cpu *);
void cpu_busy_ecache_scrub(struct cpu *);
/*
* Cpu private initialize/uninitialize, including ecache scrubber.
*/
void cpu_init_private(struct cpu *);
void cpu_uninit_private(struct cpu *);
void cpu_mp_init(void);
void cpu_feature_init(void);
void cpu_early_feature_init(void);
void cpu_error_init(int);
/*
*/
void cpu_clearticknpt(void);
void cpu_init_tick_freq(void);
/*
* stick synchronization
*/
void sticksync_slave(void);
void sticksync_master(void);
/*
* flags for calling cpu_check_ce
*/
#define SCRUBBER_CEEN_CHECK 0
/*
* Check for Correctable Errors that may have occurred
* while CEEN was disabled.
*/
/* initialize kernel context pgsz codes in DMMU primary context register */
/* get large page size for kernel heap */
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_CPU_MODULE_H */