MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / SetMemoryPageSize

Method SetMemoryPageSize

Kernel/include/nvme.h:344–355  ·  view source on GitHub ↗

Config

Source from the content-addressed store, hash-verified

342
343 // Config
344 __attribute__((always_inline)) inline void SetMemoryPageSize(uint32_t size){
345 assert(size >= GetMinMemoryPageSize() && size <= GetMaxMemoryPageSize());
346
347 uint32_t i = 0;
348 while(!(size & 1)) {
349 i++;
350 size >>= 1;
351 }
352
353 assert(i >= 12);
354 cRegs->config = (cRegs->config & ~NVME_CFG_MPS(NVME_CFG_MPS_MASK)) | NVME_CFG_MPS(i - 12); // Host memory page size (2 ^ (12 + MPSMIN))
355 }
356
357 __attribute__((always_inline)) inline void SetCommandSet(uint8_t set){
358 cRegs->config = (cRegs->config & ~NVME_CFG_CSS(NVME_CFG_CSS_MASK)) | NVME_CFG_CSS(set);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected