home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lxapi32.zip / Lib32 / hwaccess.h next >
C/C++ Source or Header  |  2002-04-26  |  3KB  |  107 lines

  1. /* $Id: hwaccess.h,v 1.2 2002/04/26 23:09:22 smilcke Exp $ */
  2.  
  3. /*
  4.  **********************************************************************
  5.  *     hwaccess.h
  6.  *     Copyright 1999, 2000 Creative Labs, Inc.
  7.  *
  8.  **********************************************************************
  9.  *
  10.  *     Date            Author        Summary of changes
  11.  *     ----            ------        ------------------
  12.  *     October 20, 1999     Bertrand Lee    base code release
  13.  *
  14.  **********************************************************************
  15.  *
  16.  *     This program is free software; you can redistribute it and/or
  17.  *     modify it under the terms of the GNU General Public License as
  18.  *     published by the Free Software Foundation; either version 2 of
  19.  *     the License, or (at your option) any later version.
  20.  *
  21.  *     This program is distributed in the hope that it will be useful,
  22.  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
  23.  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  24.  *     GNU General Public License for more details.
  25.  *
  26.  *     You should have received a copy of the GNU General Public
  27.  *     License along with this program; if not, write to the Free
  28.  *     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
  29.  *     USA.
  30.  *
  31.  **********************************************************************
  32.  */
  33.  
  34. #ifndef _HWACCESS_H
  35. #define _HWACCESS_H
  36.  
  37. #include <linux/version.h>
  38. #include <linux/kernel.h>
  39. #include <linux/fs.h>
  40. #include <linux/ioport.h>
  41. #include <linux/malloc.h>
  42. #include <linux/pci.h>
  43. #include <linux/interrupt.h>
  44.  
  45. #include <asm/io.h>
  46. #include <asm/dma.h>
  47.  
  48. enum GlobalErrorCode
  49. {
  50.     CTSTATUS_SUCCESS = 0x0000,
  51.     CTSTATUS_ERROR,
  52.     CTSTATUS_NOMEMORY,
  53.     CTSTATUS_INUSE,
  54. };
  55.  
  56. #define FLAGS_AVAILABLE     0x0001
  57. #define FLAGS_READY         0x0002
  58.  
  59. #define min(x,y) ((x) < (y)) ? (x) : (y)
  60.  
  61. struct memhandle
  62. {
  63.     unsigned long busaddx;
  64.     void *virtaddx;
  65.     u32 order;
  66. };
  67.  
  68. struct memhandle *emu10k1_alloc_memphysical(u32);
  69. void emu10k1_free_memphysical(struct memhandle *);
  70.  
  71. int emu10k1_list_attach(struct sblive_list **head, struct sblive_list *new);
  72. int emu10k1_list_remove(struct sblive_list **head, struct sblive_list *pDead);
  73. struct sblive_list *list_getnext(struct sblive_list *head, struct sblive_list *curr);
  74.  
  75. #define DEBUG_LEVEL 2
  76.  
  77. #ifdef TARGET_OS2
  78. #ifdef DEBUG
  79. #ifdef __cplusplus
  80. extern "C" {
  81. #endif
  82. void _cdecl DPD(int level, char *x, ...) ; /* not debugging: nothing */
  83. #ifdef __cplusplus
  84. }
  85. #endif
  86.  
  87. #define ERROR()    _asm int 3
  88. #else
  89. #define DPD 1 ? (void)0 : (void)((int (*)(int, char *, ...)) NULL)
  90. #define ERROR()
  91. #endif
  92. #define DPF(level, x)
  93. #define __attribute(a)
  94. #else
  95. #ifdef EMU10K1_DEBUG
  96. # define DPD(level,x,y...) do {if(level <= DEBUG_LEVEL) printk( KERN_NOTICE "emu10k1: %s: %d: " x , __FILE__ , __LINE__ , y );} while(0)
  97. # define DPF(level,x)   do {if(level <= DEBUG_LEVEL) printk( KERN_NOTICE "emu10k1: %s: %d: " x , __FILE__ , __LINE__ );} while(0)
  98. #define ERROR() DPF(1,"error\n");
  99. #else
  100. # define DPD(level,x,y...) /* not debugging: nothing */
  101. # define DPF(level,x)
  102. #define ERROR()
  103. #endif /* EMU10K1_DEBUG */
  104. #endif //TARGET_OS2
  105.  
  106. #endif  /* _HWACCESS_H */
  107.