Describes how to implement the entry point function.
The DMA Framework implements its entry point function in the platform-specific layer.
The entry point for a kernel extension is declared by a
DECLARE_STANDARD_EXTENSION()
statement, followed by the block of code that runs on entry to the DLL. The following code is typical for a port of the DMA Framework , and is taken from the port for the template reference platform:
DECLARE_STANDARD_EXTENSION() // // Creates and initializes a new DMA controller object on the kernel heap. // { __KTRACE_OPT2(KBOOT, KDMA, Kern::Printf("Starting DMA Extension")); return Controller.Create(); }
where Controller is declared as writable static data:
static TTemplateDmac Controller;
Create() is a second-phase constructor defined in, and implemented by, the concrete class derived from TDmac. DMA channels are attributes of this concrete class because only the platform specific layer knows what kind of channel to use. This platform specific layer second phase constructor must call the platform independent layer second phase constructor, TDmac::Create(), before doing anything else.
TDmac::Create() allocates the arrays containing the descriptors and descriptor headers using the information passed to it by the platform specific layer in the SCreateInfo struct. This includes information such as the number of descriptors to be allocated, whether hardware descriptors are supported and their size etc.
Note that if hardware-specific descriptors are used, they are allocated in a hardware chunk. If pseudo-descriptors are used, they are allocated on the kernel heap.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.