Minor fixes to comments.
[AROS.git] / rom / efi / findconfigtable.c
blob07ea7e79dc486a9d9c82a56684de65b45c6f7be6
1 #include <aros/debug.h>
2 #include <libraries/uuid.h>
4 #include <string.h>
6 #ifdef DEBUG_UUID
8 static void PRINT_UUID(uuid_t *id)
10 unsigned int i;
12 bug("[EFI] Table UUID: 0x%08X-%04X-%04X-%02X%02X-",
13 id->time_low, id->time_mid, id->time_hi_and_version,
14 id->clock_seq_hi_and_reserved, id->clock_seq_low);
16 for (i = 0; i < sizeof(id->node); i++)
17 bug("%02X", id->node[i]);
19 RawPutChar('\n');
22 #else
23 #define PRINT_UUID(id)
24 #endif
26 /*****************************************************************************
28 NAME */
29 #include <proto/efi.h>
31 AROS_LH1(void *, EFI_FindConfigTable,
33 /* SYNOPSIS */
34 AROS_LHA(const uuid_t *, Guid, A0),
36 /* LOCATION */
37 struct EFIBase *, EFIBase, 1, Efi)
39 /* FUNCTION
40 Locate a configuration table by GUID
42 INPUTS
43 Guid - a pointer to a GUID structure
45 RESULT
46 A pointer to a table or NULL if nothing found.
48 NOTES
50 EXAMPLE
52 BUGS
54 SEE ALSO
56 INTERNALS
58 ******************************************************************************/
60 AROS_LIBFUNC_INIT
62 struct EFI_Config *conf = EFIBase->System->ConfigTable;
63 IPTR i;
65 /* Safety */
66 if (!conf)
67 return NULL;
69 for (i = 0; i < EFIBase->System->NumEntries; i++)
71 PRINT_UUID(&conf[i].VendorGUID);
73 if (!memcmp(&conf[i].VendorGUID, Guid, sizeof(uuid_t)))
75 return conf[i].Table;
79 return NULL;
81 AROS_LIBFUNC_EXIT