The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/i386ps2/if_common.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /* 
    2  * Mach Operating System
    3  * Copyright (c) 1991 Carnegie Mellon University
    4  * Copyright (c) 1991 IBM Corporation 
    5  * All Rights Reserved.
    6  * 
    7  * Permission to use, copy, modify and distribute this software and its
    8  * documentation is hereby granted, provided that both the copyright
    9  * notice and this permission notice appear in all copies of the
   10  * software, derivative works or modified versions, and any portions
   11  * thereof, and that both notices appear in supporting documentation,
   12  * and that the name IBM not be used in advertising or publicity 
   13  * pertaining to distribution of the software without specific, written
   14  * prior permission.
   15  * 
   16  * CARNEGIE MELLON AND IBM ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS IS"
   17  * CONDITION.  CARNEGIE MELLON AND IBM DISCLAIM ANY LIABILITY OF ANY KIND FOR
   18  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
   19  * 
   20  * Carnegie Mellon requests users of this software to return to
   21  * 
   22  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
   23  *  School of Computer Science
   24  *  Carnegie Mellon University
   25  *  Pittsburgh PA 15213-3890
   26  * 
   27  * any improvements or extensions that they make and grant Carnegie Mellon
   28  * the rights to redistribute these changes.
   29  */
   30 
   31 /*
   32  * HISTORY
   33  * $Log:        if_common.h,v $
   34  * Revision 2.2  93/02/04  08:00:13  danner
   35  *      Integrate PS2 code from IBM.
   36  *      [93/01/18            prithvi]
   37  * 
   38  */
   39 
   40 /*
   41  * if_common.h
   42  * 
   43  *
   44  * Both the OSF/1 Ethernet and token ring drivers are derived from ACIS
   45  * sources and have source dependencies on files in the ACIS distribution
   46  * tree which have no equivalent in the OSF/1 tree.
   47  *
   48  * This file serves as a convient dumping ground for definitions for both
   49  * the Ungerman-Bass if_un.c and if_lan.c drivers.
   50  *
   51  */
   52 #ifndef _I386PS2_IF_COMMON_H_
   53 #define _I386PS2_IF_COMMON_H_
   54 
   55 #include <mach/i386/vm_param.h>         /* for VM_MIN_KERNEL_ADDRESS */
   56 
   57 #define KVBASE          VM_MIN_KERNEL_ADDRESS
   58 
   59 /*
   60  * from /sys/caio/ioccvar.h
   61  */
   62 
   63 #define DRIVER_SUSPEND  0x02            /* driver wants call on suspend */
   64 
   65 #define SUSPEND_START 0                 /* driver suspend start */
   66 #define SUSPEND_DONE  1                 /* driver suspend done */
   67 
   68 #define PROBE_BAD       0               /* if the probe fails */
   69 #define PROBE_NOINT     1               /* if probe ok but no interrupt */
   70 #define PROBE_OK        2               /* if the probe was ok (interrupt caused) */
   71 #define PROBE_BAD_INT   -1              /* we lost or didn't get interrupt */
   72 #define PROBE_DELAY(n)          \
   73 
   74 
   75 /*
   76  * from /sys/ca/io.h
   77  */
   78 
   79 
   80 /* Enable/Disable Interrupts from a Bus I/O level */
   81 #define ENABLE  1
   82 #define DISABLE 0
   83 
   84 #define GEN_IN(cpu1,cpu2) (cpu1)
   85 #define GEN_OUT(cpu1,cpu2) (cpu1)
   86 
   87 /*
   88  * These Macros provide access to the PC's I/O space.
   89  *
   90  */
   91 
   92 #define OUT(port, d)    outb(port, d)
   93 #define IN(port)        inb(port)
   94 #define OUTW(port, d)   outwb(port, d)
   95 #define INW(port)       inwb(port)
   96 
   97 #define MM_OUT(addr,d)  (*(unsigned char *)((int)addr+KVBASE) = (unsigned char)d)
   98 #define MM_OUTW(addr,d) (*(unsigned short *)((int)addr+KVBASE) = tr_swap(d))
   99 #define MM_IN(addr)     (*(unsigned char *)((int)addr+KVBASE))
  100 #ifdef notdef
  101 #define MM_INW(addr)    (((*(unsigned char *)((int)addr+KVBASE)) << 8) | (*(unsigned char *)((int)addr+KVBASE+1)))
  102 #else
  103 #define MM_INW(addr)    tr_swap(*(unsigned short *)((int)addr+KVBASE))
  104 #endif
  105 
  106 /*
  107  *  Following macros do "in's and out's" for memory mapped devices
  108  *
  109  *  Must use set_128_window() before using these macros
  110  */
  111 
  112 #define get_128_window() (1)
  113 #define get_512_window() (1)
  114 
  115 #define set_128_window(x) (x)   /* dummy */
  116 #define set_512_window(x) (x)   /* dummy */
  117 
  118 /*
  119  * from ca/debug.h
  120  */
  121 
  122 #define SHOW_INTR       0x00000004
  123 #define SHOW_IO         0x00000010
  124 #define SHOW_DATA       0x10000000
  125 
  126 #define DEBUG
  127 
  128 #ifdef DEBUG
  129 #define DEBUGF(cond,stmt) if (cond) stmt        /* do the stmt (printf) */
  130 #else
  131 #define DEBUGF(cond,stmt)               /* do nothing if not debugging */
  132 #endif
  133 
  134 /*
  135  * token ring specific definitions
  136  */
  137 /*
  138  * from ca_atr/pcif.h
  139  */
  140 
  141 int pc_copy_in;                         /* bytes copied in from PC */
  142 int pc_copy_out;                        /* bytes copied out to PC */
  143 
  144 #define TRIRQ 0x02
  145 
  146 #endif  /* _I386PS2_IF_COMMON_H_ */

Cache object: 1e8d82ba7edf8eff5c6138e1a81b39eb


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.