ANSI'ify, and inline userret().

This commit is contained in:
thorpej 2001-01-03 22:15:38 +00:00
parent 09ffed2ba0
commit 33338b633a
11 changed files with 235 additions and 255 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_syscall.c,v 1.3 2000/12/14 18:44:20 mycroft Exp $ */
/* $NetBSD: linux_syscall.c,v 1.4 2001/01/03 22:15:38 thorpej Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -101,7 +101,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.3 2000/12/14 18:44:20 mycroft Exp $");
__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.4 2001/01/03 22:15:38 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -118,6 +118,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.3 2000/12/14 18:44:20 mycroft Ex
#include <machine/cpu.h>
#include <machine/reg.h>
#include <machine/alpha.h>
#include <machine/userret.h>
#include <compat/linux/common/linux_types.h>
#include <compat/linux/common/linux_errno.h>
@ -126,14 +127,12 @@ __KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.3 2000/12/14 18:44:20 mycroft Ex
#include <compat/linux/common/linux_siginfo.h>
#include <compat/linux/arch/alpha/linux_machdep.h>
void userret __P((struct proc *));
void linux_syscall_intern __P((struct proc *));
void linux_syscall_plain __P((struct proc *, u_int64_t, struct trapframe *));
void linux_syscall_fancy __P((struct proc *, u_int64_t, struct trapframe *));
void linux_syscall_intern(struct proc *);
void linux_syscall_plain(struct proc *, u_int64_t, struct trapframe *);
void linux_syscall_fancy(struct proc *, u_int64_t, struct trapframe *);
void
linux_syscall_intern(p)
struct proc *p;
linux_syscall_intern(struct proc *p)
{
#ifdef KTRACE
@ -158,10 +157,7 @@ linux_syscall_intern(p)
* a3, and v0 from the frame before returning to the user process.
*/
void
linux_syscall_plain(p, code, framep)
struct proc *p;
u_int64_t code;
struct trapframe *framep;
linux_syscall_plain(struct proc *p, u_int64_t code, struct trapframe *framep)
{
const struct sysent *callp;
int error;
@ -252,10 +248,7 @@ linux_syscall_plain(p, code, framep)
}
void
linux_syscall_fancy(p, code, framep)
struct proc *p;
u_int64_t code;
struct trapframe *framep;
linux_syscall_fancy(struct proc *p, u_int64_t code, struct trapframe *framep)
{
const struct sysent *callp;
int error;

View File

@ -1,4 +1,4 @@
/* $NetBSD: osf1_syscall.c,v 1.3 2000/12/14 18:44:20 mycroft Exp $ */
/* $NetBSD: osf1_syscall.c,v 1.4 2001/01/03 22:15:38 thorpej Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -101,7 +101,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: osf1_syscall.c,v 1.3 2000/12/14 18:44:20 mycroft Exp $");
__KERNEL_RCSID(0, "$NetBSD: osf1_syscall.c,v 1.4 2001/01/03 22:15:38 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -118,19 +118,18 @@ __KERNEL_RCSID(0, "$NetBSD: osf1_syscall.c,v 1.3 2000/12/14 18:44:20 mycroft Exp
#include <machine/cpu.h>
#include <machine/reg.h>
#include <machine/alpha.h>
#include <machine/userret.h>
#include <compat/osf1/osf1.h>
#include <compat/osf1/osf1_cvt.h>
#include <compat/osf1/osf1_syscall.h>
void userret __P((struct proc *));
void osf1_syscall_intern __P((struct proc *));
void osf1_syscall_plain __P((struct proc *, u_int64_t, struct trapframe *));
void osf1_syscall_fancy __P((struct proc *, u_int64_t, struct trapframe *));
void osf1_syscall_intern(struct proc *);
void osf1_syscall_plain(struct proc *, u_int64_t, struct trapframe *);
void osf1_syscall_fancy(struct proc *, u_int64_t, struct trapframe *);
void
osf1_syscall_intern(p)
struct proc *p;
osf1_syscall_intern(struct proc *p)
{
#ifdef KTRACE
@ -155,10 +154,7 @@ osf1_syscall_intern(p)
* a3, and v0 from the frame before returning to the user process.
*/
void
osf1_syscall_plain(p, code, framep)
struct proc *p;
u_int64_t code;
struct trapframe *framep;
osf1_syscall_plain(struct proc *p, u_int64_t code, struct trapframe *framep)
{
const struct sysent *callp;
int error;
@ -249,10 +245,7 @@ osf1_syscall_plain(p, code, framep)
}
void
osf1_syscall_fancy(p, code, framep)
struct proc *p;
u_int64_t code;
struct trapframe *framep;
osf1_syscall_fancy(struct proc *p, u_int64_t code, struct trapframe *framep)
{
const struct sysent *callp;
int error;

View File

@ -1,4 +1,4 @@
/* $NetBSD: process_machdep.c,v 1.15 2000/11/22 08:39:50 thorpej Exp $ */
/* $NetBSD: process_machdep.c,v 1.16 2001/01/03 22:15:38 thorpej Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@ -54,7 +54,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.15 2000/11/22 08:39:50 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.16 2001/01/03 22:15:38 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -74,9 +74,7 @@ __KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.15 2000/11/22 08:39:50 thorpej
#define process_fpframe(p) (&(process_pcb(p)->pcb_fp))
int
process_read_regs(p, regs)
struct proc *p;
struct reg *regs;
process_read_regs(struct proc *p, struct reg *regs)
{
frametoreg(process_frame(p), regs);
@ -86,9 +84,7 @@ process_read_regs(p, regs)
}
int
process_write_regs(p, regs)
struct proc *p;
struct reg *regs;
process_write_regs(struct proc *p, struct reg *regs)
{
regtoframe(regs, process_frame(p));
@ -98,9 +94,7 @@ process_write_regs(p, regs)
}
int
process_sstep(p, sstep)
struct proc *p;
int sstep;
process_sstep(struct proc *p, int sstep)
{
if (sstep)
@ -110,9 +104,7 @@ process_sstep(p, sstep)
}
int
process_set_pc(p, addr)
struct proc *p;
caddr_t addr;
process_set_pc(struct proc *p, caddr_t addr)
{
struct trapframe *frame = process_frame(p);
@ -121,9 +113,7 @@ process_set_pc(p, addr)
}
int
process_read_fpregs(p, regs)
struct proc *p;
struct fpreg *regs;
process_read_fpregs(struct proc *p, struct fpregs *regs)
{
if (p->p_addr->u_pcb.pcb_fpcpu != NULL)
@ -134,9 +124,7 @@ process_read_fpregs(p, regs)
}
int
process_write_fpregs(p, regs)
struct proc *p;
struct fpreg *regs;
process_write_fpregs(struct proc *p, struct fpregs *regs)
{
if (p->p_addr->u_pcb.pcb_fpcpu != NULL)

View File

@ -1,4 +1,4 @@
/* $NetBSD: prom.c,v 1.40 2000/06/29 09:02:55 mrg Exp $ */
/* $NetBSD: prom.c,v 1.41 2001/01/03 22:15:38 thorpej Exp $ */
/*
* Copyright (c) 1992, 1994, 1995, 1996 Carnegie Mellon University
@ -27,7 +27,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: prom.c,v 1.40 2000/06/29 09:02:55 mrg Exp $");
__KERNEL_RCSID(0, "$NetBSD: prom.c,v 1.41 2001/01/03 22:15:38 thorpej Exp $");
#include "opt_multiprocessor.h"
@ -62,10 +62,9 @@ struct simplelock prom_slock;
int prom_mapped = 1; /* Is PROM still mapped? */
pt_entry_t prom_pte, saved_pte[1]; /* XXX */
static pt_entry_t *prom_lev1map __P((void));
static pt_entry_t *
prom_lev1map()
prom_lev1map(void)
{
struct alpha_pcb *apcb;
@ -79,8 +78,7 @@ prom_lev1map()
#endif /* _PMAP_MAY_USE_PROM_CONSOLE */
void
init_prom_interface(rpb)
struct rpb *rpb;
init_prom_interface(struct rpb *rpb)
{
struct crb *c;
@ -93,7 +91,7 @@ init_prom_interface(rpb)
}
void
init_bootstrap_console()
init_bootstrap_console(void)
{
char buf[4];
@ -107,11 +105,11 @@ init_bootstrap_console()
}
#ifdef _PMAP_MAY_USE_PROM_CONSOLE
static void prom_cache_sync __P((void));
static void prom_cache_sync(void);
#endif
int
prom_enter()
prom_enter(void)
{
int s;
@ -141,8 +139,7 @@ prom_enter()
}
void
prom_leave(s)
int s;
prom_leave(int s)
{
#ifdef _PMAP_MAY_USE_PROM_CONSOLE
@ -167,7 +164,7 @@ prom_leave(s)
#ifdef _PMAP_MAY_USE_PROM_CONSOLE
static void
prom_cache_sync __P((void))
prom_cache_sync(void)
{
ALPHA_TBIA();
alpha_pal_imb();
@ -185,9 +182,7 @@ prom_cache_sync __P((void))
* of the console area.
*/
void
promcnputc(dev, c)
dev_t dev;
int c;
promcnputc(dev_t dev, int c)
{
prom_return_t ret;
unsigned char *to = (unsigned char *)0x20000000;
@ -209,8 +204,7 @@ promcnputc(dev, c)
* Wait for the prom to get a real char and pass it back.
*/
int
promcngetc(dev)
dev_t dev;
promcngetc(dev_t dev)
{
prom_return_t ret;
int s;
@ -230,9 +224,7 @@ promcngetc(dev)
* See if prom has a real char and pass it back.
*/
int
promcnlookc(dev, cp)
dev_t dev;
char *cp;
promcnlookc(dev_t dev, char *cp)
{
prom_return_t ret;
int s;
@ -248,9 +240,7 @@ promcnlookc(dev, cp)
}
int
prom_getenv(id, buf, len)
int id, len;
char *buf;
prom_getenv(int id, char *buf, int len)
{
unsigned char *to = (unsigned char *)0x20000000;
prom_return_t ret;
@ -269,8 +259,7 @@ prom_getenv(id, buf, len)
}
void
prom_halt(halt)
int halt;
prom_halt(int halt)
{
struct pcs *p;
@ -297,7 +286,7 @@ prom_halt(halt)
}
u_int64_t
hwrpb_checksum()
hwrpb_checksum(void)
{
u_int64_t *p, sum;
int i;
@ -311,7 +300,7 @@ hwrpb_checksum()
}
void
hwrpb_primary_init()
hwrpb_primary_init(void)
{
struct pcs *p;
@ -326,7 +315,7 @@ hwrpb_primary_init()
}
void
hwrpb_restart_setup()
hwrpb_restart_setup(void)
{
struct pcs *p;
@ -344,8 +333,7 @@ hwrpb_restart_setup()
}
u_int64_t
console_restart(framep)
struct trapframe *framep;
console_restart(struct trapframe *framep)
{
struct pcs *p;

View File

@ -1,4 +1,4 @@
/* $NetBSD: promcons.c,v 1.16 2000/11/02 00:26:36 eeh Exp $ */
/* $NetBSD: promcons.c,v 1.17 2001/01/03 22:15:38 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@ -29,7 +29,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: promcons.c,v 1.16 2000/11/02 00:26:36 eeh Exp $");
__KERNEL_RCSID(0, "$NetBSD: promcons.c,v 1.17 2001/01/03 22:15:38 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -57,17 +57,14 @@ __KERNEL_RCSID(0, "$NetBSD: promcons.c,v 1.16 2000/11/02 00:26:36 eeh Exp $");
static struct tty *prom_tty[1];
static int polltime;
void promstart __P((struct tty *));
void promtimeout __P((void *));
int promparam __P((struct tty *, struct termios *));
void promstart(struct tty *);
void promtimeout(void *);
int promparam(struct tty *, struct termios *);
struct callout prom_ch = CALLOUT_INITIALIZER;
int
promopen(dev, flag, mode, p)
dev_t dev;
int flag, mode;
struct proc *p;
promopen(dev_t dev, int flag, int mode, struct proc *p)
{
int unit = minor(dev);
struct tty *tp;
@ -117,10 +114,7 @@ promopen(dev, flag, mode, p)
}
int
promclose(dev, flag, mode, p)
dev_t dev;
int flag, mode;
struct proc *p;
promclose(dev_t dev, int flag, int mode, struct proc *p)
{
int unit = minor(dev);
struct tty *tp = prom_tty[unit];
@ -132,10 +126,7 @@ promclose(dev, flag, mode, p)
}
int
promread(dev, uio, flag)
dev_t dev;
struct uio *uio;
int flag;
promread(dev_t dev, struct uio *uio, int flag)
{
struct tty *tp = prom_tty[minor(dev)];
@ -143,10 +134,7 @@ promread(dev, uio, flag)
}
int
promwrite(dev, uio, flag)
dev_t dev;
struct uio *uio;
int flag;
promwrite(dev_t dev, struct uio *uio, int flag)
{
struct tty *tp = prom_tty[minor(dev)];
@ -154,12 +142,7 @@ promwrite(dev, uio, flag)
}
int
promioctl(dev, cmd, data, flag, p)
dev_t dev;
u_long cmd;
caddr_t data;
int flag;
struct proc *p;
promioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
{
int unit = minor(dev);
struct tty *tp = prom_tty[unit];
@ -176,17 +159,14 @@ promioctl(dev, cmd, data, flag, p)
}
int
promparam(tp, t)
struct tty *tp;
struct termios *t;
promparam(struct tty *tp, struct termios *t)
{
return 0;
}
void
promstart(tp)
struct tty *tp;
promstart(struct tty *tp)
{
int s;
@ -212,8 +192,7 @@ out:
* Stop output on a line.
*/
void
promstop(tp, flag)
struct tty *tp;
promstop(struct tty *tp, int flag)
{
int s;
@ -225,8 +204,7 @@ promstop(tp, flag)
}
void
promtimeout(v)
void *v;
promtimeout(void *v)
{
struct tty *tp = v;
u_char c;
@ -239,8 +217,7 @@ promtimeout(v)
}
struct tty *
promtty(dev)
dev_t dev;
promtty(dev_t dev)
{
if (minor(dev) != 0)

View File

@ -1,4 +1,4 @@
/* $NetBSD: support.c,v 1.7 1997/09/02 13:18:37 thorpej Exp $ */
/* $NetBSD: support.c,v 1.8 2001/01/03 22:15:38 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@ -29,7 +29,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: support.c,v 1.7 1997/09/02 13:18:37 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: support.c,v 1.8 2001/01/03 22:15:38 thorpej Exp $");
/*
* Some C support functions that aren't (yet) in libkern or assembly.
@ -44,9 +44,7 @@ struct qelem {
};
void
_insque(entry, pred)
void *entry;
void *pred;
_insque(void *entry, void *pred)
{
struct qelem *e = (struct qelem *) entry;
struct qelem *p = (struct qelem *) pred;
@ -58,8 +56,7 @@ _insque(entry, pred)
}
void
_remque(element)
void *element;
_remque(void *element)
{
struct qelem *e = (struct qelem *) element;
e->q_forw->q_back = e->q_back;

View File

@ -1,4 +1,4 @@
/* $NetBSD: sys_machdep.c,v 1.11 2000/02/26 18:53:10 thorpej Exp $ */
/* $NetBSD: sys_machdep.c,v 1.12 2001/01/03 22:15:38 thorpej Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -65,7 +65,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.11 2000/02/26 18:53:10 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.12 2001/01/03 22:15:38 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -80,16 +80,13 @@ __KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.11 2000/02/26 18:53:10 thorpej Exp
u_int alpha_bus_window_count[ALPHA_BUS_TYPE_MAX + 1];
int (*alpha_bus_get_window) __P((int, int,
struct alpha_bus_space_translation *));
int (*alpha_bus_get_window)(int, int,
struct alpha_bus_space_translation *);
struct alpha_pci_chipset *alpha_pci_chipset;
int
sys_sysarch(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
sys_sysarch(struct proc *p, void *v, register_t *retval)
{
struct sys_sysarch_args /* {
syscallarg(int) op;

View File

@ -1,4 +1,4 @@
/* $NetBSD: syscall.c,v 1.2 2000/12/13 07:53:58 mycroft Exp $ */
/* $NetBSD: syscall.c,v 1.3 2001/01/03 22:15:38 thorpej Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -99,7 +99,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.2 2000/12/13 07:53:58 mycroft Exp $");
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.3 2001/01/03 22:15:38 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -116,15 +116,14 @@ __KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.2 2000/12/13 07:53:58 mycroft Exp $");
#include <machine/cpu.h>
#include <machine/reg.h>
#include <machine/alpha.h>
#include <machine/userret.h>
void userret __P((struct proc *));
void syscall_intern __P((struct proc *));
void syscall_plain __P((struct proc *, u_int64_t, struct trapframe *));
void syscall_fancy __P((struct proc *, u_int64_t, struct trapframe *));
void syscall_intern(struct proc *);
void syscall_plain(struct proc *, u_int64_t, struct trapframe *);
void syscall_fancy(struct proc *, u_int64_t, struct trapframe *);
void
syscall_intern(p)
struct proc *p;
syscall_intern(struct proc *p)
{
#ifdef KTRACE
@ -149,10 +148,7 @@ syscall_intern(p)
* a3, and v0 from the frame before returning to the user process.
*/
void
syscall_plain(p, code, framep)
struct proc *p;
u_int64_t code;
struct trapframe *framep;
syscall_plain(struct proc *p, u_int64_t code, struct trapframe *framep)
{
const struct sysent *callp;
int error;
@ -246,10 +242,7 @@ syscall_plain(p, code, framep)
}
void
syscall_fancy(p, code, framep)
struct proc *p;
u_int64_t code;
struct trapframe *framep;
syscall_fancy(struct proc *p, u_int64_t code, struct trapframe *framep)
{
const struct sysent *callp;
int error;
@ -357,8 +350,7 @@ syscall_fancy(p, code, framep)
* Process the tail end of a fork() for the child.
*/
void
child_return(arg)
void *arg;
child_return(void *arg)
{
struct proc *p = arg;

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.65 2000/12/13 03:16:37 mycroft Exp $ */
/* $NetBSD: trap.c,v 1.66 2001/01/03 22:15:38 thorpej Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -100,7 +100,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.65 2000/12/13 03:16:37 mycroft Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.66 2001/01/03 22:15:38 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -119,30 +119,17 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.65 2000/12/13 03:16:37 mycroft Exp $");
#include <machine/db_machdep.h>
#endif
#include <alpha/alpha/db_instruction.h> /* for handle_opdec() */
#include <machine/userret.h>
void userret __P((struct proc *));
unsigned long Sfloat_to_reg __P((unsigned int));
unsigned int reg_to_Sfloat __P((unsigned long));
unsigned long Tfloat_reg_cvt __P((unsigned long));
#ifdef FIX_UNALIGNED_VAX_FP
unsigned long Ffloat_to_reg __P((unsigned int));
unsigned int reg_to_Ffloat __P((unsigned long));
unsigned long Gfloat_reg_cvt __P((unsigned long));
#endif
int unaligned_fixup __P((unsigned long, unsigned long,
unsigned long, struct proc *));
int unaligned_fixup(unsigned long, unsigned long,
unsigned long, struct proc *);
int handle_opdec(struct proc *p, u_int64_t *ucodep);
static void printtrap __P((const unsigned long, const unsigned long,
const unsigned long, const unsigned long, struct trapframe *, int, int));
/*
* Initialize the trap vectors for the current processor.
*/
void
trap_init()
trap_init(void)
{
/*
@ -163,31 +150,9 @@ trap_init()
~(ALPHA_MCES_DSC|ALPHA_MCES_DPC));
}
/*
* Define the code needed before returning to user mode, for
* trap and syscall.
*/
void
userret(p)
register struct proc *p;
{
int sig;
/* Do any deferred user pmap operations. */
PMAP_USERRET(vm_map_pmap(&p->p_vmspace->vm_map));
/* take pending signals */
while ((sig = CURSIG(p)) != 0)
postsig(sig);
curcpu()->ci_schedstate.spc_curpriority = p->p_priority = p->p_usrpri;
}
static void
printtrap(a0, a1, a2, entry, framep, isfatal, user)
const unsigned long a0, a1, a2, entry;
struct trapframe *framep;
int isfatal, user;
printtrap(const u_long a0, const u_long a1, const u_long a2,
const u_long entry, struct trapframe *framep, int isfatal, int user)
{
char ubuf[64];
const char *entryname;
@ -246,9 +211,8 @@ printtrap(a0, a1, a2, entry, framep, isfatal, user)
*/
/*ARGSUSED*/
void
trap(a0, a1, a2, entry, framep)
const unsigned long a0, a1, a2, entry;
struct trapframe *framep;
trap(const u_long a0, const u_long a1, const u_long a2, const u_long entry,
struct trapframe *framep)
{
register struct proc *p;
register int i;
@ -610,8 +574,7 @@ dopanic:
* This is relatively easy.
*/
void
ast(framep)
struct trapframe *framep;
ast(struct trapframe *framep)
{
register struct proc *p;
@ -651,7 +614,7 @@ ast(framep)
* Unaligned access handler. It's not clear that this can get much slower...
*
*/
const static int reg_to_framereg[32] = {
static const int reg_to_framereg[32] = {
FRAME_V0, FRAME_T0, FRAME_T1, FRAME_T2,
FRAME_T3, FRAME_T4, FRAME_T5, FRAME_T6,
FRAME_T7, FRAME_S0, FRAME_S1, FRAME_S2,
@ -703,9 +666,8 @@ const static int reg_to_framereg[32] = {
dump_fp_regs(); \
unaligned_store(storage, frp, mod)
unsigned long
Sfloat_to_reg(s)
unsigned int s;
static unsigned long
Sfloat_to_reg(u_int s)
{
unsigned long sign, expn, frac;
unsigned long result;
@ -726,9 +688,8 @@ Sfloat_to_reg(s)
return (result);
}
unsigned int
reg_to_Sfloat(r)
unsigned long r;
static unsigned int
reg_to_Sfloat(u_long r)
{
unsigned long sign, expn, frac;
unsigned int result;
@ -748,18 +709,16 @@ reg_to_Sfloat(r)
* Conversion of T floating datums to and from register format
* requires no bit reordering whatsoever.
*/
unsigned long
Tfloat_reg_cvt(input)
unsigned long input;
static unsigned long
Tfloat_reg_cvt(u_long input)
{
return (input);
}
#ifdef FIX_UNALIGNED_VAX_FP
unsigned long
Ffloat_to_reg(f)
unsigned int f;
static unsigned long
Ffloat_to_reg(u_int f)
{
unsigned long sign, expn, frlo, frhi;
unsigned long result;
@ -779,9 +738,8 @@ Ffloat_to_reg(f)
return (result);
}
unsigned int
reg_to_Ffloat(r)
unsigned long r;
static unsigned int
reg_to_Ffloat(u_long r)
{
unsigned long sign, expn, frhi, frlo;
unsigned int result;
@ -802,9 +760,8 @@ reg_to_Ffloat(r)
* Conversion of G floating datums to and from register format is
* symmetrical. Just swap shorts in the quad...
*/
unsigned long
Gfloat_reg_cvt(input)
unsigned long input;
static unsigned long
Gfloat_reg_cvt(u_long input)
{
unsigned long a, b, c, d;
unsigned long result;
@ -836,9 +793,7 @@ struct unaligned_fixup_data {
#define NOFIX_ST(n,s) { n, 0, s, B_WRITE }
int
unaligned_fixup(va, opcode, reg, p)
unsigned long va, opcode, reg;
struct proc *p;
unaligned_fixup(u_long va, u_long opcode, u_long reg, struct proc *p)
{
const struct unaligned_fixup_data tab_unknown[1] = {
UNKNOWN(),
@ -1038,9 +993,7 @@ out:
* and fills in *ucodep with the code to be delivered.
*/
int
handle_opdec(p, ucodep)
struct proc *p;
u_int64_t *ucodep;
handle_opdec(struct proc *p, u_int64_t *ucodep)
{
alpha_instruction inst;
register_t *regptr, memaddr;

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_machdep.c,v 1.63 2000/11/22 08:39:51 thorpej Exp $ */
/* $NetBSD: vm_machdep.c,v 1.64 2001/01/03 22:15:39 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@ -29,7 +29,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.63 2000/11/22 08:39:51 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.64 2001/01/03 22:15:39 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -48,16 +48,12 @@ __KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.63 2000/11/22 08:39:51 thorpej Exp
#include <machine/pmap.h>
#include <machine/reg.h>
/*
* Dump the machine specific header information at the start of a core dump.
*/
int
cpu_coredump(p, vp, cred, chdr)
struct proc *p;
struct vnode *vp;
struct ucred *cred;
struct core *chdr;
cpu_coredump(struct proc *p, struct vnode *vp, struct ucred *cred,
struct core *chdr)
{
int error;
struct md_coredump cpustate;
@ -104,8 +100,7 @@ cpu_coredump(p, vp, cred, chdr)
* as if it were switching from proc0.
*/
void
cpu_exit(p)
struct proc *p;
cpu_exit(struct proc *p)
{
if (p->p_addr->u_pcb.pcb_fpcpu != NULL)
@ -142,12 +137,8 @@ cpu_exit(p)
* accordingly.
*/
void
cpu_fork(p1, p2, stack, stacksize, func, arg)
register struct proc *p1, *p2;
void *stack;
size_t stacksize;
void (*func) __P((void *));
void *arg;
cpu_fork(struct proc *p1, struct proc *p2, void *stack, size_t stacksize,
void (*func)(void *), void *arg)
{
struct user *up = p2->p_addr;
@ -236,8 +227,7 @@ cpu_fork(p1, p2, stack, stacksize, func, arg)
* swap context to it easily.
*/
void
cpu_swapin(p)
register struct proc *p;
cpu_swapin(struct proc *p)
{
struct user *up = p->p_addr;
@ -252,8 +242,7 @@ cpu_swapin(p)
* saved, so that it goes out with the pcb, which is in the user area.
*/
void
cpu_swapout(p)
struct proc *p;
cpu_swapout(struct proc *p)
{
if (p->p_addr->u_pcb.pcb_fpcpu != NULL)
@ -269,9 +258,7 @@ cpu_swapout(p)
* and mapped in, we can use the Virtual Page Table.
*/
void
pagemove(from, to, size)
register caddr_t from, to;
size_t size;
pagemove(caddr_t from, caddr_t to, size_t size)
{
long fidx, tidx;
ssize_t todo;
@ -305,9 +292,7 @@ pagemove(from, to, size)
* do not need to pass an access_type to pmap_enter().
*/
void
vmapbuf(bp, len)
struct buf *bp;
vsize_t len;
vmapbuf(struct buf *bp, vsize_t len)
{
vaddr_t faddr, taddr, off;
paddr_t pa;
@ -337,9 +322,7 @@ vmapbuf(bp, len)
* Unmap a previously-mapped user I/O request.
*/
void
vunmapbuf(bp, len)
struct buf *bp;
vsize_t len;
vunmapbuf(struct buf *bp, vsize_t len)
{
vaddr_t addr, off;

View File

@ -0,0 +1,119 @@
/* $NetBSD: userret.h,v 1.1 2001/01/03 22:15:39 thorpej Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
* NASA Ames Research Center, and by Charles M. Hannum.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Copyright (c) 1999 Christopher G. Demetriou. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Christopher G. Demetriou
* for the NetBSD Project.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
* All rights reserved.
*
* Author: Chris G. Demetriou
*
* Permission to use, copy, modify and distribute this software and
* its documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*/
#ifndef _ALPHA_USERRET_H_
#define _ALPHA_USERRET_H_
/*
* Define the code needed before returning to user mode, for
* trap and syscall.
*/
static __inline void
userret(struct proc *p)
{
int sig;
/* Do any deferred user pmap operations. */
PMAP_USERRET(vm_map_pmap(&p->p_vmspace->vm_map));
/* take pending signals */
while ((sig = CURSIG(p)) != 0)
postsig(sig);
curcpu()->ci_schedstate.spc_curpriority = p->p_priority = p->p_usrpri;
}
#endif /* _ALPHA_USERRET_H_ */