summaryrefslogtreecommitdiffhomepage
path: root/src/kernel/StorageKit/PRDT.h
blob: da9e484d692428ebf7275c019d749d2f6ae4c8b6 (plain)
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
// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org)
// Licensed under the Apache License, Version 2.0 (see LICENSE file)
// Official repository: https://github.com/ne-foss-org/nekernel

#ifndef STORAGEKIT_PRDT_H
#define STORAGEKIT_PRDT_H

#include <KernelKit/PCI/DMA.h>
#include <KernelKit/PCI/Iterator.h>
#include <NeKit/Ref.h>

#define kPrdtTransferSize (sizeof(Kernel::UShort))

namespace Kernel {
/// @brief Tranfer information about PRD.
enum {
  kPRDTTransferInProgress,
  kPRDTTransferIsDone,
  kPRDTTransferCount,
};

/// @brief Physical Region Descriptor Table.
struct PRDT final {
  UInt32 fPhysAddress;
  UInt32 fSectorCount;
  UInt8  fEndBit;
};

void construct_prdt(Ref<PRDT>& prd);

EXTERN_C Int32 kPRDTTransferStatus;
}  // namespace Kernel

#endif