prmachdep.c 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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/privregs.h>
#include <sys/sysmacros.h>
#include <sys/debugreg.h>
#include <sys/archsystm.h>
#include <vm/seg_kmem.h>
/*
* Force a thread into the kernel if it is not already there.
* This is a no-op on uniprocessors.
*/
/* ARGSUSED */
void
{
}
/*
* Return general registers.
*/
void
{
}
/*
* Set general registers.
* (Note: This can be an alias to setgregs().)
*/
void
{
if (initial) /* set initial values */
}
#ifdef _SYSCALL32_IMPL
/*
* Convert prgregset32 to native prgregset
*/
void
{
}
/*
* Return 32-bit general registers
*/
void
{
}
#endif /* _SYSCALL32_IMPL */
/*
* Get the syscall return values for the lwp.
*/
int
{
return (r->r_r0);
*rval1 = 0;
*rval2 = 0;
/*
* XX64 Not sure we -really- need to do this, because the
* syscall return already masks off the bottom values ..?
*/
} else {
}
return (0);
}
/*
* Does the system support floating-point, either through hardware
* or by trapping and emulating floating-point machine instructions?
*/
int
prhasfp(void)
{
extern int fp_kind;
}
/*
* Get floating-point registers.
*/
void
{
}
#if defined(_SYSCALL32_IMPL)
void
{
}
#endif /* _SYSCALL32_IMPL */
/*
* Set floating-point registers.
* (Note: This can be an alias to setfpregs().)
*/
void
{
}
#if defined(_SYSCALL32_IMPL)
void
{
}
#endif /* _SYSCALL32_IMPL */
/*
* Does the system support extra register state?
*/
/* ARGSUSED */
int
{
return (0);
}
/*
* Get the size of the extra registers.
*/
/* ARGSUSED */
int
{
return (0);
}
/*
* Get extra registers.
*/
/*ARGSUSED*/
void
{
/* no extra registers */
}
/*
* Set extra registers.
*/
/*ARGSUSED*/
void
{
/* no extra registers */
}
/*
* Return the base (lower limit) of the process stack.
*/
prgetstackbase(proc_t *p)
{
return (p->p_usrstack - p->p_stksize);
}
/*
* Return the "addr" field for pr_addr in prpsinfo_t.
* This is a vestige of the past, so whatever we return is OK.
*/
prgetpsaddr(proc_t *p)
{
return ((caddr_t)p);
}
/*
* Arrange to single-step the lwp.
*/
void
{
if (watchstep)
else
}
/*
* Undo prstep().
*/
void
{
}
/*
* Return non-zero if a single-step is in effect.
*/
int
{
}
/*
* Set the PC to the specified virtual address.
*/
void
{
}
/*
* Map address "addr" in address space "as" into a kernel virtual address.
* The memory is guaranteed to be resident and locked down.
*/
{
/*
* XXX - Because of past mistakes, we have bits being returned
* by getpfnum that are actually the page type bits of the pte.
* When the object we are trying to map is a memory page with
* a page structure everything is ok and we can use the optimal
* method, ppmapin. Otherwise, we have to do something special.
*/
if (pf_is_memory(pfnum)) {
}
}
/*
* Oh well, we didn't have a page struct for the object we were
* trying to map in; ppmapin doesn't handle devices, but allocating a
* heap address allows ppmapout to free virtual space when done.
*/
}
/*
* Unmap address "addr" in address space "as"; inverse of prmapin().
*/
/* ARGSUSED */
void
{
}
/*
* Make sure the lwp is in an orderly state
* for inspection by a debugger through /proc.
* Called from stop() and from syslwp_create().
*/
/* ARGSUSED */
void
{
/*
* Make sure we don't deadlock on a recursive call
* to prstop(). stop() tests the lwp_nostop flag.
*/
else {
}
(void) save_syscall_args();
lwp->lwp_nostop = 0;
}
/*
* Fetch the user-level instruction on which the lwp is stopped.
* It was saved by the lwp itself, in prstop().
* Return non-zero if the instruction is valid.
*/
int
{
}
/*
* Called from trap() when a load or store instruction
* falls in a watched page but is not a watchpoint.
* We emulate the instruction in the kernel.
*/
/* ARGSUSED */
int
{
#ifdef SOMEDAY
int res;
int mapped;
/* prevent recursive calls to pr_watch_emul() */
if (res == SIMU_SUCCESS) {
/* adjust the pc */
return (1);
}
#endif
return (0);
}
/*
* Return the number of active entries in the local descriptor table.
*/
int
{
int limit, i, n;
/*
* Currently 64 bit processes cannot have a private ldt.
*/
return (0);
n = 0;
limit = p->p_ldtlimit;
/*
* Count all present user descriptors.
*/
n++;
return (n);
}
/*
* Fetch the active entries from the local descriptor table.
*/
void
{
int i, limit;
return;
limit = p->p_ldtlimit;
/*
* All present user descriptors.
*/
}