18
18
namespace Kernel {
19
19
Atomic<u8 > NVMeController::controller_id {};
20
20
21
- ErrorOr<NonnullRefPtr<NVMeController>> NVMeController::try_initialize (const Kernel::PCI::DeviceIdentifier& device_identifier)
21
+ UNMAP_AFTER_INIT ErrorOr<NonnullRefPtr<NVMeController>> NVMeController::try_initialize (const Kernel::PCI::DeviceIdentifier& device_identifier)
22
22
{
23
23
auto controller = TRY (adopt_nonnull_ref_or_enomem (new NVMeController (device_identifier)));
24
24
TRY (controller->initialize ());
25
25
NVMeController::controller_id++;
26
26
return controller;
27
27
}
28
28
29
- NVMeController::NVMeController (const PCI::DeviceIdentifier& device_identifier)
29
+ UNMAP_AFTER_INIT NVMeController::NVMeController (const PCI::DeviceIdentifier& device_identifier)
30
30
: PCI::Device(device_identifier.address())
31
31
, m_pci_device_id(device_identifier)
32
32
{
33
33
}
34
34
35
- ErrorOr<void > NVMeController::initialize ()
35
+ UNMAP_AFTER_INIT ErrorOr<void > NVMeController::initialize ()
36
36
{
37
37
// Nr of queues = one queue per core
38
38
auto nr_of_queues = Processor::count ();
@@ -138,7 +138,7 @@ bool NVMeController::start_controller()
138
138
return true ;
139
139
}
140
140
141
- u32 NVMeController::get_admin_q_dept ()
141
+ UNMAP_AFTER_INIT u32 NVMeController::get_admin_q_dept ()
142
142
{
143
143
u32 aqa = m_controller_regs->aqa ;
144
144
// Queue depth is 0 based
@@ -147,7 +147,7 @@ u32 NVMeController::get_admin_q_dept()
147
147
return q_depth;
148
148
}
149
149
150
- ErrorOr<void > NVMeController::identify_and_init_namespaces ()
150
+ UNMAP_AFTER_INIT ErrorOr<void > NVMeController::identify_and_init_namespaces ()
151
151
{
152
152
153
153
RefPtr<Memory::PhysicalPage> prp_dma_buffer;
@@ -213,7 +213,7 @@ ErrorOr<void> NVMeController::identify_and_init_namespaces()
213
213
return {};
214
214
}
215
215
216
- Tuple<u64 , u8 > NVMeController::get_ns_features (IdentifyNamespace& identify_data_struct)
216
+ UNMAP_AFTER_INIT Tuple<u64 , u8 > NVMeController::get_ns_features (IdentifyNamespace& identify_data_struct)
217
217
{
218
218
auto flbas = identify_data_struct.flbas & FLBA_SIZE_MASK;
219
219
auto namespace_size = identify_data_struct.nsze ;
@@ -253,7 +253,7 @@ void NVMeController::complete_current_request([[maybe_unused]] AsyncDeviceReques
253
253
VERIFY_NOT_REACHED ();
254
254
}
255
255
256
- ErrorOr<void > NVMeController::create_admin_queue (u8 irq)
256
+ UNMAP_AFTER_INIT ErrorOr<void > NVMeController::create_admin_queue (u8 irq)
257
257
{
258
258
auto qdepth = get_admin_q_dept ();
259
259
OwnPtr<Memory::Region> cq_dma_region;
@@ -296,7 +296,7 @@ ErrorOr<void> NVMeController::create_admin_queue(u8 irq)
296
296
return {};
297
297
}
298
298
299
- ErrorOr<void > NVMeController::create_io_queue (u8 irq, u8 qid)
299
+ UNMAP_AFTER_INIT ErrorOr<void > NVMeController::create_io_queue (u8 irq, u8 qid)
300
300
{
301
301
NVMeSubmission sub {};
302
302
OwnPtr<Memory::Region> cq_dma_region;
0 commit comments