machsystm.h revision 89a8ba833ef2615d086ab2ae9deffa0a858ed398
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_MACHSYSTM_H
#define _SYS_MACHSYSTM_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Numerous platform-dependent interfaces that don't seem to belong
* in any other header file.
*
* This file should not be included by code that purports to be
* platform-independent.
*/
#ifndef _ASM
#include <sys/machparam.h>
#include <vm/seg_enum.h>
#include <sys/processor.h>
#endif /* _ASM */
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _KERNEL
#ifndef _ASM
/*
* The following enum types determine how interrupts are distributed
* on a sun4u system.
*/
enum intr_policies {
/*
* Target interrupt at the CPU running the add_intrspec
* thread. Also used to target all interrupts at the panicing
* CPU.
*/
INTR_CURRENT_CPU = 0,
/*
* Target all interrupts at the boot cpu
*/
/*
* Flat distribution of all interrupts
*/
/*
* Weighted distribution of all interrupts
*/
};
/*
* Structure that defines the interrupt distribution list. It contains
* enough info about the interrupt so that it can callback the parent
* nexus driver and retarget the interrupt to a different CPU.
*/
struct intr_dist {
void (*func)(void *); /* Callback function */
void *arg; /* Nexus parent callback arg 1 */
};
/*
* Miscellaneous cpu_state changes
*/
extern void power_down(const char *);
extern void do_shutdown(void);
/*
* Number of seconds until power is shut off
*/
extern int thermal_powerdown_delay;
/*
* prom-related
*/
extern int obpdebug;
extern int forthdebug_supported;
extern uint_t tba_taken_over;
extern void forthdebug_init(void);
extern void init_vx_handler(void);
extern void kern_preprom(void);
extern void kern_postprom(void);
/*
* externally (debugger or prom) initiated panic
*/
extern struct regs sync_reg_buf;
extern void sync_handler(void);
/*
* Trap-related
*/
struct regs;
extern void *get_tba(void);
extern void *set_tba(void *);
extern caddr_t set_trap_table(void);
extern struct scb trap_table;
struct trap_info {
};
/*
* misc. primitives
*/
extern void debug_flush_windows(void);
extern void flush_windows(void);
extern int getprocessorid(void);
extern void reestablish_curthread(void);
extern int pf_is_dmacapable(pfn_t);
extern void set_cmp_error_steering(void);
/*
* SPARCv9 %ver register and field definitions
*/
#define ULTRA_VER_MANUF(x) ((x) >> 48)
extern uint64_t ultra_getver(void);
/*
* bootup-time
*/
extern int ncpunode;
extern int niobus;
extern void segnf_init(void);
extern void kern_setup1(void);
extern void startup(void);
extern void post_startup(void);
extern void install_va_to_tte(void);
extern void create_va_to_tte(void);
extern int memscrub_init(void);
extern void kcpc_hw_init(void);
extern void kcpc_hw_startup_cpu(ushort_t);
extern int kcpc_hw_load_pcbe(void);
/*
* Interrupts
*/
struct cpu;
extern size_t intr_add_pools;
extern struct intr_req *intr_add_head;
extern struct intr_req *intr_add_tail;
extern void init_intr_threads(struct cpu *);
extern uint_t disable_vec_intr(void);
extern void enable_vec_intr(uint_t);
extern void setintrenable(int);
extern void intr_dist_add(void (*f)(void *), void *);
extern void intr_dist_rem(void (*f)(void *), void *);
extern uint32_t intr_dist_cpuid(void);
extern uint32_t intr_dist_mycpuid(void);
extern void intr_redist_all_cpus(void);
extern void intr_redist_all_cpus_shutdown(void);
extern void send_dirint(int, int);
extern void setsoftint(uint_t);
extern void siron(void);
extern void wr_clr_softint(uint_t);
/*
* Time- and %tick-related
*/
extern void tick_write_delta(uint64_t);
extern void tickcmpr_set(uint64_t);
extern void tickcmpr_reset(void);
extern void tickcmpr_disable(void);
extern int tickcmpr_disabled(void);
extern uint32_t cbe_level14_inum;
/*
* contiguous memory
*/
extern void *contig_mem_alloc(size_t);
extern void contig_mem_free(void *, size_t);
/*
* Caches
*/
extern int vac;
extern int cache;
extern int use_mp;
extern uint64_t ecache_flushaddr;
extern int ecache_alignsize; /* Maximum ecache linesize for struct align */
extern int ecache_setsize; /* Maximum ecache setsize possible */
extern int cpu_setsize; /* Maximum ecache setsize of configured cpus */
/*
* VM
*/
extern int do_pg_coloring;
extern int do_virtual_coloring;
extern int use_page_coloring;
extern int use_virtual_coloring;
extern uint_t vac_colors_mask;
extern caddr_t get_mmfsa_scratchpad(void);
extern void set_mmfsa_scratchpad(caddr_t);
extern int ndata_alloc_mmfsa(struct memlist *);
extern int ndata_alloc_cpus(struct memlist *);
extern int ndata_alloc_page_freelists(struct memlist *, int);
extern int ndata_alloc_dmv(struct memlist *);
extern size_t page_ctrs_sz(void);
extern void page_freelist_coalesce_all(int);
extern void ppmapinit(void);
extern void hwblkpagecopy(const void *, void *);
extern int pp_slots;
extern int pp_consistent_coloring;
/*
* ppcopy/hwblkpagecopy interaction. See ppage.c.
*/
/*
*/
extern int use_hw_bcopy;
extern uint_t hw_copy_limit_1;
extern uint_t hw_copy_limit_2;
extern uint_t hw_copy_limit_4;
extern uint_t hw_copy_limit_8;
extern int use_hw_bzero;
#ifdef CHEETAH
#define VIS_COPY_THRESHOLD 256
#else
#define VIS_COPY_THRESHOLD 900
#endif
/*
* MP
*/
extern void idle_other_cpus(void);
extern void resume_other_cpus(void);
extern void stop_other_cpus(void);
extern void idle_stop_xcall(void);
extern void set_idle_cpu(int);
extern void unset_idle_cpu(int);
extern void mp_cpu_quiesce(struct cpu *);
/*
* Panic at TL > 0
*/
extern void ptl1_init_cpu(struct cpu *);
/*
* Defines for DR interfaces
*/
typedef struct devi_branch {
void *arg;
int type;
union {
} create;
/*
* Prototypes which really belongs to sunddi.c, and should be moved to
* sunddi.c if there is another platform using these calls.
*/
/*
* Constants which define the "hole" in the 64-bit sfmmu address space.
* These are set to specific values by the CPU module code.
*/
/* kpm mapping window */
extern uchar_t kpm_size_shift;
extern void adjust_hw_copy_limits(int);
struct kdi;
void cpu_kdi_init(struct kdi *);
/*
* flush instruction and data caches
*/
void kdi_flush_caches(void);
struct async_flt;
/*
* take pending fp traps if fpq present
* this function is also defined in fpusystm.h
*/
void syncfpu(void);
void cpu_flush_ecache(void);
void cpu_faulted_enter(struct cpu *);
void cpu_faulted_exit(struct cpu *);
/*
* ecache scrub operations
*/
void cpu_init_cache_scrub(void);
/*
*/
void cpu_init_tick_freq(void);
/*
* stick synchronization
*/
void sticksync_slave(void);
void sticksync_master(void);
#endif /* _ASM */
/*
* Actions for set_error_enable_tl1
*/
#define EER_SET_ABSOLUTE 0x0
#define EER_SET_SETBITS 0x1
#define EER_SET_CLRBITS 0x2
/*
* HVDUMP_SIZE_MAX set as 64k due to limitiation by intrq_alloc()
*/
#define HVDUMP_SIZE_MAX 0x10000
#define HVDUMP_SIZE_DEFAULT 0x8000
/*
* HV TOD service retry in usecs
*/
#define HV_TOD_RETRY_THRESH 100
#define HV_TOD_WAIT_USEC 5
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_MACHSYSTM_H */