The Pedigree Project
0.1
src
modules
drivers
common
nvme
nvme/Registers.h
1
/* Copyright (c) 2026, Pedigree Developers. SPDX-License-Identifier: ISC */
2
#ifndef NVME_REGISTERS_H
3
#define NVME_REGISTERS_H
4
#include "pedigree/kernel/processor/types.h"
5
6
namespace
Nvme {
7
constexpr
size_t
PageSize = 4096;
8
constexpr
size_t
QueueDepth = 16;
9
constexpr
size_t
MaxTransfer = 65536;
10
enum
Register :
size_t
{
11
Cap = 0x00,
12
Version = 0x08,
13
InterruptMaskSet = 0x0c,
14
InterruptMaskClear = 0x10,
15
Configuration = 0x14,
16
Status = 0x1c,
17
AdminAttributes = 0x24,
18
AdminSubmission = 0x28,
19
AdminCompletion = 0x30,
20
Doorbells = 0x1000,
21
};
22
struct
Command
{
23
uint32_t opcode;
24
uint32_t nsid;
25
uint64_t reserved;
26
uint64_t metadata;
27
uint64_t prp1;
28
uint64_t prp2;
29
uint32_t cdw10;
30
uint32_t cdw11;
31
uint32_t cdw12;
32
uint32_t cdw13;
33
uint32_t cdw14;
34
uint32_t cdw15;
35
};
36
struct
Completion
{
37
uint32_t result;
38
uint32_t reserved;
39
uint16_t sqHead;
40
uint16_t sqId;
41
uint16_t cid;
42
uint16_t status;
43
};
44
static_assert
(
sizeof
(
Command
) == 64);
45
static_assert
(
sizeof
(
Completion
) == 16);
46
}
// namespace Nvme
47
#endif
Nvme::Command
Definition
nvme/Registers.h:22
Nvme::Completion
Definition
nvme/Registers.h:36
Generated on Tue Sep 22 2026 06:05:42 for The Pedigree Project by
1.9.8