mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-08 04:15:23 +03:00
ac7ce12123
This was a premature optimization from the early days of SerenityOS. The eternal heap was a simple bump pointer allocator over a static byte array. My original idea was to avoid heap fragmentation and improve data locality, but both ideas were rooted in cargo culting, not data. We would reserve 4 MiB at boot and only ended up using ~256 KiB, wasting the rest. This patch replaces all kmalloc_eternal() usage by regular kmalloc().
39 lines
903 B
C++
39 lines
903 B
C++
/*
|
|
* Copyright (c) 2020, Liav A. <liavalb@hotmail.co.il>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/OwnPtr.h>
|
|
#include <AK/RefPtr.h>
|
|
#include <Kernel/Bus/PCI/Access.h>
|
|
#include <Kernel/Bus/PCI/Device.h>
|
|
#include <Kernel/Devices/Device.h>
|
|
#include <Kernel/Locking/Mutex.h>
|
|
#include <Kernel/Memory/PhysicalPage.h>
|
|
#include <Kernel/PhysicalAddress.h>
|
|
#include <Kernel/Random.h>
|
|
#include <Kernel/WaitQueue.h>
|
|
|
|
namespace Kernel {
|
|
|
|
class AsyncBlockDeviceRequest;
|
|
class StorageDevice;
|
|
class StorageController : public RefCounted<StorageController> {
|
|
|
|
public:
|
|
virtual ~StorageController() = default;
|
|
|
|
virtual RefPtr<StorageDevice> device(u32 index) const = 0;
|
|
virtual size_t devices_count() const = 0;
|
|
|
|
protected:
|
|
virtual bool reset() = 0;
|
|
virtual bool shutdown() = 0;
|
|
|
|
virtual void complete_current_request(AsyncDeviceRequest::RequestResult) = 0;
|
|
};
|
|
}
|