Deleted Added
full compact
machdep.c (35076) machdep.c (36168)
1/*-
2 * Copyright (c) 1992 Terrence R. Lambert.
3 * Copyright (c) 1982, 1987, 1990 The Regents of the University of California.
4 * All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * William Jolitz.
8 *

--- 21 unchanged lines hidden (view full) ---

30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 *
37 * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
1/*-
2 * Copyright (c) 1992 Terrence R. Lambert.
3 * Copyright (c) 1982, 1987, 1990 The Regents of the University of California.
4 * All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * William Jolitz.
8 *

--- 21 unchanged lines hidden (view full) ---

30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 *
37 * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
38 * $Id: machdep.c,v 1.293 1998/03/23 19:52:32 jlemon Exp $
38 * $Id: machdep.c,v 1.294 1998/04/06 15:46:17 peter Exp $
39 */
40
41#include "apm.h"
42#include "npx.h"
43#include "opt_bounce.h"
44#include "opt_cpu.h"
45#include "opt_ddb.h"
46#include "opt_maxmem.h"

--- 69 unchanged lines hidden (view full) ---

116#ifdef PERFMON
117#include <machine/perfmon.h>
118#endif
119
120#include <i386/isa/isa_device.h>
121#include <i386/isa/intr_machdep.h>
122#include <i386/isa/rtc.h>
123#include <machine/random.h>
39 */
40
41#include "apm.h"
42#include "npx.h"
43#include "opt_bounce.h"
44#include "opt_cpu.h"
45#include "opt_ddb.h"
46#include "opt_maxmem.h"

--- 69 unchanged lines hidden (view full) ---

116#ifdef PERFMON
117#include <machine/perfmon.h>
118#endif
119
120#include <i386/isa/isa_device.h>
121#include <i386/isa/intr_machdep.h>
122#include <i386/isa/rtc.h>
123#include <machine/random.h>
124#include <sys/ptrace.h>
124
125extern void init386 __P((int first));
125
126extern void init386 __P((int first));
126extern int ptrace_set_pc __P((struct proc *p, unsigned int addr));
127extern int ptrace_single_step __P((struct proc *p));
128extern int ptrace_write_u __P((struct proc *p, vm_offset_t off, int data));
129extern void dblfault_handler __P((void));
130
131extern void printcpuinfo(void); /* XXX header file */
132extern void earlysetcpuclass(void); /* same header file */
133extern void finishidentcpu(void);
134extern void panicifcpuunsupported(void);
135extern void initializecpu(void);
136

--- 1468 unchanged lines hidden (view full) ---

1605int
1606ptrace_single_step(p)
1607 struct proc *p;
1608{
1609 p->p_md.md_regs->tf_eflags |= PSL_T;
1610 return (0);
1611}
1612
127extern void dblfault_handler __P((void));
128
129extern void printcpuinfo(void); /* XXX header file */
130extern void earlysetcpuclass(void); /* same header file */
131extern void finishidentcpu(void);
132extern void panicifcpuunsupported(void);
133extern void initializecpu(void);
134

--- 1468 unchanged lines hidden (view full) ---

1603int
1604ptrace_single_step(p)
1605 struct proc *p;
1606{
1607 p->p_md.md_regs->tf_eflags |= PSL_T;
1608 return (0);
1609}
1610
1611int ptrace_read_u_check(p, addr, len)
1612 struct proc *p;
1613 vm_offset_t addr;
1614 size_t len;
1615{
1616 vm_offset_t gap;
1617
1618 if ((vm_offset_t) (addr + len) < addr)
1619 return EPERM;
1620 if ((vm_offset_t) (addr + len) <= sizeof(struct user))
1621 return 0;
1622
1623 gap = (char *) p->p_md.md_regs - (char *) p->p_addr;
1624
1625 if ((vm_offset_t) addr < gap)
1626 return EPERM;
1627 if ((vm_offset_t) (addr + len) <=
1628 (vm_offset_t) (gap + sizeof(struct trapframe)))
1629 return 0;
1630 return EPERM;
1631}
1632
1613int ptrace_write_u(p, off, data)
1614 struct proc *p;
1615 vm_offset_t off;
1616 int data;
1617{
1618 struct trapframe frame_copy;
1619 vm_offset_t min;
1620 struct trapframe *tp;

--- 197 unchanged lines hidden ---
1633int ptrace_write_u(p, off, data)
1634 struct proc *p;
1635 vm_offset_t off;
1636 int data;
1637{
1638 struct trapframe frame_copy;
1639 vm_offset_t min;
1640 struct trapframe *tp;

--- 197 unchanged lines hidden ---