4 ISA-PnP -- A Plug And Play ISA software layer for AmigaOS.
5 Copyright (C) 2001 Martin Blom <martin@blom.org>
6 Copyright (C) 2009-2013 The AROS Development Team
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Library General Public License for more details.
18 You should have received a copy of the GNU Library General Public
19 License along with this library; if not, write to the
20 Free Software Foundation, Inc., 59 Temple Place - Suite 330, Cambridge,
25 #include <libraries/configvars.h>
26 #include <libraries/expansion.h>
28 #include <proto/expansion.h>
30 #include "controller.h"
31 #include "isapnp_private.h"
33 /******************************************************************************
34 *** Controller functions ******************************************************
35 ******************************************************************************/
37 AROS_LH1(void, ISAC_SetMasterInt
,
38 AROS_LHA(BOOL
, on
, D0
),
39 struct ISAPNPBase
*, res
, 1, ISAPNP
)
43 /* On a PC we have no interrupt mapping so we don't have a 'master interrupt' */
49 AROS_LH0(BOOL
, ISAC_GetMasterInt
,
50 struct ISAPNPBase
*, res
, 2, ISAPNP
)
60 AROS_LH1(void, ISAC_SetWaitState
,
61 AROS_LHA(BOOL
, on
, D0
),
62 struct ISAPNPBase
*, res
, 3, ISAPNP
)
66 /* On a PC we can't control it */
72 AROS_LH0(BOOL
, ISAC_GetWaitState
,
73 struct ISAPNPBase
*, res
, 4, ISAPNP
)
83 AROS_LH1(BOOL
, ISAC_GetInterruptStatus
,
84 AROS_LHA(UBYTE
, interrupt
, D0
),
85 struct ISAPNPBase
*, res
, 5, ISAPNP
)
89 bug("[ISAPNP] ISAC_GetInterruptStatus() is not implemented\n");
90 /*UWORD* reg1 = (UWORD*)( res->m_Base + 0x18000 );
95 return ( ReadWord( reg1 ) & 4 ) != 0;
98 return ( ReadWord( reg1 ) & 8 ) != 0;
101 return ( ReadWord( reg1 ) & 16 ) != 0;
104 return ( ReadWord( reg1 ) & 32 ) != 0;
107 return ( ReadWord( reg1 ) & 64 ) != 0;
110 return ( ReadWord( reg1 ) & 128 ) != 0;
113 return ( ReadWord( reg1 ) & 256 ) != 0;
116 return ( ReadWord( reg1 ) & 512 ) != 0;
119 return ( ReadWord( reg1 ) & 1024 ) != 0;
122 return ( ReadWord( reg1 ) & 2048 ) != 0;
125 return ( ReadWord( reg1 ) & 4096 ) != 0;
134 AROS_LH1(UBYTE
, ISAC_GetRegByte
,
135 AROS_LHA(UWORD
, reg
, D0
),
136 struct ISAPNPBase
*, res
, 6, ISAPNP
)
146 AROS_LH2(void, ISAC_SetRegByte
,
147 AROS_LHA(UWORD
, reg
, D0
),
148 AROS_LHA(UBYTE
, value
, D1
),
149 struct ISAPNPBase
*, res
, 7, ISAPNP
)
159 AROS_LH1(UWORD
, ISAC_GetRegWord
,
160 AROS_LHA(UWORD
, reg
, D0
),
161 struct ISAPNPBase
*, res
, 8, ISAPNP
)
171 AROS_LH2(void, ISAC_SetRegWord
,
172 AROS_LHA(UWORD
, reg
, D0
),
173 AROS_LHA(UWORD
, value
, D1
),
174 struct ISAPNPBase
*, res
, 9, ISAPNP
)
184 AROS_LH1(ULONG
, ISAC_GetRegLong
,
185 AROS_LHA(UWORD
, reg
, D0
),
186 struct ISAPNPBase
*, res
, 10, ISAPNP
)
196 AROS_LH2(void, ISAC_SetRegLong
,
197 AROS_LHA(UWORD
, reg
, D0
),
198 AROS_LHA(ULONG
, value
, D1
),
199 struct ISAPNPBase
*, res
, 11, ISAPNP
)
209 AROS_LH1(UBYTE
, ISAC_ReadByte
,
210 AROS_LHA(ULONG
, address
, D0
),
211 struct ISAPNPBase
*, res
, 12, ISAPNP
)
215 return *(UBYTE
*)address
;
221 AROS_LH2(void, ISAC_WriteByte
,
222 AROS_LHA(ULONG
, address
, D0
),
223 AROS_LHA(UBYTE
, value
, D1
),
224 struct ISAPNPBase
*, res
, 13, ISAPNP
)
228 *(UBYTE
*)address
= value
;
234 AROS_LH1(UWORD
, ISAC_ReadWord
,
235 AROS_LHA(ULONG
, address
, D0
),
236 struct ISAPNPBase
*, res
, 14, ISAPNP
)
240 return *(UWORD
*)address
;
246 AROS_LH2(void, ISAC_WriteWord
,
247 AROS_LHA(ULONG
, address
, D0
),
248 AROS_LHA(UWORD
, value
, D1
),
249 struct ISAPNPBase
*, res
, 15, ISAPNP
)
253 *(UWORD
*)address
= value
;
259 AROS_LH1(UWORD
, ISAC_ReadLong
,
260 AROS_LHA(ULONG
, address
, D0
),
261 struct ISAPNPBase
*, res
, 16, ISAPNP
)
265 return *(ULONG
*)address
;
271 AROS_LH2(void, ISAC_WriteLong
,
272 AROS_LHA(ULONG
, address
, D0
),
273 AROS_LHA(ULONG
, value
, D1
),
274 struct ISAPNPBase
*, res
, 17, ISAPNP
)
278 *(ULONG
*)address
= value
;