diff -r 578be2adaf3e -r 307f4279f433 Adaptation/GUID-812DEBEB-84D0-5BD4-A5BB-5AF6B8384CCF.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Adaptation/GUID-812DEBEB-84D0-5BD4-A5BB-5AF6B8384CCF.dita Fri Oct 15 14:32:18 2010 +0100 @@ -0,0 +1,47 @@ + + + + + +Entry +Point ImplementationDescribes 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.

+
\ No newline at end of file