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/pc98/pc98/epsonio.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) KATO Takenori, 1996.  All rights reserved.
    3  *
    4  * Redistribution and use in source and binary forms, with or without
    5  * modification, are permitted provided that the following conditions
    6  * are met:
    7  * 1. Redistributions of source code must retain the above copyright
    8  *    notice, this list of conditions and the following disclaimer as
    9  *    the first lines of this file unmodified.
   10  * 2. Redistributions in binary form must reproduce the above copyright
   11  *    notice, this list of conditions and the following disclaimer in the
   12  *    documentation and/or other materials provided with the distribution.
   13  * 3. The name of the author may not be used to endorse or promote products
   14  *    derived from this software without specific prior written permission.
   15  *
   16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
   17  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   18  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
   19  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
   20  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
   21  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   22  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   23  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
   25  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   26  *
   27  * $FreeBSD: releng/5.0/sys/pc98/pc98/epsonio.h 79703 2001-07-14 04:14:29Z nyan $
   28  */
   29 
   30 #ifndef __PC98_PC98_EPSONIO_H__
   31 #define __PC98_PC98_EPSONIO_H__
   32 
   33 #include <machine/cpufunc.h>
   34 
   35 static __inline u_char
   36 epson_inb(u_int port)
   37 {
   38         u_char  data;
   39 
   40         outb(0x43f, 0x42);
   41         data = inb(port);
   42         outb(0x43f, 0x40);
   43         return (data);
   44 }
   45 
   46 static __inline void
   47 epson_outb(u_int port, u_char data)
   48 {
   49         outb(0x43f, 0x42);
   50         outb(port,data);
   51         outb(0x43f, 0x40);
   52 }
   53 
   54 static __inline u_int16_t
   55 epson_inw(u_int port)
   56 {
   57         u_int16_t data;
   58 
   59         outb(0x43f, 0x42);
   60         data = inw(port);
   61         outb(0x43f, 0x40);
   62         return (data);
   63 }
   64 
   65 static __inline void
   66 epson_insw(u_int port, void *addr, size_t cnt)
   67 {
   68         int     s;
   69 
   70         s = splbio();
   71         outb(0x43f, 0x42);
   72         disable_intr();
   73         insw((u_int)port, (void *)addr, (size_t)cnt);
   74         outb(0x43f, 0x40);
   75         enable_intr();
   76         splx(s);
   77 }
   78 
   79 static __inline void
   80 epson_outsw(u_int port, void *addr, size_t cnt)
   81 {
   82         int     s;
   83 
   84         s = splbio();
   85         outb(0x43f, 0x42);
   86         disable_intr();
   87         outsw((u_int)port, (void *)addr, (size_t)cnt);
   88         outb(0x43f, 0x40);
   89         enable_intr();
   90         splx(s);
   91 }
   92 
   93 #endif

Cache object: 646437a003b01a11036ad995f6805060


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