cpr_impl.h revision ae115bc77f6fcde83175c75b4206dc2e50747966
/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_CPR_IMPL_H
#define _SYS_CPR_IMPL_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _ASM
#include <sys/processor.h>
#include <sys/machparam.h>
/*
* This file contains machine dependent information for CPR
*/
/*
* Information about the pages allocated via prom_retain().
* Increase the number of CPR_PROM_RETAIN_CNT if more
* prom_retain() are called.
*/
#define CPR_PROM_RETAIN_CNT 1
#define CPR_PANICBUF 0 /* prom_retain() for panicbuf */
/*
* For 2.7 and later releases, sun4u cprboot is an ELF64 binary and must
* handle both ILP32 and LP64 kernels; while long and ptr sizes are fixed
* To simplify handling of statefile data, we define fixed-size types for
* all sun4u kernels.
*/
struct cpr_map_info {
};
#define CPR_MAX_TLB 16
struct sun4u_tlb {
int index; /* tlb index */
int tmp; /* clear during resume */
};
/*
* processor info
*/
struct sun4u_cpu_info {
};
/*
* This structure defines the fixed-length machine dependent data for
* sun4u ILP32 and LP64 systems. It is followed in the state file by
* a variable length section of null-terminated prom forth words:
*
* cpr_obp_tte_str for translating kernel mappings, unix-tte
*
* The total length (fixed plus variable) of the machine-dependent
* section is stored in cpr_machdep_desc.md_size
*
* WARNING: make sure all CPR_MD_* below match this structure
*/
struct cpr_sun4u_machdep {
int mmu_ctx_pri; /* 0x28: primary context */
int mmu_ctx_sec; /* 0x2c: secondary context */
int test_mode; /* 0x40 */
int pad; /* 0x44 */
};
typedef struct cpr_sun4u_machdep csu_md_t;
#endif /* _ASM */
/*
* XXX - these should be generated by a genassym,
*/
#define CPR_MD_KSB 0x00
#define CPR_MD_KPSTATE 0x04
#define CPR_MD_KWSTATE 0x06
#define CPR_MD_THRP 0x08
#define CPR_MD_FUNC 0x10
#define CPR_MD_QSAV_PC 0x18
#define CPR_MD_QSAV_SP 0x20
#define CPR_MD_PRI 0x28
#define CPR_MD_SEC 0x2c
#ifndef _ASM
#define CPRBOOT "-F cprboot"
return (-1); \
}
typedef u_longlong_t physaddr_t;
extern void i_cpr_machdep_setup(void);
extern void i_cpr_save_machdep_info(void);
extern void i_cpr_enable_intr(void);
extern void i_cpr_set_tbr(void);
extern void i_cpr_stop_intr(void);
extern void i_cpr_handle_xc(int);
extern void i_cpr_resume_setup(void *, csu_md_t *);
extern int i_cpr_write_machdep(vnode_t *);
extern int i_cpr_prom_pages(int);
extern int i_cpr_reuseinit(void);
extern int i_cpr_reusefini(void);
extern int i_cpr_check_cprinfo(void);
extern int i_cpr_reusable_supported(void);
#endif /* _ASM */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_CPR_IMPL_H */