2020-02-01 18:28:39 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2020, Liav A. <liavalb@hotmail.co.il>
|
|
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-02-01 18:28:39 -03:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2020-12-26 11:53:30 -03:00
|
|
|
#include <AK/NonnullOwnPtr.h>
|
2020-02-01 18:28:39 -03:00
|
|
|
#include <AK/RefPtr.h>
|
2020-12-26 11:53:30 -03:00
|
|
|
#include <AK/Result.h>
|
2020-02-01 18:28:39 -03:00
|
|
|
#include <AK/Vector.h>
|
2020-12-25 15:23:35 -03:00
|
|
|
#include <Kernel/Storage/Partition/DiskPartition.h>
|
|
|
|
|
#include <Kernel/Storage/Partition/MBRPartitionTable.h>
|
2020-02-01 18:28:39 -03:00
|
|
|
|
2020-02-15 21:27:42 -03:00
|
|
|
namespace Kernel {
|
|
|
|
|
|
2020-12-26 11:53:30 -03:00
|
|
|
struct EBRPartitionHeader;
|
|
|
|
|
class EBRPartitionTable : public MBRPartitionTable {
|
2020-02-01 18:28:39 -03:00
|
|
|
public:
|
|
|
|
|
~EBRPartitionTable();
|
|
|
|
|
|
2020-12-26 11:53:30 -03: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 18:28:39 -03:00
|
|
|
|
|
|
|
|
private:
|
2020-12-26 11:53:30 -03:00
|
|
|
void search_extended_partition(const StorageDevice&, MBRPartitionTable&, u64, size_t limit);
|
2020-02-01 18:28:39 -03:00
|
|
|
|
2020-12-26 11:53:30 -03:00
|
|
|
bool m_valid { false };
|
2020-02-01 18:28:39 -03:00
|
|
|
};
|
2020-02-15 21:27:42 -03:00
|
|
|
}
|