dxd - dynax driver framework 3.0.2
cross platform open source driver development framework
Loading...
Searching...
No Matches
dxd Namespace Reference

dynax driver framework kernel namespace More...

Namespaces

namespace  abstract
namespace  audio
 AudioDriverKit binding - the DriverKit counterpart of portcls/wavert.
namespace  debug
 the names of a setup packet's fields, for the trace of a control transfer
namespace  dmus
 dmus namespace
namespace  doubly
 the semi lock free doubly linked list: an item knows its list and leaves it in its own destructor, which the singly linked one cannot - what a registration of unknown lifetime hangs in
namespace  firewire
 IEEE 1394.
namespace  ioctl
 kernel IOCTLs
namespace  kmdf
 KMDF bound device framework: the WDF driver model beside plain WDM (dxd::platform), on the same contract (dxd::driver/device/client).
namespace  linked
 the lock free singly linked list: a push and a pop with no lock at all, which makes it a stack - what is pushed last comes off first, so nothing that needs its order kept walks it (dxd/CLAUDE.md, the isoc completions)
namespace  models
 a product's models as the lines of its inf and plist templates
namespace  multichannel
namespace  pci
 PCI devices.
namespace  platform
 the platform branch: DriverKit
namespace  portcls
 PortCls: the driver form owning the WDM dispatch, audio subdevices on WaveRT and DMus miniports.
namespace  range
 range namespace
namespace  streaming
 generic streaming device layer, shared by every bus and both device frameworks
namespace  usb
 dynax driver framework kernel namespace
namespace  virtuel
namespace  wavert
 WaveRT namespace.
namespace  wdm
 WDM++ - windows helper classes.

Classes

class  __atomic_pointer
 atomic pointer operations More...
class  __atomic_pointer<type_t *>
class  __atomic_scalar
 atomic scalar on the compiler's builtins - a dext has no interlocked KPI and needs none More...
class  __atomic_scalar<4, type_t>
 32bit atomic operations More...
class  __atomic_scalar<8, type_t>
 64bit atomic operations More...
struct  adjust
struct  adjust<host>
struct  adjust<swap>
class  array
 an array owned the same way, sized once and freed with the object More...
class  atomic
 atomic operations More...
class  atomic<type_t *>
 explicitely specify pointer template argument: More...
class  broadcast
 broadcast signalization of participating linked event items More...
class  buffer
 DriverKit memory buffer: whole pages. More...
class  bus
 WDM BUS class. More...
class  clock
 DriverKit periodic software clock, mirroring dx::clock's tick()/run()/halt() shape. More...
struct  completion
 the IOCTL call in flight on a client, which a user event registered by that call binds to More...
struct  decay
 no array/function decay - not needed here More...
class  device
 the device the OS publishes and user mode finds and opens More...
class  driver
 the driver: one per driver binary, holding and answering what is driver-wide More...
class  event
 kernel representation of a user space event More...
class  event<dx::kernel>
 kernel event: auto reset, as a WDM synchronization event More...
class  event<dx::user>
 kernel representation of user space event More...
union  fourchar_string
 a four character code as a string on the stack: the kernel has no allocation free formatting, so the code is unpacked into this and printed as s More...
class  guid
class  lock
class  map
 one mapping of a buffer, into the driver itself or into the client that asked for it - the scope says which address space the address belongs to More...
class  map<dx::kernel, vm_t>
 WDK: kernel space memory mapping. More...
class  map<dx::user, vm_t>
 a buffer as its client sees it: a dext cannot map into its client, so the address stays empty More...
class  memory
 virtual DriverKit memory description More...
class  mutex
 mutex More...
class  open
class  port
 miniport creation helper More...
class  power
 the OS's power management bound to a driver form's devices (Driver architecture (future): one shape on every platform): one specialization per form More...
class  power<kmdf::driver>
 KMDF power policy: the framework owns it, each device's D0 entry and exit tell the device (kmdf::device). More...
class  power<platform::driver>
 DriverKit power policy: the device shell's SetPowerState tells its device. More...
class  power<portcls::adapter>
 PortCls power policy: PortCls owns the IRPs and tells each adapter device its device state. More...
class  process
 a process: launch() on a queue of its own, the event signalled on its way out More...
class  promoted
 kernel-mode promoted value, mirroring dx::promoted's server/commit/notify shape More...
class  reference
 reference holder for object based reference counter More...
class  referenced
 reference counting base class More...
struct  remove_reference
struct  remove_reference<type_t &>
struct  remove_reference<type_t &&>
class  scoped
 an object owned for the scope, freed at its end and at every assignment - the kernel's own unique_ptr, with the conversions an OS call's out parameter needs More...
class  scoped<::URB>
class  spinlock
 a dext runs at no interrupt level: what the kernel platforms take a spinlock for is a mutex here More...
class  stream
 generic kernel stream More...
class  string
 a formatted string of a fixed length on the stack: the kernel has no std::string, and a driver's names and log lines need no allocation More...
class  wmi
 a WMI data block's instances, read as a consumer (IoWMIOpenBlock, IoWMIQueryAllData) at PASSIVE_LEVEL More...

Typedefs

typedef ::OSAction* os_event
 the completion of the IOCTL a user event was registered with: DriverKit binds the caller's async reference into it
typedef ::IOReturn os_result
 defining platform abstract type os_result for IOKit driver
template<int length= 0x80>
using wstring= string<wchar_t, length>

Enumerations

enum  {
  ok = kIOReturnSuccess , not_implemented = kIOReturnUnsupported , invalid = kIOReturnBadArgument , device_error = kIOReturnDeviceError ,
  no_resources = kIOReturnNoResources , not_initialized = kIOReturnNotReady , timeout = kIOReturnTimeout , invalid_size = kIOReturnNoSpace ,
  aborted = kIOReturnAborted , exclusive = kIOReturnExclusiveAccess , device_removed = kIOReturnNotAttached , closed = kIOReturnNotOpen ,
  not_permitted = kIOReturnNotPermitted , internal_error = kIOReturnInternalError , already_running = kIOReturnBusy
}
enum  {
  ok = kIOReturnSuccess , not_implemented = kIOReturnUnsupported , invalid = kIOReturnBadArgument , device_error = kIOReturnDeviceError ,
  no_resources = kIOReturnNoResources , not_initialized = kIOReturnNotReady , already_running = kIOReturnBusy , interrupt_level_mismatch = STATUS_INVALID_LEVEL ,
  timeout = kIOReturnTimeout , invalid_size = kIOReturnNoSpace , not_aligned = STATUS_DATATYPE_MISALIGNMENT_ERROR , aborted = kIOReturnAborted ,
  failed = STATUS_UNSUCCESSFUL , device_removed = kIOReturnNotAttached , not_permitted = kIOReturnNotPermitted , internal_error = kIOReturnInternalError ,
  insufficient_bandwidth = STATUS_CAMERA_INSUFFICIENT_BANDWIDTH
}
enum  direction { none , in , out , both }
 the direction of a transfer or a pipe, both for what serves either More...
enum  endian { little_endian , big_endian , host =little_endian , swap =big_endian }
 what the data on the wire is, not what the machine is: a swap happens where the two disagree, so the same driver source serves either host More...
enum  scale : int64_t {
  nsec = 1ll , usec = 1000ll , msec = usec* 1000ll , sec = msec* 1000ll ,
  nsec = 1ll , usec = 1000ll , msec = usec* 1000ll , sec = msec* 1000ll
}
enum  scale : int64_t {
  nsec = 1ll , usec = 1000ll , msec = usec* 1000ll , sec = msec* 1000ll ,
  nsec = 1ll , usec = 1000ll , msec = usec* 1000ll , sec = msec* 1000ll
}
 the factors a kernel timestamp is scaled by - the system's unit is 100 ns, so nsec is no unit of its own here More...
enum class  synchrony { sync , async }
 whether a request is awaited by its caller or completes into a callback - the template argument every URB and IRP class is built with More...

Functions

bool below32(::MDL* mdl)
 indicates whether memory is mapped above 4GB boundary
template<class driver_t, typename... args_t>
::NTSTATUS create(::DRIVER_OBJECT* wdm_driver, ::UNICODE_STRING* registry, args_t... args)
platform::device* create(driver& driver, ::IOService* service)
 the product's device factory, called when a device's shell starts - what dxd::create<adapter> in DriverEntry is on Windows
void delay(int64_t time)
 DriverKit: spin the calling thread; a dext has no thread of its own to put to sleep.
void errorlog(const char* fmt...)
template<typename type_t>
constexpr type_t&& forward(typename remove_reference<type_t>::type&& value) noexcept
template<typename type_t>
constexpr type_t&& forward(typename remove_reference<type_t>::type& value) noexcept
void log(const char* fmt...)
 windows kernel logging
template<typename value_t, typename server_t>
promoted<value_t, typename decay<server_t>::type> make_promoted(class broadcast& broadcast, const value_t& value, server_t&& server)
template<typename value_t, typename server_t>
promoted<value_t, typename decay<server_t>::type> make_promoted(class broadcast& broadcast, server_t&& server)
 construct a dxd::promoted<value_t> deducing server_t from the given callable
template<typename type_t>
type_t max(type_t v1, type_t v2)
template<typename type_t>
type_t min(type_t v1, type_t v2)
template<typename type_t>
constexpr remove_reference<type_t>::type&& move(type_t&& value) noexcept
unsigned int prio()
 the level the calling code runs at: a dext runs at none, its queues serialize instead
os_result random(void* buffer, size_t size)
 DriverKit: bytes of the kernel's cryptographic random generator.
::NTSTATUS register_resource(const ::UNICODE_STRING& registry)
 ...\Services\<service> -> ...\Services\EventLog\System\<service>: EventMessageFile= SystemRoot%\system32\drivers\<service>.sys
int64_t time()
 DriverKit: uptime in ns - the clock IOTimerDispatchSource::WakeAtTime(kIOTimerClockUptimeRaw) takes its deadlines in.
int64_t time(int64_t timestamp, scalescale scalescale)
 a timestamp's span in the given unit: the timestamps are ns already
int64_t timestamp()
 WDK: high precision timestamp.
int64_t timestamp_offset(int64_t time, scalescale scalescale=usec)
 WDK: time span to timestamp span converter.
void warnlog(const char* fmt...)

Variables

::DRIVER_OBJECT* wdm_driver= nullptr
 the driver's construction from DriverEntry, every form's: the event log's messages registered, the driver made on the driver object, its registry path and the form's own arguments (a PortCls adapter's name, the product's GUID), and let go where it failed

Detailed Description

dynax driver framework kernel namespace

dxd - dynax driver framework

dynax driver framework DriverKit namespace

Typedef Documentation

◆ os_event

typedef::KEVENT * dxd::os_event

the completion of the IOCTL a user event was registered with: DriverKit binds the caller's async reference into it

platform abstract type os_event for WDK driver

◆ os_result

typedef::NTSTATUS dxd::os_result

defining platform abstract type os_result for IOKit driver

platform abstract type os_result for WDK driver

◆ wstring

template<int length= 0x80>
using dxd::wstring= string<wchar_t, length>

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ok 
not_implemented 
invalid 
device_error 
no_resources 
not_initialized 
timeout 
invalid_size 
aborted 
exclusive 
device_removed 
closed 
not_permitted 
internal_error 
already_running 

◆ anonymous enum

anonymous enum
Enumerator
ok 
not_implemented 
invalid 
device_error 
no_resources 
not_initialized 
already_running 
interrupt_level_mismatch 
timeout 
invalid_size 
not_aligned 
aborted 
failed 
device_removed 
not_permitted 
internal_error 
insufficient_bandwidth 

◆ direction

the direction of a transfer or a pipe, both for what serves either

Enumerator
none 
in 
out 
both 

◆ endian

what the data on the wire is, not what the machine is: a swap happens where the two disagree, so the same driver source serves either host

Enumerator
little_endian 

data is little endian and will only be swapped if either host or device is big endian

big_endian 

data is big endian and will only be swapped if either host or device is little endian

host 

data is in host endian format and will only be swapped if target device is in the opposit endian format

swap 

data is not in host endian format and will only be swapped if target device is in host endian format

◆ scale [1/2]

Enumerator
nsec 

pseudo scale addressing Windows' odd 100ns precision

usec 
msec 
sec 
nsec 

pseudo scale addressing Windows' odd 100ns precision

usec 
msec 
sec 

◆ scale [2/2]

the factors a kernel timestamp is scaled by - the system's unit is 100 ns, so nsec is no unit of its own here

Enumerator
nsec 

pseudo scale addressing Windows' odd 100ns precision

usec 
msec 
sec 
nsec 

pseudo scale addressing Windows' odd 100ns precision

usec 
msec 
sec 

◆ synchrony

enum class dxd::synchrony
strong

whether a request is awaited by its caller or completes into a callback - the template argument every URB and IRP class is built with

Enumerator
sync 
async 

Function Documentation

◆ below32()

bool dxd::below32(::MDL* mdl)
inline

indicates whether memory is mapped above 4GB boundary

  • a serious OS should handle physical memory layout dependencies transparently. Bills buggy experiment on the other hand requires the awareness of where memory is physically mapped.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ create() [1/2]

template<class driver_t, typename... args_t>
::NTSTATUS dxd::create(::DRIVER_OBJECT* wdm_driver, ::UNICODE_STRING* registry, args_t... args)
Here is the call graph for this function:

◆ create() [2/2]

platform::device* dxd::create(driver& driver, ::IOService* service)

the product's device factory, called when a device's shell starts - what dxd::create<adapter> in DriverEntry is on Windows

Here is the call graph for this function:
Here is the caller graph for this function:

◆ delay()

void dxd::delay(int64_t time)
inline

DriverKit: spin the calling thread; a dext has no thread of its own to put to sleep.

WDK: delay thread execution.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ errorlog()

void dxd::errorlog(const char* fmt...)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ forward() [1/2]

template<typename type_t>
type_t&& dxd::forward(typename remove_reference<type_t>::type&& value)
constexprnoexcept
Here is the call graph for this function:

◆ forward() [2/2]

template<typename type_t>
type_t&& dxd::forward(typename remove_reference<type_t>::type& value)
constexprnoexcept
Here is the call graph for this function:
Here is the caller graph for this function:

◆ log()

void dxd::log(const char* fmt...)

windows kernel logging

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_promoted() [1/2]

template<typename value_t, typename server_t>
promoted<value_t, typename decay<server_t>::type> dxd::make_promoted(class broadcast& broadcast, const value_t& value, server_t&& server)
Here is the call graph for this function:

◆ make_promoted() [2/2]

template<typename value_t, typename server_t>
promoted<value_t, typename decay<server_t>::type> dxd::make_promoted(class broadcast& broadcast, server_t&& server)

construct a dxd::promoted<value_t> deducing server_t from the given callable

dxd::promoted<value_t, server_t> requires spelling out the lambda's own compiler-generated type; this factory lets a declaration read the same as dx::promoted's constructor call (dxd::make_promoted<value_t>([this](...) {...})).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ max()

template<typename type_t>
type_t dxd::max(type_t v1, type_t v2)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ min()

template<typename type_t>
type_t dxd::min(type_t v1, type_t v2)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ move()

template<typename type_t>
remove_reference<type_t>::type&& dxd::move(type_t&& value)
constexprnoexcept
Here is the call graph for this function:
Here is the caller graph for this function:

◆ prio()

unsigned int dxd::prio()
inline

the level the calling code runs at: a dext runs at none, its queues serialize instead

the level the calling code runs at, as the platform counts it

Here is the call graph for this function:
Here is the caller graph for this function:

◆ random()

os_result dxd::random(void* buffer, size_t size)
inline

DriverKit: bytes of the kernel's cryptographic random generator.

WDK: bytes of the system's cryptographic random generator (ksecdd), at PASSIVE_LEVEL.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ register_resource()

NTSTATUS dxd::register_resource(const ::UNICODE_STRING& registry)

...\Services\<service> -> ...\Services\EventLog\System\<service>: EventMessageFile= SystemRoot%\system32\drivers\<service>.sys

the driver's image as the System log's message resource under its service name

Here is the call graph for this function:
Here is the caller graph for this function:

◆ time() [1/2]

int64_t dxd::time()
inline

DriverKit: uptime in ns - the clock IOTimerDispatchSource::WakeAtTime(kIOTimerClockUptimeRaw) takes its deadlines in.

WDK: system time in 100ns seconds.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ time() [2/2]

int64_t dxd::time(int64_t timestamp, scale scale= usec)
inline

a timestamp's span in the given unit: the timestamps are ns already

WDK: timestamp to Windows time converter.

Here is the call graph for this function:

◆ timestamp()

int64_t dxd::timestamp()
inline

WDK: high precision timestamp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ timestamp_offset()

int64_t dxd::timestamp_offset(int64_t time, scale scale= usec)
inline

WDK: time span to timestamp span converter.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ warnlog()

void dxd::warnlog(const char* fmt...)
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ wdm_driver

extern::DRIVER_OBJECT * dxd::wdm_driver= nullptr

the driver's construction from DriverEntry, every form's: the event log's messages registered, the driver made on the driver object, its registry path and the form's own arguments (a PortCls adapter's name, the product's GUID), and let go where it failed