4 ISA-PnP -- A Plug And Play ISA software layer for AmigaOS.
5 Copyright (C) 2001 Martin Blom <martin@blom.org>
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
17 You should have received a copy of the GNU Library General Public
18 License along with this library; if not, write to the
19 Free Software Foundation, Inc., 59 Temple Place - Suite 330, Cambridge,
24 #include <libraries/configvars.h>
25 #include <libraries/expansion.h>
27 #include <proto/expansion.h>
29 #include "controller.h"
30 #include "isapnp_private.h"
32 /******************************************************************************
33 *** Controller functions ******************************************************
34 ******************************************************************************/
37 ISAC_SetMasterInt( REG( d0
, BOOL on
),
38 REG( a6
, struct ISAPNPBase
* res
) )
40 /* On a PC we have no interrupt mapping so we don't have a 'master interrupt' */
45 ISAC_GetMasterInt( REG( a6
, struct ISAPNPBase
* res
) )
52 ISAC_SetWaitState( REG( d0
, BOOL on
),
53 REG( a6
, struct ISAPNPBase
* res
) )
55 /* On a PC we can't control it */
60 ISAC_GetWaitState( REG( a6
, struct ISAPNPBase
* res
) )
67 ISAC_GetInterruptStatus( REG( d0
, UBYTE interrupt
),
68 REG( a6
, struct ISAPNPBase
* res
) )
70 bug("[ISAPNP] ISAC_GetInterruptStatus() is not implemented\n");
71 /*UWORD* reg1 = (UWORD*)( res->m_Base + 0x18000 );
76 return ( ReadWord( reg1 ) & 4 ) != 0;
79 return ( ReadWord( reg1 ) & 8 ) != 0;
82 return ( ReadWord( reg1 ) & 16 ) != 0;
85 return ( ReadWord( reg1 ) & 32 ) != 0;
88 return ( ReadWord( reg1 ) & 64 ) != 0;
91 return ( ReadWord( reg1 ) & 128 ) != 0;
94 return ( ReadWord( reg1 ) & 256 ) != 0;
97 return ( ReadWord( reg1 ) & 512 ) != 0;
100 return ( ReadWord( reg1 ) & 1024 ) != 0;
103 return ( ReadWord( reg1 ) & 2048 ) != 0;
106 return ( ReadWord( reg1 ) & 4096 ) != 0;
114 ISAC_GetRegByte( REG( d0
, UWORD reg
),
115 REG( a6
, struct ISAPNPBase
* res
) )
122 ISAC_SetRegByte( REG( d0
, UWORD reg
),
123 REG( d1
, UBYTE value
),
124 REG( a6
, struct ISAPNPBase
* res
) )
131 ISAC_GetRegWord( REG( d0
, UWORD reg
),
132 REG( a6
, struct ISAPNPBase
* res
) )
139 ISAC_SetRegWord( REG( d0
, UWORD reg
),
140 REG( d1
, UWORD value
),
141 REG( a6
, struct ISAPNPBase
* res
) )
148 ISAC_GetRegLong( REG( d0
, UWORD reg
),
149 REG( a6
, struct ISAPNPBase
* res
) )
156 ISAC_SetRegLong( REG( d0
, UWORD reg
),
157 REG( d1
, ULONG value
),
158 REG( a6
, struct ISAPNPBase
* res
) )
165 ISAC_ReadByte( REG( d0
, ULONG address
),
166 REG( a6
, struct ISAPNPBase
* res
) )
168 return *(UBYTE
*)address
;
173 ISAC_WriteByte( REG( d0
, ULONG address
),
174 REG( d1
, UBYTE value
),
175 REG( a6
, struct ISAPNPBase
* res
) )
177 *(UBYTE
*)address
= value
;
182 ISAC_ReadWord( REG( d0
, ULONG address
),
183 REG( a6
, struct ISAPNPBase
* res
) )
185 return *(UWORD
*)address
;
190 ISAC_WriteWord( REG( d0
, ULONG address
),
191 REG( d1
, UWORD value
),
192 REG( a6
, struct ISAPNPBase
* res
) )
194 *(UWORD
*)address
= value
;
199 ISAC_ReadLong( REG( d0
, ULONG address
),
200 REG( a6
, struct ISAPNPBase
* res
) )
202 return *(ULONG
*)address
;
207 ISAC_WriteLong( REG( d0
, ULONG address
),
208 REG( d1
, ULONG value
),
209 REG( a6
, struct ISAPNPBase
* res
) )
211 *(ULONG
*)address
= value
;