mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
kernel: remove the list_t alias since it's just a typedef for node
This commit is contained in:
@@ -25,7 +25,7 @@ typedef struct {
|
||||
size_t block_size;
|
||||
|
||||
pushlock_t dirty_list_lock;
|
||||
list_t dirty_list;
|
||||
list_node_t dirty_list;
|
||||
bool syncing;
|
||||
eventheader_t dirty_list_sync_event;
|
||||
eventheader_t dirty_list_empty_event;
|
||||
|
||||
@@ -264,7 +264,7 @@ typedef struct {
|
||||
|
||||
struct input_device {
|
||||
spinlock_t lock;
|
||||
list_t listeners;
|
||||
list_node_t listeners;
|
||||
|
||||
int clock_id;
|
||||
|
||||
|
||||
@@ -20,12 +20,12 @@
|
||||
#define SCHED_SLEEP_TIME_LIMIT_CPU_US 1000
|
||||
|
||||
typedef struct {
|
||||
list_t queues[SCHED_RUN_QUEUE_SIZE];
|
||||
list_node_t queues[SCHED_RUN_QUEUE_SIZE];
|
||||
bitmap_t thread_bitmap;
|
||||
} sched_run_queue_t;
|
||||
|
||||
typedef struct {
|
||||
list_t queues[SCHED_RUN_QUEUE_SIZE];
|
||||
list_node_t queues[SCHED_RUN_QUEUE_SIZE];
|
||||
int ins;
|
||||
int run;
|
||||
size_t thread_count;
|
||||
|
||||
@@ -11,9 +11,9 @@ typedef void (*work_callback_t)(void *, size_t);
|
||||
typedef struct {
|
||||
const char *name;
|
||||
spinlock_t lock;
|
||||
list_t work_list;
|
||||
list_t active_list;
|
||||
list_t waiter_list;
|
||||
list_node_t work_list;
|
||||
list_node_t active_list;
|
||||
list_node_t waiter_list;
|
||||
semaphore_t pending_work;
|
||||
thread_t **threads;
|
||||
size_t thread_count;
|
||||
|
||||
@@ -377,7 +377,7 @@ typedef struct xhci_ctrl {
|
||||
usb_ctrl_t ctrl;
|
||||
pcienum_t *pci_enum;
|
||||
|
||||
list_t hubs;
|
||||
list_node_t hubs;
|
||||
|
||||
uint32_t port_count;
|
||||
uint32_t slot_count;
|
||||
@@ -394,7 +394,7 @@ typedef struct xhci_ctrl {
|
||||
spinlock_t event_lock;
|
||||
mutex_t callback_mutex;
|
||||
bitmap_t port_change_bitmap;
|
||||
list_t completion_list;
|
||||
list_node_t completion_list;
|
||||
ringbuffer_t callback_ring;
|
||||
dpc_t dpc;
|
||||
|
||||
|
||||
@@ -9,35 +9,33 @@ typedef struct _list_node {
|
||||
struct _list_node *next;
|
||||
} list_node_t;
|
||||
|
||||
typedef list_node_t list_t;
|
||||
#define LIST_INIT_VALUE(NAME) ((list_node_t) {.prev = &(NAME), .next = &(NAME)})
|
||||
|
||||
#define LIST_INIT_VALUE(NAME) ((list_t) {.prev = &(NAME), .next = &(NAME)})
|
||||
|
||||
static inline void list_init(list_t *list) {
|
||||
static inline void list_init(list_node_t *list) {
|
||||
list->prev = list;
|
||||
list->next = list;
|
||||
}
|
||||
|
||||
static inline bool list_is_empty(const list_t *list) {
|
||||
static inline bool list_is_empty(const list_node_t *list) {
|
||||
return list->next == list;
|
||||
}
|
||||
|
||||
static inline list_node_t *list_get_first(const list_t *list) {
|
||||
static inline list_node_t *list_get_first(const list_node_t *list) {
|
||||
return list_is_empty(list) ? NULL : list->next;
|
||||
}
|
||||
|
||||
static inline list_node_t *list_get_last(const list_t *list) {
|
||||
static inline list_node_t *list_get_last(const list_node_t *list) {
|
||||
return list_is_empty(list) ? NULL : list->prev;
|
||||
}
|
||||
|
||||
static inline void list_push_front(list_t *list, list_node_t *node) {
|
||||
static inline void list_push_front(list_node_t *list, list_node_t *node) {
|
||||
node->prev = list;
|
||||
node->next = list->next;
|
||||
list->next->prev = node;
|
||||
list->next = node;
|
||||
}
|
||||
|
||||
static inline void list_push_back(list_t *list, list_node_t *node) {
|
||||
static inline void list_push_back(list_node_t *list, list_node_t *node) {
|
||||
node->next = list;
|
||||
node->prev = list->prev;
|
||||
list->prev->next = node;
|
||||
@@ -51,7 +49,7 @@ static inline void list_remove(list_node_t *node) {
|
||||
node->next = NULL;
|
||||
}
|
||||
|
||||
static inline list_node_t *list_pop_front(list_t *list) {
|
||||
static inline list_node_t *list_pop_front(list_node_t *list) {
|
||||
list_node_t *node = list->next;
|
||||
if (node == list)
|
||||
return NULL;
|
||||
@@ -59,7 +57,7 @@ static inline list_node_t *list_pop_front(list_t *list) {
|
||||
return node;
|
||||
}
|
||||
|
||||
static inline list_node_t *list_pop_back(list_t *list) {
|
||||
static inline list_node_t *list_pop_back(list_node_t *list) {
|
||||
list_node_t *node = list->prev;
|
||||
if (node == list)
|
||||
return NULL;
|
||||
|
||||
@@ -46,7 +46,7 @@ typedef struct cpu_t {
|
||||
timer_t *timer;
|
||||
|
||||
isr_t *dpcisr;
|
||||
list_t dpcqueue;
|
||||
list_node_t dpcqueue;
|
||||
|
||||
thread_t *idlethread;
|
||||
timerentry_t schedtimerentry;
|
||||
|
||||
Reference in New Issue
Block a user