23 #include "pedigree/kernel/compiler.h" 24 #include "pedigree/kernel/machine/Disk.h" 25 #include "pedigree/kernel/processor/types.h" 26 #include "pedigree/kernel/utilities/Cache.h" 27 #include "pedigree/kernel/utilities/CacheConstants.h" 28 #include "pedigree/kernel/utilities/String.h" 35 enum ScsiPeripheralType
38 SequentialDevice = 0x01,
40 ProcessorDevice = 0x03,
41 WriteOnceDevice = 0x04,
43 OpticalMemoryDevice = 0x07,
44 MediumChangerDevice = 0x08,
46 EnclosureDevice = 0x0D,
55 uint32_t SenseKey : 4;
59 uint32_t filemark : 1;
66 uint8_t senseKeySpecific[3];
79 uint8_t ProdIdent[16];
94 virtual uintptr_t read(uint64_t location);
95 virtual void write(uint64_t location);
96 virtual void flush(uint64_t location);
97 virtual void align(uint64_t location);
101 str =
String(
"SCSI Disk");
106 virtual uint64_t doRead(uint64_t location);
107 virtual uint64_t doWrite(uint64_t location);
108 virtual uint64_t doSync(uint64_t location);
112 return m_NumBlocks * m_NativeBlockSize;
115 virtual size_t getBlockCount()
const 131 return m_NativeBlockSize;
134 virtual void pin(uint64_t location);
135 virtual void unpin(uint64_t location);
151 bool readSense(
Sense *s);
154 ScsiCommand *pCommand, uintptr_t pRespBuffer, uint16_t nRespBytes,
155 bool bWrite =
false);
157 bool getCapacityInternal(
size_t *blockNumber,
size_t *blockSize);
159 static void cacheCallback(
160 CacheConstants::CallbackCause cause, uintptr_t loc, uintptr_t page,
169 uint64_t m_AlignPoints[8];
170 size_t m_nAlignPoints;
174 size_t m_NativeBlockSize;
176 ScsiPeripheralType m_DeviceType;
virtual size_t getBlockSize() const
Gets the block size of the disk.
virtual size_t getNativeBlockSize() const
virtual void getName(String &str)
virtual size_t getSize() const
Gets the size of the disk.
virtual size_t defaultBlockSize()