grub2: bring back build of aros-side grub2 tools
[AROS.git] / workbench / devs / AHI / Drivers / EMU10kx / linuxsupport.h
blobdc06ab4889dd72199ded129c52b51b142d96cc73
1 /*
2 emu10kx.audio - AHI driver for SoundBlaster Live! series
3 Copyright (C) 2002-2005 Martin Blom <martin@blom.org>
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #ifndef AHI_Drivers_EMU10kx_linuxsupport_h
21 #define AHI_Drivers_EMU10kx_linuxsupport_h
23 #include <config.h>
25 #include <stdlib.h>
26 #include <proto/exec.h>
28 typedef unsigned int u32;
29 typedef unsigned short u16;
30 typedef unsigned char u8;
32 typedef signed int s32;
33 typedef signed short s16;
34 typedef signed char s8;
36 typedef unsigned int dma_addr_t;
38 #define __devinit
40 #define spin_lock_irqsave(lock,flags) Disable();
41 #define spin_unlock_irqrestore(lock,flags) Enable();
43 #define PAGE_SIZE 4096
44 #define GFP_KERNEL 0 // Never used; the value doesn't matter
46 #define KERN_NOTICE ""
47 #define printk printf
49 #ifndef __AMIGAOS4__
50 #define PCI_ANY_ID 0xffff
51 #endif
52 #define PCI_VENDOR_ID_CREATIVE 0x1102
53 #define PCI_DEVICE_ID_CREATIVE_EMU10K1 0x0002
54 #define PCI_DEVICE_ID_CREATIVE_AUDIGY 0x0004
55 #define EMU_APS_SUBID 0x40011102
57 #define SOUND_MIXER_NRDEVICES 25
58 #define SOUND_MIXER_VOLUME 0
59 #define SOUND_MIXER_PCM 4
60 #define SOUND_MIXER_IGAIN 12
61 #define SOUND_MIXER_OGAIN 13
62 #define SOUND_MIXER_DIGITAL1 17
64 #define SOUND_MASK_OGAIN (1 << SOUND_MIXER_OGAIN)
65 #define SOUND_MASK_DIGITAL1 (1 << SOUND_MIXER_DIGITAL1)
67 #define AC97_RESET 0x0000
68 #define AC97_MASTER_VOL_STEREO 0x0002
69 #define AC97_HEADPHONE_VOL 0x0004
70 #define AC97_MASTER_VOL_MONO 0x0006
71 #define AC97_MASTER_TONE 0x0008
72 #define AC97_PCBEEP_VOL 0x000a
73 #define AC97_PHONE_VOL 0x000c
74 #define AC97_MIC_VOL 0x000e
75 #define AC97_LINEIN_VOL 0x0010
76 #define AC97_CD_VOL 0x0012
77 #define AC97_VIDEO_VOL 0x0014
78 #define AC97_AUX_VOL 0x0016
79 #define AC97_PCMOUT_VOL 0x0018
80 #define AC97_RECORD_SELECT 0x001a
81 #define AC97_RECORD_GAIN 0x001c
83 #define AC97_EXTENDED_ID 0x0028
84 #define AC97_SURROUND_MASTER 0x0038
86 #define AC97_MUTE 0x8000
88 #define AC97_RECMUX_MIC 0x0000
89 #define AC97_RECMUX_CD 0x0101
90 #define AC97_RECMUX_VIDEO 0x0202
91 #define AC97_RECMUX_AUX 0x0303
92 #define AC97_RECMUX_LINE 0x0404
93 #define AC97_RECMUX_STEREO_MIX 0x0505
94 #define AC97_RECMUX_MONO_MIX 0x0606
95 #define AC97_RECMUX_PHONE 0x0707
98 unsigned long
99 __get_free_page( unsigned int gfp_mask );
101 void
102 free_page( unsigned long addr );
104 void*
105 pci_alloc_consistent( void* pci_dev, size_t size, dma_addr_t* dma_handle );
107 void
108 pci_free_consistent( void* pci_dev, size_t size, void* arrd, dma_addr_t dma_handle );
111 static __inline__ int test_bit(int nr, const volatile void * addr)
113 return ((1UL << (nr & 31)) & (((const volatile unsigned int *) addr)[nr >> 5])) != 0;
116 static __inline__ void set_bit(int nr, volatile void * addr)
118 (((volatile unsigned int *) addr)[nr >> 5]) |= (1UL << (nr & 31));
121 #ifdef WORDS_BIGENDIAN
122 static __inline__ u32 cpu_to_le32( u32 x )
124 u32 res = ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \
125 (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24));
127 return res;
129 #else
130 #define cpu_to_le32(x) x
131 #endif
133 #endif /* AHI_Drivers_EMU10kx_linuxsupport_h */