summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1999-04-20 20:46:12 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1999-04-20 20:46:12 +0000
commit2deffdf6d40a070f2f6906da8d3beb5b56465b6d (patch)
tree4fec7571fede69fc3366bb7eeb5577cf6783a102 /sys
parente12099da70fac838dcbe8c7a7255ade4478285e4 (diff)
flesh out, who cares about single-step anyway
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/hppa/hppa/process_machdep.c54
1 files changed, 48 insertions, 6 deletions
diff --git a/sys/arch/hppa/hppa/process_machdep.c b/sys/arch/hppa/hppa/process_machdep.c
index b03cb93c0e3..03bdab8dd82 100644
--- a/sys/arch/hppa/hppa/process_machdep.c
+++ b/sys/arch/hppa/hppa/process_machdep.c
@@ -1,6 +1,38 @@
-/* $OpenBSD: process_machdep.c,v 1.1 1998/12/29 18:06:48 mickey Exp $ */
+/* $OpenBSD: process_machdep.c,v 1.2 1999/04/20 20:46:11 mickey Exp $ */
+
+/*
+ * Copyright (c) 1999 Michael Shalayeff
+ * 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 Michael Shalayeff.
+ * 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.
+ */
+
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/ptrace.h>
@@ -9,7 +41,9 @@ process_read_regs(p, regs)
struct proc *p;
struct reg *regs;
{
- return EINVAL;
+ bcopy (p->p_md.md_regs, regs, sizeof(*regs));
+ regs->r_regs[0] = 0;
+ return 0;
}
int
@@ -17,7 +51,8 @@ process_write_regs(p, regs)
struct proc *p;
struct reg *regs;
{
- return EINVAL;
+ bcopy (&regs[1], &p->p_md.md_regs->tf_r1, sizeof(*regs) - sizeof(*regs));
+ return 0;
}
int
@@ -25,7 +60,8 @@ process_read_fpregs(p, fpregs)
struct proc *p;
struct fpreg *fpregs;
{
- return EINVAL;
+ bcopy (p->p_md.md_regs->tf_fpregs, fpregs, sizeof(*fpregs));
+ return 0;
}
int
@@ -33,7 +69,8 @@ process_write_fpregs(p, fpregs)
struct proc *p;
struct fpreg *fpregs;
{
- return EINVAL;
+ bcopy (fpregs, p->p_md.md_regs->tf_fpregs, sizeof(*fpregs));
+ return 0;
}
int
@@ -41,6 +78,7 @@ process_sstep(p, sstep)
struct proc *p;
int sstep;
{
+ /* TODO */
return EINVAL;
}
@@ -49,5 +87,9 @@ process_set_pc(p, addr)
struct proc *p;
caddr_t addr;
{
- return EINVAL;
+ if (!USERMODE(addr)) /* XXX */
+ return EINVAL;
+ p->p_md.md_regs->tf_iioq_head = (register_t)addr;
+ return 0;
}
+