mirror of
https://github.com/JannisHeydemann/BoredOS.git
synced 2026-05-30 02:16:58 +00:00
pr: Standardize string functions for freestanding env #29
This commit is contained in:
committed by
GitHub
parent
51900ca0a7
commit
f171ff7278
@@ -55,7 +55,7 @@ static struct acpi_sdt *acpi_get_sdt(const char signature[4]) {
|
||||
for (size_t i = 0; i < entries; i++) {
|
||||
struct acpi_sdt *tbl = (struct acpi_sdt *)p2v(acpi_xsdt->tables[i]);
|
||||
if (!tbl) continue;
|
||||
if (!k_memcmp(tbl->signature, signature, 4))
|
||||
if (!memcmp(tbl->signature, signature, 4))
|
||||
return tbl;
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,7 @@ static struct acpi_sdt *acpi_get_sdt(const char signature[4]) {
|
||||
for (size_t i = 0; i < entries; i++) {
|
||||
struct acpi_sdt *tbl = (struct acpi_sdt *)p2v(tables[i]);
|
||||
if (!tbl) continue;
|
||||
if (!k_memcmp(tbl->signature, signature, 4))
|
||||
if (!memcmp(tbl->signature, signature, 4))
|
||||
return tbl;
|
||||
}
|
||||
|
||||
@@ -89,14 +89,14 @@ void acpi_parse_s5(void) {
|
||||
|
||||
char *dsdt = (char *)p2v((uintptr_t)acpi_fadt->dsdt);
|
||||
|
||||
if (k_memcmp(dsdt, "DSDT", 4) != 0) return;
|
||||
if (memcmp(dsdt, "DSDT", 4) != 0) return;
|
||||
|
||||
uint32_t dsdt_len = *(uint32_t*)(dsdt + 4);
|
||||
char *ptr = dsdt + 36;
|
||||
char *end = dsdt + dsdt_len;
|
||||
|
||||
while (ptr < end) {
|
||||
if (k_memcmp(ptr, "_S5_", 4) == 0) {
|
||||
if (memcmp(ptr, "_S5_", 4) == 0) {
|
||||
ptr += 4;
|
||||
if (*ptr == 0x12) {
|
||||
ptr += 3;
|
||||
|
||||
Reference in New Issue
Block a user