cprboot.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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 1999-2002 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _CPRBOOT_H
#define _CPRBOOT_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* defs for sun4u cprboot
*/
/*
* select virt ranges well past _end;
* these ranges are used for tmp tlb entries
*
* CB_SRC_VIRT source statefile buffer pages
* CB_DST_VIRT destination kernel pages
* CB_STACK_VIRT new stack
* CB_HIGH_VIRT ...and above for the bitmap and co.
*/
#define CB_SRC_VIRT 0x200000
#define CB_DST_VIRT 0x300000
#define CB_STACK_VIRT 0x400000
#define CB_HIGH_VIRT 0x500000
/*
* master cpu and slave cpu stack sizes
* their sum should be (n * MMU_PAGESIZE)
*/
#define CB_MSS 0x009000
#define CB_SSS 0x001000
/*
* max number of tlb entries and tmp pages for
* src statefile buf pages and dst kernel pages
*/
#define ERR -1
#ifndef _ASM
#define CB_VPRINTF(args) \
#define NULLP (char *)0
/*
* info for handling statefile data
*/
struct statefile {
int fd; /* prom file handle */
int kpages; /* total number of kernel pages */
int npages; /* nubmer of pages restored */
int ngroups; /* number of page groups restored */
int outside; /* kpage is outside of buf range */
int precede; /* kpage preceeds buf offset */
int move; /* number of buf pages moved */
int recycle; /* free tmp page for reuse */
};
/*
* convert a statefile buffer byte-offset into a buffer ppn;
* buf_map starts out as an identity map, and gets updated as
* pages are moved; the original ppn can always be derived
* from the ORIG macro:
*/
/*
* next data in statefile buffer
*/
/*
* advance statefile buffer offset
*/
/*
* struct data is written to the statefile without any alignment
* handling; for easy access, struct data gets copied to aligned
* space and the buf data pointer is advanced
*/
/*
* structure of "available" property from /memory node
*/
struct prom_physavail {
};
struct avail_range {
};
typedef struct prom_physavail pphav_t;
typedef struct avail_range arange_t;
/*
* prom properties and data
*/
struct cb_props {
};
/*
*/
extern int cpr_reset_properties(void);
extern int cpr_locate_statefile(char *, char *);
/*
*/
extern char prog[];
extern char rsvp[];
extern char entry[];
extern char ent_fmt[];
extern int verbose;
/*
*/
extern int cpr_test_mode;
extern uint_t cb_clock_freq;
extern int cb_check_machdep(void);
extern int cb_interpret(void);
extern int cb_ksetup(void);
extern int cb_mpsetup(void);
extern void slave_init(int);
/*
* pages.c
*/
extern int cb_restore_kpages(void);
extern int cb_terminator(void);
/*
* bitmap.c
*/
extern int cb_nbitmaps;
extern pfn_t find_apage(void);
extern int cb_set_bitmap(void);
extern int cb_get_newstack(void);
extern int cb_tracking_setup(void);
extern int cb_get_physavail(void);
extern int cb_relocate(void);
/*
* util.c
*/
extern int cpr_statefile_open(char *, char *);
extern int cpr_statefile_close(int);
extern void cb_spin(void);
extern void install_remap(void);
extern int cb_get_props(void);
extern int cb_usb_setup(void);
extern void cb_enter_mon(void);
extern void cb_exit_to_mon(void);
/*
*/
extern void *estack;
extern void _start(void *, ...);
extern void exit_to_kernel(void *, csu_md_t *);
extern void cpu_launch(int);
extern void cb_usec_wait(int);
extern void membar_stld(void);
#endif /* !_ASM */
#ifdef __cplusplus
}
#endif
#endif /* _CPRBOOT_H */