2020-02-01 23:28:39 +02:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2020, Liav A. <liavalb@hotmail.co.il>
|
|
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-02-01 23:28:39 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2020-12-26 16:53:30 +02:00
|
|
|
#include <AK/NonnullOwnPtr.h>
|
2020-02-01 23:28:39 +02:00
|
|
|
#include <AK/RefPtr.h>
|
2020-12-26 16:53:30 +02:00
|
|
|
#include <AK/Result.h>
|
2020-02-01 23:28:39 +02:00
|
|
|
#include <AK/Vector.h>
|
2020-12-25 20:23:35 +02:00
|
|
|
#include <Kernel/Storage/Partition/DiskPartition.h>
|
|
|
|
|
#include <Kernel/Storage/Partition/MBRPartitionTable.h>
|
2020-02-01 23:28:39 +02:00
|
|
|
|
2020-02-16 01:27:42 +01:00
|
|
|
namespace Kernel {
|
|
|
|
|
|
2020-12-26 16:53:30 +02:00
|
|
|
struct EBRPartitionHeader;
|
|
|
|
|
class EBRPartitionTable : public MBRPartitionTable {
|
2020-02-01 23:28:39 +02:00
|
|
|
public:
|
|
|
|
|
~EBRPartitionTable();
|
|
|
|
|
|
2020-12-26 16:53:30 +02:00
|
|
|
static Result<NonnullOwnPtr<EBRPartitionTable>, PartitionTable::Error> try_to_initialize(const StorageDevice&);
|
|
|
|
|
explicit EBRPartitionTable(const StorageDevice&);
|
|
|
|
|
virtual bool is_valid() const override { return m_valid; };
|
2020-02-01 23:28:39 +02:00
|
|
|
|
|
|
|
|
private:
|
2020-12-26 16:53:30 +02:00
|
|
|
void search_extended_partition(const StorageDevice&, MBRPartitionTable&, u64, size_t limit);
|
2020-02-01 23:28:39 +02:00
|
|
|
|
2020-12-26 16:53:30 +02:00
|
|
|
bool m_valid { false };
|
2020-02-01 23:28:39 +02:00
|
|
|
};
|
2020-02-16 01:27:42 +01:00
|
|
|
}
|