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/dev/gfb/gfb_pci.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  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
    3  * All rights reserved.
    4  *
    5  * Author: Chris G. Demetriou
    6  * 
    7  * Permission to use, copy, modify and distribute this software and
    8  * its 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  * 
   13  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 
   14  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 
   15  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
   16  * 
   17  * Carnegie Mellon requests users of this software to return to
   18  *
   19  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
   20  *  School of Computer Science
   21  *  Carnegie Mellon University
   22  *  Pittsburgh PA 15213-3890
   23  *
   24  * any improvements or extensions that they make and grant Carnegie the
   25  * rights to redistribute these changes.
   26  *
   27  * Copyright (c) 2000 Andrew Miklic
   28  *
   29  * $FreeBSD: releng/5.3/sys/dev/gfb/gfb_pci.h 85810 2001-11-01 08:26:30Z obrien $
   30  */
   31 
   32 #ifndef _PCI_GFB_H_
   33 #define _PCI_GFB_H_
   34 
   35 #define GFB_MEM_BASE_RID        0x10
   36 
   37 typedef u_int32_t gfb_reg_t;
   38 
   39 /* GFB register access macros */
   40 
   41 #define BUFADDR(adp, off)                                       \
   42 /*      (adp)->va_buffer = (adp)->va_mem_base +                 \
   43                            (((adp)->va_buffer -                 \
   44                              (adp)->va_mem_base +               \
   45                              (adp)->va_buffer_size) %           \
   46                             (adp)->va_mem_size),                \
   47         (adp)->va_buffer_alias = ((adp)->va_buffer -            \
   48                                   (adp)->va_mem_base) /         \
   49                                  (adp)->va_buffer_size,         \
   50         (adp)->va_window = (adp)->va_buffer +                   \
   51                            (((adp)->va_window -                 \
   52                              (adp)->va_mem_base) /              \
   53                             (adp)->va_buffer_alias),            \
   54 */      ((adp)->va_window + (adp)->va_window_orig +             \
   55          ((vm_offset_t)(off) << 2L))
   56 
   57 #define REGADDR(adp, reg)                                       \
   58 /*      (adp)->va_buffer = (adp)->va_mem_base +                 \
   59                            (((adp)->va_buffer -                 \
   60                              (adp)->va_mem_base +               \
   61                              (adp)->va_buffer_size) %           \
   62                             (adp)->va_mem_size),                \
   63         (adp)->va_buffer_alias = ((adp)->va_buffer -            \
   64                                   (adp)->va_mem_base) /         \
   65                                  (adp)->va_buffer_size,         \
   66         (adp)->va_registers = (adp)->va_buffer +                \
   67                               (((adp)->va_registers -           \
   68                                 (adp)->va_mem_base) /           \
   69                                (adp)->va_buffer_alias),         \
   70 */      ((adp)->va_registers + ((vm_offset_t)(reg) << 2L))
   71 
   72 #define READ_GFB_REGISTER(adp, reg)                             \
   73         (*(u_int32_t *)(REGADDR(adp, reg)))
   74 #define WRITE_GFB_REGISTER(adp, reg, val)                       \
   75         (*(u_int32_t*)(REGADDR(adp, reg)) = (val))
   76 #define GFB_REGISTER_WRITE_BARRIER(sc, reg, nregs)              \
   77         bus_space_barrier((sc)->btag, (sc)->regs, ((reg) << 2), \
   78                           4 * (nregs), BUS_SPACE_BARRIER_WRITE)
   79 #define GFB_REGISTER_READ_BARRIER(sc, reg, nregs)               \
   80         bus_space_barrier((sc)->btag, (sc)->regs, ((reg) << 2), \
   81                           4 * (nregs), BUS_SPACE_BARRIER_READ)
   82 #define GFB_REGISTER_READWRITE_BARRIER(sc, reg, nregs)          \
   83         bus_space_barrier((sc)->btag, (sc)->regs, ((reg) << 2), \
   84                           4 * (nregs),                          \
   85                           BUS_SPACE_BARRIER_READ |              \
   86                           BUS_SPACE_BARRIER_WRITE)
   87 
   88 #define READ_GFB_BUFFER(adp, reg)                               \
   89         (*(u_int32_t *)(BUFADDR(adp, reg)))
   90 #define WRITE_GFB_BUFFER(adp, reg, val)                         \
   91         (*(u_int32_t*)(BUFADDR(adp, reg)) = (val))
   92 
   93 /*int pcigfb_probe(device_t);*/
   94 int pcigfb_attach(device_t);
   95 int pcigfb_detach(device_t);
   96 
   97 #ifdef FB_INSTALL_CDEV
   98 
   99 d_open_t pcigfb_open;
  100 d_close_t pcigfb_close;
  101 d_read_t pcigfb_read;
  102 d_write_t pcigfb_write;
  103 d_ioctl_t pcigfb_ioctl;
  104 d_mmap_t pcigfb_mmap;
  105 
  106 #endif /*FB_INSTALL_CDEV*/
  107 
  108 typedef struct gfb_type {
  109         int vendor_id;
  110         int device_id;
  111         char* name;
  112 } *gfb_type_t;
  113 
  114 #endif /* _PCI_GFB_H_ */

Cache object: d4d42a786e7b55209a3a7e48b2747428


[ 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.