home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 9 / FreshFishVol9-CD2.bin / bbs / gnu / gdb-4.14-src.lha / gdb-4.14 / gdb / nlm / alpha-io.S < prev    next >
Encoding:
Text File  |  1994-09-02  |  3.3 KB  |  151 lines

  1. /*
  2.  * Copyright (C) 1993, 1994 by
  3.  * Digital Equipment Corporation, Maynard, Massachusetts.
  4.  * All rights reserved.
  5.  *
  6.  * This software is furnished under a license and may be used and copied
  7.  * only  in  accordance  of  the  terms  of  such  license  and with the
  8.  * inclusion of the above copyright notice. This software or  any  other
  9.  * copies thereof may not be provided or otherwise made available to any
  10.  * other person.  No title to and  ownership of the  software is  hereby
  11.  * transferred.
  12.  *
  13.  * The information in this software is  subject to change without notice
  14.  * and  should  not  be  construed  as a commitment by Digital Equipment
  15.  * Corporation.
  16.  *
  17.  * Digital assumes no responsibility for the use  or  reliability of its
  18.  * software on equipment which is not supplied by Digital.
  19.  *
  20.  */
  21.  
  22.  
  23. #include "alpha-regdef.h"
  24.  
  25. #define LEAF_ENTRY(NAME) .text ; .align 4 ; .globl NAME ; .ent NAME, 0 ; NAME: ; .frame sp, 0, ra ; .prologue 0 ;
  26.  
  27.  
  28. LEAF_ENTRY(flush_i_cache)
  29.     call_pal 0x86            /* IMB */
  30.     ret    zero, (ra)        /* return */
  31.     .end    flush_i_cache
  32.  
  33.  
  34.  
  35. /* ++
  36.  *
  37.  * VOID
  38.  * outVti(
  39.  *     ULONG Port
  40.  *     ULONG Data
  41.  *    )
  42.  *
  43.  * Routine Description:
  44.  *
  45.  *     This Function Uses The 64-Bit Super-Page To Write Data To A Port
  46.  *     Of The On-Board VTI Combo Chip For JENSEN.
  47.  *
  48.  * Arguments:
  49.  *
  50.  *    Port (A0) - Port Number On VTI Chip To Which To Write Data
  51.  *    data (a1) - data to write to the port, only low byte is significant
  52.  *                 To The VTI
  53.  *
  54.  * Return Value:
  55.  *
  56.  *    None.
  57.  *
  58.  */
  59.  
  60.     LEAF_ENTRY(outVti)
  61.  
  62.     /*
  63.      * generate super-page address of vti, base address
  64.      * N.B. - Upper Bits Must Be Sign Extension Of Bit 42
  65.      *   va<42:41> = 10 (binary) for super-page address
  66.      */
  67.  
  68.     lda    t0, 0xc01c(zero)    /* t0 = ffff ffff ffff c01c */
  69.     sll    t0, 28, t0        /* t0 = ffff fc01 c000 0000 */
  70.  
  71.  
  72.     /*
  73.      * Shift In The Port Number To Generate The Port Address We
  74.      *     wish to access
  75.      * N.B. - Access Width Is Always Zero = Byte Access For VTI
  76.      */
  77.  
  78.     sll    a0, 9, a0        /* a0 << 9 */
  79.     bis    t0, a0, t0        /* T0 = Address Of VTI Port */
  80.  
  81.  
  82.     /*
  83.      * Do The Port Write, Guarantee That Subsequent Writes (And Reads)
  84.      *   are ordered with respect to this write and return to caller
  85.      */
  86.  
  87.     stl    a1, 0(t0)        /* write data to port */
  88.     mb                /* guarantee write ordering */
  89.  
  90.     ret    zero, (ra)        /* return */
  91.  
  92.     .end    outVti
  93.  
  94.  
  95.  
  96. /*
  97.  *
  98.  * ULONG
  99.  * inVti(
  100.  *     ULONG Port
  101.  *    )
  102.  *
  103.  * Routine Description:
  104.  *
  105.  *     This Function Uses The 64-Bit Super-Page To Read Data From A Port
  106.  *     Of The On-Board VTI Combo Chip For JENSEN.
  107.  *
  108.  * Arguments:
  109.  *
  110.  *    Port (A0) - Port Number On VTI Chip To Which To Write Data
  111.  *
  112.  * Return Value:
  113.  *
  114.  *    Data (V0) - The Data Read From The VTI Chip, Only The Low Byte Will
  115.  *             be valid
  116.  *
  117.  */
  118.  
  119.     LEAF_ENTRY(inVti)
  120.  
  121.     /*
  122.      * generate super-page address of vti, base address
  123.      * N.B. - Upper Bits Must Be Sign Extension Of Bit 42
  124.      *   va<42:41> = 10 (binary) for super-page address
  125.      */
  126.  
  127.     lda    t0, 0xc01c(zero)    /* t0 = ffff ffff ffff c01c */
  128.     sll    t0, 28, t0        /* t0 = ffff fc01 c000 0000 */
  129.  
  130.  
  131.     /*
  132.      * Shift In The Port Number To Generate The Port Address We
  133.      *     wish to access
  134.      * N.B. - Access Width For VTI Is Always 0 = Byte Access
  135.      */
  136.  
  137.     sll    a0, 9, a0        /* a0 << 9 */
  138.     bis    t0, a0, t0        /* T0 = Address Of VTI Port */
  139.  
  140.  
  141.     /*
  142.      * Do The Super-Page I/O Access And Return Data To Caller
  143.      */
  144.  
  145.     ldl    v0, 0(t0)        /* read data from port */
  146.     and    v0, 0xff, v0
  147.  
  148.     ret    zero, (ra)        /* return  */
  149.  
  150.     .end    inVti
  151.