introduce a stable NTL_DDK driver ABI to replace direct HAL_API and kernel-header access in drivers, add code/kernel/io_ddk.c and code/public/ntlite/ddk/ headers, change DriverEntry to take (const NTL_DDK*, NTL_DRIVER_INIT*), update kmain to build the DDK once via IoInitializeDdk/IoGetDdk and hand it to both boot and runtime drivers, downgrade code/public/ntlite/ddi/io_driver.h to a legacy I/O model header pulling from ntlite/ddk instead of kernel internals, move code/third_party/lwip into code/drivers/net/lwip/third_party, fix up lwip_sources.txt and build.c include paths to match, split build.c's single CFLAGS macro into COMMON/KERNEL/USER/BOOT/DRIVER cflags.
This commit is contained in:
1 parent
08329516ba
commit
485a6bbfe7
385 files changed
+1822
-1079
No files matched your search
@@ -0,0 +1,51 @@
|
||||
// Public nt-lite DDK intrusive list declarations.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
// Doubly-linked intrusive list node.
|
||||
typedef struct LIST_ENTRY {
|
||||
struct LIST_ENTRY* Fwd;
|
||||
struct LIST_ENTRY* Bwd;
|
||||
} LIST_ENTRY;
|
||||
|
||||
#define LIST_INIT(head) ((head)->Fwd = (head)->Bwd = (head))
|
||||
#define LIST_IS_EMPTY(head) ((head)->Fwd == (head))
|
||||
|
||||
// Recover the containing struct pointer from an embedded list node.
|
||||
#define CONTAINING_RECORD(ptr, type, member) \
|
||||
((type *)((char *)(ptr) - offsetof(type, member)))
|
||||
|
||||
// Inserts a node at the tail of a list.
|
||||
static inline void ListInsertTail(LIST_ENTRY* head, LIST_ENTRY* node) {
|
||||
node->Bwd = head->Bwd;
|
||||
node->Fwd = head;
|
||||
head->Bwd->Fwd = node;
|
||||
head->Bwd = node;
|
||||
}
|
||||
|
||||
// Inserts a node at the head of a list.
|
||||
static inline void ListInsertHead(LIST_ENTRY* head, LIST_ENTRY* node) {
|
||||
node->Fwd = head->Fwd;
|
||||
node->Bwd = head;
|
||||
head->Fwd->Bwd = node;
|
||||
head->Fwd = node;
|
||||
}
|
||||
|
||||
// Removes a node from its current list.
|
||||
static inline void ListRemove(LIST_ENTRY* node) {
|
||||
node->Bwd->Fwd = node->Fwd;
|
||||
node->Fwd->Bwd = node->Bwd;
|
||||
node->Fwd = node->Bwd = node;
|
||||
}
|
||||
|
||||
// Removes and returns the first node in a list, or NULL when empty.
|
||||
static inline LIST_ENTRY* ListPopHead(LIST_ENTRY* head) {
|
||||
if (LIST_IS_EMPTY(head))
|
||||
return (LIST_ENTRY*)0;
|
||||
|
||||
LIST_ENTRY* node = head->Fwd;
|
||||
ListRemove(node);
|
||||
return node;
|
||||
}
|
||||
Reference in new issue
Block a user