84 lines
2.5 KiB
C
84 lines
2.5 KiB
C
/* @(#)pcb.h 1.1 94/10/31 SMI */
|
|
|
|
/*
|
|
* Copyright (c) 1985 by Sun Microsystems, Inc.
|
|
*/
|
|
|
|
#ifndef _sun4m_pcb_h
|
|
#define _sun4m_pcb_h
|
|
|
|
/*
|
|
* Sun software process control block
|
|
*/
|
|
|
|
#include <machine/reg.h>
|
|
|
|
#define MAXWIN 12 /* max number of windows currently supported */
|
|
|
|
/*
|
|
* The system actually supports one more than the above number.
|
|
* There is always one window reserved for trap handlers that
|
|
* never has to be saved into the pcb struct.
|
|
*/
|
|
|
|
#ifndef LOCORE
|
|
#include <machine/vm_hat.h>
|
|
struct pcb {
|
|
/*
|
|
* In order to keep the pcb the same size as what we shipped
|
|
* to customers in 4.1.2, there must be exactly one
|
|
* kilobyte of data in the structure before the pcb_regs
|
|
* field, and the structure must be otherwise identical to the
|
|
* standard version for the other SPARCs.
|
|
*
|
|
* If you mess this up, then all the unbundled products that
|
|
* were released based on the SunOS 4.1.2 MP release for the
|
|
* Sun-4M kernel archetecture must be recompiled and, more
|
|
* painfully, rereleased. So, you can't make that change until
|
|
* all those products -- including the "OnLine: Disk Suite" --
|
|
* have to be rereleased for other reasons (like SVr4 support).
|
|
*/
|
|
int pcb_pad[256]; /* pad to one kilobyte */
|
|
|
|
label_t pcb_regs; /* saved pc and sp */
|
|
int pcb_psr; /* processor status word */
|
|
int pcb_uwm; /* user window mask */
|
|
struct rwindow pcb_wbuf[MAXWIN]; /* user window save buffer */
|
|
char *pcb_spbuf[MAXWIN]; /* sp's for each wbuf */
|
|
int pcb_wbcnt; /* number of saved windows in pcb_wbuf */
|
|
|
|
int *pcb_psrp; /* psr pointer to en/disable coprocessors */
|
|
struct fpu *pcb_fpctxp; /* pointer to fpu state */
|
|
int pcb_fpflags; /* fpu enable flags */
|
|
int *pcb_cpctxp; /* pointer to coprocessor state */
|
|
int pcb_cpflags; /* coprocessor enable flags */
|
|
|
|
int pcb_flags; /* various state flags */
|
|
int pcb_wocnt; /* window overflow count */
|
|
int pcb_wucnt; /* window underflow count */
|
|
};
|
|
|
|
#define pcb_pc pcb_regs.val[0]
|
|
#define pcb_sp pcb_regs.val[1]
|
|
|
|
#define aston() {u.u_pcb.pcb_flags |= AST_SCHED; }
|
|
|
|
#define astoff() {u.u_pcb.pcb_flags &= ~AST_SCHED; }
|
|
|
|
#endif !LOCORE
|
|
|
|
/* pcb_flags */
|
|
#define AST_SCHED 0x80000000 /* force a reschedule */
|
|
#define AST_CLR 0x80000000
|
|
#define PME_CLR 0
|
|
#define AST_NONE 0
|
|
|
|
/* pcb_flags */
|
|
#define CLEAN_WINDOWS 0x1 /* keep user regs clean */
|
|
#define FIX_ALIGNMENT 0x2 /* fix unaligned references */
|
|
#define MM_SBUS_DEVS 0x4 /* mmap'd sbus dev(s) */
|
|
#define MM_VME_DEVS 0x8 /* mmap'd vme dev(s) */
|
|
#define MM_DEVS (MM_SBUS_DEVS | MM_VME_DEVS)
|
|
|
|
#endif /* !_sun4m_pcb_h */
|