iSeries_IoMmTable.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:5k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. #ifndef _ISERIES_IOMMTABLE_H
  2. #define _ISERIES_IOMMTABLE_H
  3. /************************************************************************/
  4. /* File iSeries_IoMmTable.h created by Allan Trautman on Dec 12 2001.   */
  5. /************************************************************************/
  6. /* Interfaces for the write/read Io address translation table.          */
  7. /* Copyright (C) 20yy  Allan H Trautman, IBM Corporation                */
  8. /*                                                                      */
  9. /* This program is free software; you can redistribute it and/or modify */
  10. /* it under the terms of the GNU General Public License as published by */
  11. /* the Free Software Foundation; either version 2 of the License, or    */
  12. /* (at your option) any later version.                                  */
  13. /*                                                                      */
  14. /* This program is distributed in the hope that it will be useful,      */ 
  15. /* but WITHOUT ANY WARRANTY; without even the implied warranty of       */
  16. /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        */
  17. /* GNU General Public License for more details.                         */
  18. /*                                                                      */
  19. /* You should have received a copy of the GNU General Public License    */ 
  20. /* along with this program; if not, write to the:                       */
  21. /* Free Software Foundation, Inc.,                                      */ 
  22. /* 59 Temple Place, Suite 330,                                          */ 
  23. /* Boston, MA  02111-1307  USA                                          */
  24. /************************************************************************/
  25. /* Change Activity:                                                     */
  26. /*   Created December 12, 2000                                          */
  27. /*   Ported to ppc64, August 30, 2001                                   */
  28. /* End Change Activity                                                  */
  29. /************************************************************************/
  30. struct pci_dev;
  31. struct iSeries_Device_Node;
  32. extern struct iSeries_Device_Node** iSeries_IoMmTable;
  33. extern u8*                          iSeries_IoBarTable;
  34. extern unsigned long iSeries_Base_Io_Memory;
  35. extern unsigned long iSeries_Max_Io_Memory;
  36. extern unsigned long iSeries_Base_Io_Memory;
  37. extern unsigned long iSeries_IoMmTable_Entry_Size;
  38. /************************************************************************/
  39. /* iSeries_IoMmTable_Initialize                                         */
  40. /************************************************************************/
  41. /* - Initalizes the Address Translation Table and get it ready for use. */
  42. /*   Must be called before any client calls any of the other methods.   */
  43. /*                                                                      */
  44. /* Parameters: None.                                                    */
  45. /*                                                                      */
  46. /* Return: None.                                                        */  
  47. /************************************************************************/
  48. extern  void iSeries_IoMmTable_Initialize(void);
  49. extern  void iSeries_IoMmTable_Status(void);
  50. /************************************************************************/
  51. /* iSeries_allocateDeviceBars                                           */
  52. /************************************************************************/
  53. /* - Allocates ALL pci_dev BAR's and updates the resources with the BAR */
  54. /*   value.  BARS with zero length will not have the resources.  The    */
  55. /*   HvCallPci_getBarParms is used to get the size of the BAR space.    */
  56. /*   It calls iSeries_IoMmTable_AllocateEntry to allocate each entry.   */
  57. /*                                                                      */
  58. /* Parameters:                                                          */
  59. /* pci_dev = Pointer to pci_dev structure that will be mapped to pseudo */
  60. /*           I/O Address.                                               */
  61. /*                                                                      */
  62. /* Return:                                                              */
  63. /*   The pci_dev I/O resources updated with pseudo I/O Addresses.       */
  64. /************************************************************************/
  65. extern  void iSeries_allocateDeviceBars(struct pci_dev* );
  66. /************************************************************************/
  67. /* iSeries_xlateIoMmAddress                                             */
  68. /************************************************************************/
  69. /* - Translates an I/O Memory address to Device Node that has been the  */
  70. /*   allocated the psuedo I/O Address.                                  */
  71. /*                                                                      */
  72. /* Parameters:                                                          */
  73. /* IoAddress = I/O Memory Address.                                      */
  74. /*                                                                      */
  75. /* Return:                                                              */
  76. /*   An iSeries_Device_Node to the device mapped to the I/O address. The*/
  77. /*   BarNumber and BarOffset are valid if the Device Node is returned.  */
  78. /************************************************************************/
  79. extern struct iSeries_Device_Node* iSeries_xlateIoMmAddress(void* IoAddress);
  80. #endif /* _ISERIES_IOMMTABLE_H */