b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync/*
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * Copyright (c) 1996 by The XFree86 Project, Inc.
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync *
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * Permission is hereby granted, free of charge, to any person obtaining a
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * copy of this software and associated documentation files (the "Software"),
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * to deal in the Software without restriction, including without limitation
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * the rights to use, copy, modify, merge, publish, distribute, sublicense,
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * and/or sell copies of the Software, and to permit persons to whom the
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * Software is furnished to do so, subject to the following conditions:
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync *
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * The above copyright notice and this permission notice shall be included in
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * all copies or substantial portions of the Software.
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync *
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * OTHER DEALINGS IN THE SOFTWARE.
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync *
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * Except as contained in this notice, the name of the copyright holder(s)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * and author(s) shall not be used in advertising or otherwise to promote
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * the sale, use or other dealings in this Software without prior written
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * authorization from the copyright holder(s) and author(s).
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync */
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync/*
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * scoasm.h - used to define inline versions of certain functions which
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * do NOT appear in sys/inline.h.
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync */
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync#ifdef HAVE_XORG_CONFIG_H
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync#include <xorg-config.h>
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync#endif
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync#if defined(__SCO__) && defined(__USLC__)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync#ifndef _SCOASM_HDR_INC
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync#define _SCOASM_HDR_INC
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsyncasm void outl(port,val)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync{
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync%reg port,val;
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync movl port, %edx
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync movl val, %eax
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync outl (%dx)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync%reg port; mem val;
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync movl port, %edx
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync movl val, %eax
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync outl (%dx)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync%mem port; reg val;
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync movw port, %dx
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync movl val, %eax
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync outl (%dx)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync%mem port,val;
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync movw port, %dx
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync movl val, %eax
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync outl (%dx)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync}
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsyncasm void outw(port,val)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync{
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync%reg port,val;
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync movl port, %edx
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync movl val, %eax
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync data16
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync outl (%dx)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync%reg port; mem val;
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync movl port, %edx
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync movw val, %ax
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync data16
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync outl (%dx)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync%mem port; reg val;
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync movw port, %dx
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync movl val, %eax
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync data16
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync outl (%dx)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync%mem port,val;
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync movw port, %dx
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync movw val, %ax
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync data16
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync outl (%dx)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync}
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsyncasm void outb(port,val)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync{
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync%reg port,val;
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync movl port, %edx
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync movl val, %eax
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync outb (%dx)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync%reg port; mem val;
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync movl port, %edx
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync movb val, %al
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync outb (%dx)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync%mem port; reg val;
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync movw port, %dx
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync movl val, %eax
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync outb (%dx)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync%mem port,val;
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync movw port, %dx
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync movb val, %al
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync outb (%dx)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync}
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsyncasm int inl(port)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync{
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync%reg port;
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync movl port, %edx
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync inl (%dx)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync%mem port;
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync movw port, %dx
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync inl (%dx)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync}
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsyncasm int inw(port)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync{
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync%reg port;
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync subl %eax, %eax
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync movl port, %edx
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync data16
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync inl (%dx)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync%mem port;
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync subl %eax, %eax
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync movw port, %dx
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync data16
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync inl (%dx)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync}
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsyncasm int inb(port)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync{
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync%reg port;
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync subl %eax, %eax
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync movl port, %edx
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync inb (%dx)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync%mem port;
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync subl %eax, %eax
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync movw port, %dx
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync inb (%dx)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync}
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync#endif /* _SCOASM_HDR_INC */
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync#endif /* __SCO__ && __USLC__ */