~aleteoryx/muditaos

ref: b83605d227599dd29c9d16a552a95f281c28aae4 muditaos/module-vfs/include/user/purefs/blkdev/defs.hpp -rw-r--r-- 1.7 KiB
b83605d2 — Lucjan Bryndza [EGD-7573] Add support for reliance edge fs 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once
#include <cstdint>
#include <memory>

namespace purefs::blkdev
{
    //! Unsigned sector type
    using sector_t = uint64_t;
    //! Signed sector type
    using scount_t = int64_t;
    //! Hardware partition type
    using hwpart_t = uint8_t;
    //! Common partition type
    using part_t = int16_t;
    //! Default hardware partition
    constexpr hwpart_t default_hw_partition = 0;
    namespace internal
    {
        class disk_handle;
    }
    using disk_fd = std::shared_ptr<internal::disk_handle>;
    //! Disk status result
    enum class media_status
    {
        healthly, //! Disk OK
        uninit,   //! Disk unintialized
        nomedia,  //! No media
        wprotect, //! Write protected
        error,    //! Internal error
    };
    // Information parameter
    enum class info_type
    {
        sector_count, //! Number of sectors on disk or part
        sector_size,  //! Single sector size
        erase_block,  //! Number of sectors in erase block
        start_sector  //! First sector
    };

    //! Power control states
    enum class pm_state
    {
        active,        //! Device is in active state
        low_power,     //! Device is in low power state
        suspend,       //! Device is in suspend state
        force_suspend, //! Device is in force suspend state
        power_off      //! Device is in poweroff state
    };

    //! Disk manager flags
    struct flags
    {
        enum _flags
        {
            no_parts_scan = 0x1 //! Don't scan partitions on disc
        };
    };
} // namespace purefs::blkdev