11.4Sperry/*	$NetBSD: kgdb.h,v 1.4 2006/02/16 20:17:13 perry Exp $	*/
21.2Sperry
31.1Ssakamoto/*
41.1Ssakamoto * Copyright (C) 1995, 1996 Wolfgang Solfrank.
51.1Ssakamoto * Copyright (C) 1995, 1996 TooLs GmbH.
61.1Ssakamoto * All rights reserved.
71.1Ssakamoto *
81.1Ssakamoto * Redistribution and use in source and binary forms, with or without
91.1Ssakamoto * modification, are permitted provided that the following conditions
101.1Ssakamoto * are met:
111.1Ssakamoto * 1. Redistributions of source code must retain the above copyright
121.1Ssakamoto *    notice, this list of conditions and the following disclaimer.
131.1Ssakamoto * 2. Redistributions in binary form must reproduce the above copyright
141.1Ssakamoto *    notice, this list of conditions and the following disclaimer in the
151.1Ssakamoto *    documentation and/or other materials provided with the distribution.
161.1Ssakamoto * 3. All advertising materials mentioning features or use of this software
171.1Ssakamoto *    must display the following acknowledgement:
181.1Ssakamoto *	This product includes software developed by TooLs GmbH.
191.1Ssakamoto * 4. The name of TooLs GmbH may not be used to endorse or promote products
201.1Ssakamoto *    derived from this software without specific prior written permission.
211.1Ssakamoto *
221.1Ssakamoto * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
231.1Ssakamoto * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
241.1Ssakamoto * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
251.1Ssakamoto * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
261.1Ssakamoto * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
271.1Ssakamoto * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
281.1Ssakamoto * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
291.1Ssakamoto * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
301.1Ssakamoto * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
311.1Ssakamoto * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
321.1Ssakamoto */
331.1Ssakamoto/* register array */
341.1Ssakamoto#define	FIX	0
351.1Ssakamoto#define	LR	32
361.1Ssakamoto#define	CR	33
371.1Ssakamoto#define	CTR	34
381.1Ssakamoto#define	XER	35
391.1Ssakamoto#define	PC	36
401.1Ssakamoto#define	MSR	37
411.1Ssakamoto#define	NREG	38
421.1Ssakamoto
431.1Ssakamotoextern int kgdbregs[NREG];
441.1Ssakamoto
451.1Ssakamotoextern char kgdbstep;
461.1Ssakamoto
471.1Ssakamoto/* Doesn't handle overlapping regions */
481.4Sperry__inline extern void
491.1Ssakamotokgdbcopy(s,d,n)
501.1Ssakamoto	void *s, *d;
511.1Ssakamoto	int n;
521.1Ssakamoto{
531.1Ssakamoto	char *sp = s, *dp = d;
541.1Ssakamoto
551.1Ssakamoto	while (--n >= 0)
561.1Ssakamoto		*dp++ = *sp++;
571.1Ssakamoto}
581.1Ssakamoto
591.4Sperry__inline extern void
601.1Ssakamotokgdbzero(d,n)
611.1Ssakamoto	void *d;
621.1Ssakamoto	int n;
631.1Ssakamoto{
641.1Ssakamoto	char *dp = d;
651.1Ssakamoto
661.1Ssakamoto	while (--n >= 0)
671.1Ssakamoto		*dp++ = 0;
681.1Ssakamoto}
691.1Ssakamoto
701.4Sperry__inline extern int
711.1Ssakamotokgdbcmp(s,d,n)
721.1Ssakamoto	void *s, *d;
731.1Ssakamoto{
741.1Ssakamoto	char *sp = s, *dp = d;
751.1Ssakamoto
761.1Ssakamoto	while (--n >= 0)
771.1Ssakamoto		if (*sp++ != *dp++)
781.1Ssakamoto			return *--dp - *--sp;
791.1Ssakamoto	return 0;
801.1Ssakamoto}
81