1 #include <resources/acpi.h>
2 #include <utility/hooks.h>
4 /*****************************************************************************
7 #include <proto/acpi.h>
9 AROS_LH3(ULONG
, ACPI_ScanSDT
,
12 AROS_LHA(ULONG
, id
, D0
),
13 AROS_LHA(const struct Hook
*, hook
, A0
),
14 AROS_LHA(APTR
, userdata
, A1
),
17 struct ACPIBase
*, ACPIBase
, 5, Acpi
)
20 Scan multiple system description tables with the given signature.
23 id - a signature of the table(s) to scan. Supply ACPI_ID_ALL
24 to enumerate all tables.
25 hook - a hook to call. The hook will be called with 'object'
26 argument set to table pointer, and 'paramPacket' set to
27 'userdata' argument. You can pass a NULL here in order just
28 to count the number of tables.
29 userdata - a user-supplied data to pass to the hook.
32 Total number of processed tables. The table is considered processed if
33 either supplied hook returns nonzero value, or there's no hook supplied.
36 Root tables, containing no data but only pointers to other tables
37 (like RSDT and XSDT) are not included in the scan.
48 ******************************************************************************/
53 struct ACPI_TABLE_DEF_HEADER
*header
;
56 for (i
= 0; i
< ACPIBase
->ACPIB_SDT_Count
; i
++)
58 header
= ACPIBase
->ACPIB_SDT_Entry
[i
];
60 if ((id
== ACPI_ID_ALL
) || (id
== header
->signature
))
64 BOOL res
= CALLHOOKPKT((struct Hook
*)hook
, header
, userdata
);