Bring shark includes to mainline and nuke the branch.

This commit is contained in:
tv 1998-06-19 15:55:13 +00:00
parent 13648c9aa6
commit ba144108f6
8 changed files with 666 additions and 0 deletions

View File

@ -0,0 +1,76 @@
/*
* Copyright 1997
* Digital Equipment Corporation. All rights reserved.
*
* This software is furnished under license and may be used and
* copied only in accordance with the following terms and conditions.
* Subject to these conditions, you may download, copy, install,
* use, modify and distribute this software in source and/or binary
* form. No title or ownership is transferred hereby.
*
* 1) Any source code used, modified or distributed must reproduce
* and retain this copyright notice and list of conditions as
* they appear in the source file.
*
* 2) No right is granted to use any trade name, trademark, or logo of
* Digital Equipment Corporation. Neither the "Digital Equipment
* Corporation" name nor any trademark or logo of Digital Equipment
* Corporation may be used to endorse or promote products derived
* from this software without the prior written permission of
* Digital Equipment Corporation.
*
* 3) This software is provided "AS-IS" and any express or implied
* warranties, including but not limited to, any implied warranties
* of merchantability, fitness for a particular purpose, or
* non-infringement are disclaimed. In no event shall DIGITAL be
* liable for any damages whatsoever, and in particular, DIGITAL
* shall not be liable for special, indirect, consequential, or
* incidental damages or damages for lost profits, loss of
* revenue or loss of use, whether such damages arise in contract,
* negligence, tort, under statute, in equity, at law or otherwise,
* even if advised of the possibility of such damage.
*/
/*
** devmap.h -- device memory mapping definitions
**
** <-----------------map size------------------------->
** <--internal offset--><--internal size-->
** |--------------------|------------------|----------|
** v v v v
** page device device page
** start memory memory end
** (map offset) start end
*/
#ifndef _DEVMAP_H_
#define _DEVMAP_H_
#include <sys/types.h>
#define MAP_INFO_UNKNOWN -1
#define MAP_IOCTL 0
#define MAP_MMAP 1
#define MAP_I386_IOMAP 3
struct map_info {
int method; /* Mapping method - eg. IOCTL, MMAP, or I386_IOMAP */
u_long size; /* size of region, in bus-space units */
union {
long maxmapinfo[64/sizeof(long)];
struct {
int placeholder; /* nothing needed */
} map_info_ioctl; /* used for ioctl method */
struct {
off_t map_offset; /* offset to be given to mmap, page aligned */
size_t map_size; /* size to be given to mmap, page aligned */
off_t internal_offset; /* internal offset in mapped rgn to data */
size_t internal_size; /* actual size of accessible region */
} map_info_mmap; /* used for mmap'd methods */
struct {
u_long start_port;
} map_info_i386_iomap;
} u;
};
#endif /* _DEVMAP_H_ */

View File

@ -0,0 +1,130 @@
/*
* Copyright 1997
* Digital Equipment Corporation. All rights reserved.
*
* This software is furnished under license and may be used and
* copied only in accordance with the following terms and conditions.
* Subject to these conditions, you may download, copy, install,
* use, modify and distribute this software in source and/or binary
* form. No title or ownership is transferred hereby.
*
* 1) Any source code used, modified or distributed must reproduce
* and retain this copyright notice and list of conditions as
* they appear in the source file.
*
* 2) No right is granted to use any trade name, trademark, or logo of
* Digital Equipment Corporation. Neither the "Digital Equipment
* Corporation" name nor any trademark or logo of Digital Equipment
* Corporation may be used to endorse or promote products derived
* from this software without the prior written permission of
* Digital Equipment Corporation.
*
* 3) This software is provided "AS-IS" and any express or implied
* warranties, including but not limited to, any implied warranties
* of merchantability, fitness for a particular purpose, or
* non-infringement are disclaimed. In no event shall DIGITAL be
* liable for any damages whatsoever, and in particular, DIGITAL
* shall not be liable for special, indirect, consequential, or
* incidental damages or damages for lost profits, loss of
* revenue or loss of use, whether such damages arise in contract,
* negligence, tort, under statute, in equity, at law or otherwise,
* even if advised of the possibility of such damage.
*/
/*
**++
** FACILITY:
**
** kerndebug.h
**
**
** ABSTRACT:
**
** This header provides generic debugging capabilities using printf.
** All debugging can be compiled out by not defining the
** KERNEL_DEBUG macro. In addition the amount of debug output is
** defined by individual variables controlled by each subsystem
** using this utility. Finally note that the two middle bytes of
** the kern debug flags (bits 16 to 23) are free for individual
** subsystems to use as they please (eg. define switches for
** individual functions etc).
**
** AUTHORS:
**
** John Court
**
** CREATION DATE: 2-Feb-1992
**
** MODIFICATION HISTORY:
**
**--
*/
#ifndef _KERNDEBUG_H_
#define _KERNDEBUG_H_
#define KERN_DEBUG_INFO 0x00000001
#define KERN_DEBUG_WARNING 0x00000002
#define KERN_DEBUG_ERROR 0x00000010
#define KERN_DEBUG_SMP 0x00000020
#define KERN_DEBUG_PANIC 0x40000000
#define KERN_REAL_PANIC 0x80000000
#define KERN_DEBUG_ALL KERN_DEBUG_INFO | KERN_DEBUG_WARNING | \
KERN_DEBUG_ERROR | KERN_DEBUG_PANIC
/*
** Define the type for debugging flag subsystem variables
*/
typedef unsigned int Kern_Debug_Flags;
/*
** Set up source line location macro for extra debugging and panics
*/
#ifdef __FILE__
#define KERN_DEBUG_LOC ":%s:%d:=\n\t",__FILE__,__LINE__
#else
#define KERN_DEBUG_LOC ":__FILE__ not supported :=\n\t"
#endif
/*
** This is real nasty in that it requires several printf's but is
** unavoidable due to the differences between
** preprocessors supporting standard ANSI C and others.
**
** NOTE: The format of calls to this macro must be
**
** KERN_DEBUG((Kern_Debug_Flags)CntrlVar, KERN_DEBUG_xxxx,
** (normal printf arguments));
**
** pay special attention to the extra set of () around the
** final arguement.
**
*/
#ifdef KERNEL_DEBUG
#define KERN_DEBUG(CntrlVar,Level,Output) \
{ \
if ( (CntrlVar) & (Level) ) \
{ \
if ( (CntrlVar) & (Level) & KERN_DEBUG_PANIC ) \
{ \
printf ("KERNEL:DEBUG PANIC"); \
printf (KERN_DEBUG_LOC); \
printf Output; \
panic("KERN_DEBUG Panicing"); \
} \
else \
{ \
printf Output; \
} \
} \
}
#else /* else KERNEL_DEBUG not defined */
#define KERN_DEBUG(CntrlVar,Level,Output)
#endif /* end else KERNEL_DEBUG not defined */
#endif /* _KERNDEBUG_H_ */

View File

@ -0,0 +1,71 @@
/*
* Copyright 1997
* Digital Equipment Corporation. All rights reserved.
*
* This software is furnished under license and may be used and
* copied only in accordance with the following terms and conditions.
* Subject to these conditions, you may download, copy, install,
* use, modify and distribute this software in source and/or binary
* form. No title or ownership is transferred hereby.
*
* 1) Any source code used, modified or distributed must reproduce
* and retain this copyright notice and list of conditions as
* they appear in the source file.
*
* 2) No right is granted to use any trade name, trademark, or logo of
* Digital Equipment Corporation. Neither the "Digital Equipment
* Corporation" name nor any trademark or logo of Digital Equipment
* Corporation may be used to endorse or promote products derived
* from this software without the prior written permission of
* Digital Equipment Corporation.
*
* 3) This software is provided "AS-IS" and any express or implied
* warranties, including but not limited to, any implied warranties
* of merchantability, fitness for a particular purpose, or
* non-infringement are disclaimed. In no event shall DIGITAL be
* liable for any damages whatsoever, and in particular, DIGITAL
* shall not be liable for special, indirect, consequential, or
* incidental damages or damages for lost profits, loss of
* revenue or loss of use, whether such damages arise in contract,
* negligence, tort, under statute, in equity, at law or otherwise,
* even if advised of the possibility of such damage.
*/
#ifndef _MACHINE_OFW_H_
#define _MACHINE_OFW_H_
/* Virtual address range reserved for OFW. */
/* Maybe this should be elsewhere? -JJK */
#define OFW_VIRT_BASE 0xF7000000
#define OFW_VIRT_SIZE 0x01000000
/* OFW client services handle. */
typedef int (*ofw_handle_t)(void *);
/* Implemented in <ofw/ofw.c> */
void ofw_init __P((ofw_handle_t));
void ofw_boot __P((int, char *));
void ofw_getbootinfo __P((char **, char **));
void ofw_configmem __P((void));
void ofw_configisa __P((vm_offset_t *, vm_offset_t *));
void ofw_configisadma __P((vm_offset_t *));
int ofw_isadmarangeintersect __P((vm_offset_t, vm_offset_t,
vm_offset_t *, vm_offset_t *));
vm_offset_t ofw_gettranslation __P((vm_offset_t));
vm_offset_t ofw_map __P((vm_offset_t, vm_size_t, int));
vm_offset_t ofw_getcleaninfo __P((void));
#ifdef OFWGENCFG
/* Implemented in <ofw/ofwgencfg_machdep.c> */
extern int ofw_handleticks;
extern void boot __P((int, char *));
extern vm_offset_t initarm __P((ofw_handle_t));
extern void consinit __P((void));
extern void process_kernel_args __P((void));
extern void ofrootfound __P((void));
#endif
#endif /* !_MACHINE_OFW_H_ */

View File

@ -0,0 +1,28 @@
/* $NetBSD: pccons.h,v 1.1 1998/06/19 15:55:13 tv Exp $ */
/*
* pccons.h -- pccons ioctl definitions
*/
#ifndef _PCCONS_H_
#define _PCCONS_H_
#include <sys/ioctl.h>
#define CONSOLE_X_MODE_ON _IO('t',121)
#define CONSOLE_X_MODE_OFF _IO('t',122)
#define CONSOLE_X_BELL _IOW('t',123,int[2])
#define CONSOLE_SET_TYPEMATIC_RATE _IOW('t',124,u_char)
#define CONSOLE_X_TV_ON _IOW('t',155,int)
#define CONSOLE_X_TV_OFF _IO('t',156)
#define CONSOLE_GET_LINEAR_INFO _IOR('t',157,struct map_info)
#define CONSOLE_GET_IO_INFO _IOR('t',158,struct map_info)
#define CONSOLE_GET_MEM_INFO _IOR('t',159,struct map_info)
#define XMODE_RGB 0
#define XMODE_NTSC 1
#define XMODE_PAL 2
#define XMODE_SECAM 3
#endif /* _PCCONS_H_ */

View File

@ -0,0 +1,49 @@
/*
* Copyright 1997
* Digital Equipment Corporation. All rights reserved.
*
* This software is furnished under license and may be used and
* copied only in accordance with the following terms and conditions.
* Subject to these conditions, you may download, copy, install,
* use, modify and distribute this software in source and/or binary
* form. No title or ownership is transferred hereby.
*
* 1) Any source code used, modified or distributed must reproduce
* and retain this copyright notice and list of conditions as
* they appear in the source file.
*
* 2) No right is granted to use any trade name, trademark, or logo of
* Digital Equipment Corporation. Neither the "Digital Equipment
* Corporation" name nor any trademark or logo of Digital Equipment
* Corporation may be used to endorse or promote products derived
* from this software without the prior written permission of
* Digital Equipment Corporation.
*
* 3) This software is provided "AS-IS" and any express or implied
* warranties, including but not limited to, any implied warranties
* of merchantability, fitness for a particular purpose, or
* non-infringement are disclaimed. In no event shall DIGITAL be
* liable for any damages whatsoever, and in particular, DIGITAL
* shall not be liable for special, indirect, consequential, or
* incidental damages or damages for lost profits, loss of
* revenue or loss of use, whether such damages arise in contract,
* negligence, tort, under statute, in equity, at law or otherwise,
* even if advised of the possibility of such damage.
*/
#ifndef _ARM32_PIO_H_
#define _ARM32_PIO_H_
#include <machine/bus.h>
extern struct bus_space isa_io_bs_tag;
#define inb(port) bus_space_read_1( &isa_io_bs_tag, (bus_space_handle_t)isa_io_bs_tag.bs_cookie, (port))
#define outb(port, byte) bus_space_write_1(&isa_io_bs_tag, (bus_space_handle_t)isa_io_bs_tag.bs_cookie, (port), (byte))
/* dma range check is here because pio.h is the only machine dependent
file included by isadma.c */
#define ISA_MACHDEP_DMARANGECHECK
int isa_machdep_dmarangecheck(vm_offset_t, vm_size_t);
#endif /* _ARM32_PIO_H_ */

View File

@ -0,0 +1,202 @@
/*
* Copyright 1997
* Digital Equipment Corporation. All rights reserved.
*
* This software is furnished under license and may be used and
* copied only in accordance with the following terms and conditions.
* Subject to these conditions, you may download, copy, install,
* use, modify and distribute this software in source and/or binary
* form. No title or ownership is transferred hereby.
*
* 1) Any source code used, modified or distributed must reproduce
* and retain this copyright notice and list of conditions as
* they appear in the source file.
*
* 2) No right is granted to use any trade name, trademark, or logo of
* Digital Equipment Corporation. Neither the "Digital Equipment
* Corporation" name nor any trademark or logo of Digital Equipment
* Corporation may be used to endorse or promote products derived
* from this software without the prior written permission of
* Digital Equipment Corporation.
*
* 3) This software is provided "AS-IS" and any express or implied
* warranties, including but not limited to, any implied warranties
* of merchantability, fitness for a particular purpose, or
* non-infringement are disclaimed. In no event shall DIGITAL be
* liable for any damages whatsoever, and in particular, DIGITAL
* shall not be liable for special, indirect, consequential, or
* incidental damages or damages for lost profits, loss of
* revenue or loss of use, whether such damages arise in contract,
* negligence, tort, under statute, in equity, at law or otherwise,
* even if advised of the possibility of such damage.
*/
/*
* Remote profiler structures used to communicate between the
* target (SHARK) and the host (GUI'd) machine.
* Also has stuff used to talk between the profiling driver and
* profiling server function.
*
*/
#ifndef __PROFILE_IO_H__
#define __PROFILE_IO_H__
#include <sys/types.h>
/* I have no idea what the 'P' group id means,
* I presume it isn't used for much.??
*/
#define PROFIOSTART _IOWR('P', 0, struct profStartInfo) /* start profiling */
#define PROFIOSTOP _IO('P', 1) /* stop profiling */
/* hash table stuff.
*/
#define TABLE_ENTRY_SIZE (sizeof(struct hashEntry))
#define REDUNDANT_BITS 0x02
#define COUNT_BITS 0x02
#define COUNT_BIT_MASK 0x03
/* sample mode flags.
*/
#define SAMPLE_MODE_MASK 0x03
#define SAMPLE_PROC 0x01
#define SAMPLE_KERN 0x02
/* an actual entry
*/
struct profHashEntry
{
unsigned int pc; /* the pc, minus any redundant bits. */
unsigned int next; /* the next pointer as an entry index */
unsigned short counts[4]; /* the counts */
};
/* table header.
*/
struct profHashHeader
{
unsigned int tableSize; /* total table size in entries */
unsigned int entries; /* first level table size, in entries */
unsigned int samples; /* the number of samples in the table. */
unsigned int missed; /* the number of samples missed. */
unsigned int fiqs; /* the number of fiqs. */
unsigned int last; /* last entry in the overflow area */
pid_t pid; /* The pid being sampled */
int mode; /* kernel or user mode */
}
__attribute__ ((packed));
/* actual table
*/
struct profHashTable
{
struct profHashHeader hdr;
struct profHashEntry *entries;
};
/* information passed to the start/stop ioctl.
*/
struct profStartInfo
{
pid_t pid; /* if this is -1 sample no processes */
unsigned int tableSize; /* the total table size in entries */
unsigned int entries; /* number of entries to hash */
unsigned int mode; /* if set profile the kernel */
int status; /* status of command returned by driver. */
};
/* Communications Protocol stuff
* defines the messages that the host and
* target will use to communicate.
*/
struct packetHeader
{
int code; /* this will either be a command or a
* data specifier.
*/
unsigned int size; /* size of data to follow,
* quantity depends on code.
*/
}
__attribute__ ((packed));
struct startSamplingCommand
{
pid_t pid; /* the pid to sample */
unsigned int tableSize; /* the total table size in entries */
unsigned int entries; /* number of entries to hash */
unsigned int mode; /* if set profile kernel also. */
}
__attribute__ ((packed));
struct startSamplingResponse
{
int status; /* identifies the status of the command. */
int count; /* number of shared lib entries following. */
}
__attribute__ ((packed));
struct stopSamplingCommand
{
int alert; /* if set then the daemon sends a SIGINT to
* the process.
*/
}
__attribute__ ((packed));
struct disassemble
{
unsigned int offset; /* offset into file to begin disassembling */
unsigned int length; /* length in arm words ie 32bits. */
}
__attribute__ ((packed));
struct profStatus
{
unsigned int status; /* identifies the status. */
}
__attribute__ ((packed));
/* Command/Data Types
* Only one bit may be set for any one command.
* so these are not masks but distinct values.
*/
#define START_SAMPLING 0x01
#define STOP_SAMPLING 0x02
#define READ_TABLE 0x03
#define DISASSEMBLY 0x04
#define SYMBOL_INFO 0x05
#define PROCESS_INFO 0x06
/* Data Types */
#define TABLE_DATA 0x07
#define SYMBOL_DATA 0x08
#define DISAS_DATA 0x09
#define PROC_DATA 0x0a
#define STATUS_DATA 0x0b
#define START_DATA 0x0c
/* Status Codes */
#define CMD_OK 0x00
#define ALREADY_SAMPLING 0x01
#define NOT_SAMPLING 0x02
#define NO_MEMORY 0x03
#define BAD_TABLE_SIZE 0x04
#define ILLEGAL_PACKET 0x05
#define ILLEGAL_COMMAND 0x06
#define BAD_OPTION 0x07
#endif

View File

@ -0,0 +1,106 @@
/*
* Copyright 1997
* Digital Equipment Corporation. All rights reserved.
*
* This software is furnished under license and may be used and
* copied only in accordance with the following terms and conditions.
* Subject to these conditions, you may download, copy, install,
* use, modify and distribute this software in source and/or binary
* form. No title or ownership is transferred hereby.
*
* 1) Any source code used, modified or distributed must reproduce
* and retain this copyright notice and list of conditions as
* they appear in the source file.
*
* 2) No right is granted to use any trade name, trademark, or logo of
* Digital Equipment Corporation. Neither the "Digital Equipment
* Corporation" name nor any trademark or logo of Digital Equipment
* Corporation may be used to endorse or promote products derived
* from this software without the prior written permission of
* Digital Equipment Corporation.
*
* 3) This software is provided "AS-IS" and any express or implied
* warranties, including but not limited to, any implied warranties
* of merchantability, fitness for a particular purpose, or
* non-infringement are disclaimed. In no event shall DIGITAL be
* liable for any damages whatsoever, and in particular, DIGITAL
* shall not be liable for special, indirect, consequential, or
* incidental damages or damages for lost profits, loss of
* revenue or loss of use, whether such damages arise in contract,
* negligence, tort, under statute, in equity, at law or otherwise,
* even if advised of the possibility of such damage.
*/
/*
* Definitions for SCR smart card driver
*/
#ifndef _SYS_SCRIO_H_
#define _SYS_SCRIO_H_
#define ATR_BUF_MAX 1 + 1 + 4 * 10 + 15 + 1 /* TS + T0 + 4 * TABCD + 15 * TK + TCK */
#define CMD_BUF_LEN 5
#define DATA_BUF_MAX 256
/* status information for Status*/
#define CARD_REMOVED 0x0000
#define CARD_INSERTED 0x0001
#define CARD_ON 0x0002
typedef struct
{
int status;
}ScrStatus;
typedef struct
{
unsigned char atrBuf[ATR_BUF_MAX];
unsigned int atrLen;
unsigned int status;
}ScrOn;
typedef struct
{
unsigned char command[CMD_BUF_LEN]; /* command */
int writeBuffer; /* true write, false read */
unsigned char data[DATA_BUF_MAX]; /* data, write to card, read from card */
unsigned int dataLen; /* data length, used on write, set of read */
unsigned char sw1; /* sw1 status */
unsigned char sw2; /* sw2 status */
unsigned int status; /* driver status */
}ScrT0;
typedef struct
{
unsigned int status;
}ScrOff;
#define SCRIOSTATUS _IOR ('S', 1, ScrStatus) /* return card in/out, card on/off */
#define SCRIOON _IOR ('S', 2, ScrOn) /* turns card on, returns ATR */
#define SCRIOOFF _IOR ('S', 3, ScrOff) /* turns card off */
#define SCRIOT0 _IOWR('S', 4, ScrT0) /* read/write card data in T0 protocol */
#define ERROR_OK 0 /* no error */
#define ERROR_PARITY 1 /* too many parity errors */
#define ERROR_ATR_TCK 2 /* ATR checksum error */
#define ERROR_ATR_BUF_OVERRUN 3 /* ATR was to big for buf */
#define ERROR_ATR_FI_INVALID 4 /* FI was invalid */
#define ERROR_ATR_DI_INVALID 5 /* DI was invalid */
#define ERROR_ATR_T3 6 /* timer T3 expired */
#define ERROR_WORK_WAITING 7 /* work waiting expired */
#define ERROR_BAD_PROCEDURE_BYTE 8 /* bad procedure byte */
#define ERROR_CARD_REMOVED 9 /* tried to do ioctal that needs card inserted */
#define ERROR_CARD_ON 10 /* tried to do ioctal that needs card off */
#define ERROR_CARD_OFF 11 /* tried to do ioctal that needs card on */
#define ERROR_INVALID_DATALEN 12 /* invalid data length on t0 write */
#define ERROR_TO_OVERRUN 13 /* invalid data length read from card */
#endif /* _SYS_SCRIO_H_ */

View File

@ -0,0 +1,4 @@
#ifndef _MACHINE_SHARK_H_
#define _MACHINE_SHARK_H_
#endif /* !_MACHINE_SHARK_H_ */