revert between 56095 -> 55830 in arch
[AROS.git] / arch / all-pc / hpet / getunitattrsa.c
blob78f7f064690c64776bae50e7b3e12b5196af35fb
1 /*
2 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <resources/hpet.h>
7 #include <proto/arossupport.h>
9 #include "hpet_intern.h"
11 /*****************************************************************************
13 NAME */
14 #include <proto/hpet.h>
16 AROS_LH2(BOOL, GetUnitAttrsA,
18 /* SYNOPSIS */
19 AROS_LHA(ULONG, unit, D0),
20 AROS_LHA(const struct TagItem *, tags, A0),
22 /* LOCATION */
23 struct HPETBase *, base, 4, Hpet)
25 /* FUNCTION
26 Query attributes of HPET unit.
28 INPUTS
29 unit - a number of previously allocated HPET unit.
31 RESULT
32 TRUE in case of success or FALSE if the given unit number is out of range.
34 NOTES
36 EXAMPLE
38 BUGS
40 SEE ALSO
42 INTERNALS
44 ******************************************************************************/
46 AROS_LIBFUNC_INIT
48 struct TagItem *tag, *tstate = (struct TagItem *)tags;
50 /* Owner is the only thing which can be modified, so we don't need a semaphore here */
52 if (unit >= base->unitCnt)
53 return FALSE;
55 while ((tag = LibNextTagItem(&tstate)))
57 switch (tag->ti_Tag)
59 case HPET_BASE_ADDR:
60 *(IPTR *)tag->ti_Data = base->units[unit].base;
61 break;
63 case HPET_UNIT_ADDR:
64 *(IPTR *)tag->ti_Data = base->units[unit].block;
65 break;
67 case HPET_UNIT_OWNER:
68 *(const char **)tag->ti_Data = base->units[unit].Owner;
69 break;
73 return TRUE;
75 AROS_LIBFUNC_EXIT