kernel/dma_resource: Add an assertion to prevent Init() from being called twice.
This commit is contained in:
parent
92b8f3e74c
commit
831bb20728
@ -93,6 +93,7 @@ DMABuffer::Dump() const
|
|||||||
|
|
||||||
DMAResource::DMAResource()
|
DMAResource::DMAResource()
|
||||||
:
|
:
|
||||||
|
fBlockSize(0),
|
||||||
fScratchVecs(NULL)
|
fScratchVecs(NULL)
|
||||||
{
|
{
|
||||||
mutex_init(&fLock, "dma resource");
|
mutex_init(&fLock, "dma resource");
|
||||||
@ -159,6 +160,7 @@ DMAResource::Init(const dma_restrictions& restrictions,
|
|||||||
generic_size_t blockSize, uint32 bufferCount, uint32 bounceBufferCount)
|
generic_size_t blockSize, uint32 bufferCount, uint32 bounceBufferCount)
|
||||||
{
|
{
|
||||||
ASSERT(restrictions.alignment <= blockSize);
|
ASSERT(restrictions.alignment <= blockSize);
|
||||||
|
ASSERT(fBlockSize == 0);
|
||||||
|
|
||||||
fRestrictions = restrictions;
|
fRestrictions = restrictions;
|
||||||
fBlockSize = blockSize == 0 ? 1 : blockSize;
|
fBlockSize = blockSize == 0 ? 1 : blockSize;
|
||||||
|
Loading…
Reference in New Issue
Block a user