home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / console / svgatext.3 / svgatext / SVGATextMode-1.3 / XFREE / common_hw / IODelay.S < prev    next >
Encoding:
Text File  |  1995-10-29  |  2.1 KB  |  71 lines

  1. /* $XFree86: xc/programs/Xserver/hw/xfree86/common_hw/IODelay.s,v 3.0 1994/09/08 14:27:40 dawes Exp $ */
  2. /*******************************************************************************
  3.                         Copyright 1994 by Glenn G. Lai
  4.  
  5.                         All Rights Reserved
  6.  
  7. Permission to use, copy, modify, and distribute this software and its
  8. documentation for any purpose and without fee is hereby granted,
  9. provided that the above copyr notice appear in all copies and that
  10. both that copyr notice and this permission notice appear in
  11. supporting documentation, and that the name of Glenn G. Lai not be
  12. used in advertising or publicity pertaining to distribution of the
  13. software without specific, written prior permission.
  14.  
  15. Glenn G. Lai DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  16. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  17. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  18. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  19. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  20. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  21. SOFTWARE.
  22.  
  23. Glenn G. Lai
  24. P.O. Box 4314
  25. Austin, Tx 78765
  26. glenn@cs.utexas.edu)
  27. 7/21/94
  28. *******************************************************************************/
  29.  
  30. /* 
  31.  *   All we really need is a delay of about 40ns for I/O recovery for just
  32.  *   about any occasion, but we'll be more conservative here:  On a
  33.  *   100-MHz CPU, produce at least a delay of 1,000ns.
  34.  */ 
  35.  
  36. #if defined(__alpha__)
  37.        /*
  38.         * Really ought to use the cycle counter
  39.         * here but that would require an easy
  40.         * way to get at the frequency of the
  41.         * cycle counter (it's in the hwrpb).
  42.         */
  43.        .globl GlennsIODelay
  44.  
  45. GlennsIODelay:
  46.        bis     $31, 1000, $1
  47. loop:  subl    $1, 1, $1
  48.        bne     $1, loop
  49.        ret     ($26)
  50.  
  51. #else
  52.  
  53. #include "assyntax.h"
  54.  
  55.     FILE("DACDelay.s")
  56.  
  57.     AS_BEGIN
  58.  
  59.     GLOBL    GLNAME(GlennsIODelay)
  60.  
  61.     SEG_TEXT
  62.     ALIGNTEXT4
  63. GLNAME(GlennsIODelay):
  64.     MOV_L     (CONST(100), EAX)
  65. delay_it:
  66.     DEC_L    (EAX)
  67.     JNE    (delay_it)
  68.     RET
  69.  
  70. #endif
  71.