libsa: smbios_detect(): Return the entry point address

In particular, this allows the caller to know whether the detection was
successful.

Reviewed by:    imp, markj
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D49290
This commit is contained in:
Olivier Certner
2025-03-05 11:27:50 +01:00
parent c340797e08
commit 9dad0ba286
2 changed files with 5 additions and 3 deletions
+4 -2
View File
@@ -635,7 +635,7 @@ smbios_probe(const caddr_t addr)
}
}
void
caddr_t
smbios_detect(const caddr_t addr)
{
char buf[16];
@@ -644,7 +644,7 @@ smbios_detect(const caddr_t addr)
smbios_probe(addr);
if (smbios.addr == NULL)
return;
return (NULL);
for (dmi = smbios.addr, i = 0; dmi != NULL &&
dmi < smbios.addr + smbios.length && i < smbios.count; i++)
@@ -667,6 +667,8 @@ smbios_detect(const caddr_t addr)
sprintf(buf, "%u", smbios.populated_sockets);
setenv("smbios.socket.populated", buf, 1);
}
return (smbios.addr);
}
static int
+1 -1
View File
@@ -26,7 +26,7 @@
#ifndef _SMBIOS_H_
#define _SMBIOS_H_
void smbios_detect(const caddr_t);
caddr_t smbios_detect(const caddr_t);
int smbios_match(const char *, const char *, const char *);
#endif /* _SMBIOS_H_ */