Revert "Host (Haiku): add debug log"

This reverts commit f3e54f33c2efb63bf9feb16bc202c8d8e5389cc8.
This commit is contained in:
李通洲 2025-02-15 19:47:16 +08:00
parent 532b3cd457
commit 34419d9bcf

View File

@ -234,46 +234,42 @@ const FFSmbiosHeaderTable* ffGetSmbiosHeaderTable()
off_t tableAddress = 0;
FF_AUTO_CLOSE_FD int fd = open("/dev/misc/mem", O_RDONLY);
if (fd < 0)
{perror("open(mem)");return NULL;}
return NULL;
FF_AUTO_FREE uint8_t* smBiosBase = malloc(0x10000);
if (pread(fd, smBiosBase, 0x10000, 0xF0000) != 0x10000)
{perror("pread(fd)");return NULL;}
puts("read(mem) ok");
return NULL;
for (off_t offset = 0; offset <= 0xffe0; offset += 0x10)
{
FFSmbiosEntryPoint* p = (void*)(smBiosBase + offset);
if (memcmp(p, "_SM3_", sizeof(p->Smbios30.AnchorString)) == 0)
{
puts("found SM3");
if (p->Smbios30.EntryPointLength != sizeof(p->Smbios30))
{puts("invalid sm3 entry length"); return NULL;}
return NULL;
tableLength = p->Smbios30.StructureTableMaximumSize;
tableAddress = (off_t) p->Smbios30.StructureTableAddress;
break;
}
else if (memcmp(p, "_SM_", sizeof(p->Smbios20.AnchorString)) == 0)
{
puts("found SM2");
if (p->Smbios20.EntryPointLength != sizeof(p->Smbios20))
{
puts("invalid sm2 entry length");return NULL;}
return NULL;
tableLength = p->Smbios20.StructureTableLength;
tableAddress = (off_t) p->Smbios20.StructureTableAddress;
break;
}
}
if (tableLength == 0)
{puts("nothing found");return NULL;}
printf("found table length: %d\n", (int)tableLength);
return NULL;
ffStrbufEnsureFixedLengthFree(&buffer, tableLength);
if (pread(fd, buffer.chars, tableLength, tableAddress) == tableLength)
{
puts("pread(table) done");
buffer.length = tableLength;
buffer.chars[buffer.length] = '\0';
}
else
{perror("pread(table)");return NULL;}
return NULL;
}
#endif
@ -293,8 +289,6 @@ const FFSmbiosHeaderTable* ffGetSmbiosHeaderTable()
}
}
puts("Everything is ok");
return &table;
}
#elif defined(_WIN32)