mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
Kernel/aarch64: Move query_firmware_version into RPi::Mailbox
This is for the upcoming commit that merges the x86_64 and aarch64 init.cpp files.
This commit is contained in:
parent
2613ac4cb4
commit
14d20618f1
Notes:
sideshowbarker
2024-07-17 03:45:48 +09:00
Author: https://github.com/FireFox317 Commit: https://github.com/SerenityOS/serenity/commit/14d20618f1 Pull-request: https://github.com/SerenityOS/serenity/pull/18131 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/kleinesfilmroellchen ✅ Reviewed-by: https://github.com/nico ✅
3 changed files with 30 additions and 30 deletions
|
@ -104,4 +104,30 @@ bool Mailbox::send_queue(void* queue, u32 queue_size) const
|
|||
return true;
|
||||
}
|
||||
|
||||
class QueryFirmwareVersionMboxMessage : RPi::Mailbox::Message {
|
||||
public:
|
||||
u32 version;
|
||||
|
||||
QueryFirmwareVersionMboxMessage()
|
||||
: RPi::Mailbox::Message(0x0000'0001, 4)
|
||||
{
|
||||
version = 0;
|
||||
}
|
||||
};
|
||||
|
||||
u32 Mailbox::query_firmware_version()
|
||||
{
|
||||
struct __attribute__((aligned(16))) {
|
||||
MessageHeader header;
|
||||
QueryFirmwareVersionMboxMessage query_firmware_version;
|
||||
MessageTail tail;
|
||||
} message_queue;
|
||||
|
||||
if (!the().send_queue(&message_queue, sizeof(message_queue))) {
|
||||
return 0xffff'ffff;
|
||||
}
|
||||
|
||||
return message_queue.query_firmware_version.version;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -49,6 +49,8 @@ public:
|
|||
|
||||
// Sends message queue to VideoCore
|
||||
bool send_queue(void* queue, u32 queue_size) const;
|
||||
|
||||
u32 query_firmware_version();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -47,8 +47,6 @@ READONLY_AFTER_INIT bool g_in_early_boot;
|
|||
|
||||
namespace Kernel {
|
||||
|
||||
static u32 query_firmware_version();
|
||||
|
||||
extern "C" [[noreturn]] void halt();
|
||||
extern "C" [[noreturn]] void init();
|
||||
|
||||
|
@ -68,8 +66,8 @@ void init_stage2(void*)
|
|||
{
|
||||
Process::register_new(Process::current());
|
||||
|
||||
auto firmware_version = query_firmware_version();
|
||||
dmesgln("Firmware version: {}", firmware_version);
|
||||
auto firmware_version = RPi::Mailbox::the().query_firmware_version();
|
||||
dmesgln("RPi: Firmware version: {}", firmware_version);
|
||||
|
||||
VirtualFileSystem::initialize();
|
||||
|
||||
|
@ -179,30 +177,4 @@ extern "C" [[noreturn]] void init()
|
|||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
class QueryFirmwareVersionMboxMessage : RPi::Mailbox::Message {
|
||||
public:
|
||||
u32 version;
|
||||
|
||||
QueryFirmwareVersionMboxMessage()
|
||||
: RPi::Mailbox::Message(0x0000'0001, 4)
|
||||
{
|
||||
version = 0;
|
||||
}
|
||||
};
|
||||
|
||||
static u32 query_firmware_version()
|
||||
{
|
||||
struct __attribute__((aligned(16))) {
|
||||
RPi::Mailbox::MessageHeader header;
|
||||
QueryFirmwareVersionMboxMessage query_firmware_version;
|
||||
RPi::Mailbox::MessageTail tail;
|
||||
} message_queue;
|
||||
|
||||
if (!RPi::Mailbox::the().send_queue(&message_queue, sizeof(message_queue))) {
|
||||
return 0xffff'ffff;
|
||||
}
|
||||
|
||||
return message_queue.query_firmware_version.version;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue