NeKernel dev
Loading...
Searching...
No Matches
ACPIFactoryInterface.h
Go to the documentation of this file.
1/* ========================================
2
3 Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license.
4
5======================================== */
6
7#ifndef __MOD_ACPI_H__
8#define __MOD_ACPI_H__
9
11#include <NeKit/Config.h>
12#include <NeKit/ErrorOr.h>
13#include <NeKit/Ref.h>
14#include <modules/ACPI/ACPI.h>
16
17namespace Kernel {
18class PowerFactory;
19class ACPIFactoryInterface;
20
21typedef ACPIFactoryInterface PowerFactoryInterface;
22
24 public:
25 explicit ACPIFactoryInterface(voidPtr rsp_ptr);
27
30
31 public:
32 Bool Shutdown(); // shutdown
33 Void Reboot(); // soft-reboot
34
35 public:
39 ErrorOr<voidPtr> Find(const Char* signature);
40
45 bool Checksum(const Char* checksum, SSizeT len); // watch for collides!
46
47 public:
48 ErrorOr<voidPtr> operator[](const Char* signature);
49
50 private:
51 VoidPtr fRsdp{nullptr}; // pointer to root descriptor.
52 SizeT fEntries{0UL}; // number of entries, -1 tells that no invalid entries were
53 // found.
54};
55} // namespace Kernel
56
57#endif // !__MOD_ACPI_H__
ErrorOr class for error handling.
Definition ErrorOr.h:22
Definition ACPIFactoryInterface.h:23
bool Checksum(const Char *checksum, SSizeT len)
Checksum factory.
ACPIFactoryInterface(const ACPIFactoryInterface &)=default
SizeT fEntries
Definition ACPIFactoryInterface.h:52
ACPIFactoryInterface & operator=(const ACPIFactoryInterface &)=default
ErrorOr< voidPtr > Find(const Char *signature)
Descriptor find factory.
ACPIFactoryInterface(voidPtr rsp_ptr)
ErrorOr< voidPtr > operator[](const Char *signature)
VoidPtr fRsdp
Definition ACPIFactoryInterface.h:51
Definition PowerFactory.h:18
UPS inline definitions.
Definition Device.h:12
char Char
Definition Config.h:51
void Void
Definition Config.h:87
long SSizeT
Definition Config.h:58
ACPIFactoryInterface PowerFactoryInterface
Definition ACPIFactoryInterface.h:21
void * voidPtr
Definition Config.h:32
__SIZE_TYPE__ SizeT
Definition Config.h:60
void * VoidPtr
Definition Config.h:33
bool Bool
Definition Config.h:50