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:
+1
-1
@@ -77,7 +77,7 @@ static void writer_thread(void) {
|
|||||||
interrupt_loweripl(ipl);
|
interrupt_loweripl(ipl);
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
list_t internal_list;
|
list_node_t internal_list;
|
||||||
list_init(&internal_list);
|
list_init(&internal_list);
|
||||||
|
|
||||||
eventlistener_t listener;
|
eventlistener_t listener;
|
||||||
|
|||||||
+1
-1
@@ -50,7 +50,7 @@ typedef struct {
|
|||||||
void *ctx;
|
void *ctx;
|
||||||
} root_event_waiter_t;
|
} root_event_waiter_t;
|
||||||
|
|
||||||
static list_t root_event_list;
|
static list_node_t root_event_list;
|
||||||
static bool root_mounted;
|
static bool root_mounted;
|
||||||
static mutex_t root_event_mutex;
|
static mutex_t root_event_mutex;
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ typedef struct {
|
|||||||
size_t block_size;
|
size_t block_size;
|
||||||
|
|
||||||
pushlock_t dirty_list_lock;
|
pushlock_t dirty_list_lock;
|
||||||
list_t dirty_list;
|
list_node_t dirty_list;
|
||||||
bool syncing;
|
bool syncing;
|
||||||
eventheader_t dirty_list_sync_event;
|
eventheader_t dirty_list_sync_event;
|
||||||
eventheader_t dirty_list_empty_event;
|
eventheader_t dirty_list_empty_event;
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ typedef struct {
|
|||||||
|
|
||||||
struct input_device {
|
struct input_device {
|
||||||
spinlock_t lock;
|
spinlock_t lock;
|
||||||
list_t listeners;
|
list_node_t listeners;
|
||||||
|
|
||||||
int clock_id;
|
int clock_id;
|
||||||
|
|
||||||
|
|||||||
@@ -20,12 +20,12 @@
|
|||||||
#define SCHED_SLEEP_TIME_LIMIT_CPU_US 1000
|
#define SCHED_SLEEP_TIME_LIMIT_CPU_US 1000
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
list_t queues[SCHED_RUN_QUEUE_SIZE];
|
list_node_t queues[SCHED_RUN_QUEUE_SIZE];
|
||||||
bitmap_t thread_bitmap;
|
bitmap_t thread_bitmap;
|
||||||
} sched_run_queue_t;
|
} sched_run_queue_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
list_t queues[SCHED_RUN_QUEUE_SIZE];
|
list_node_t queues[SCHED_RUN_QUEUE_SIZE];
|
||||||
int ins;
|
int ins;
|
||||||
int run;
|
int run;
|
||||||
size_t thread_count;
|
size_t thread_count;
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ typedef void (*work_callback_t)(void *, size_t);
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
const char *name;
|
const char *name;
|
||||||
spinlock_t lock;
|
spinlock_t lock;
|
||||||
list_t work_list;
|
list_node_t work_list;
|
||||||
list_t active_list;
|
list_node_t active_list;
|
||||||
list_t waiter_list;
|
list_node_t waiter_list;
|
||||||
semaphore_t pending_work;
|
semaphore_t pending_work;
|
||||||
thread_t **threads;
|
thread_t **threads;
|
||||||
size_t thread_count;
|
size_t thread_count;
|
||||||
|
|||||||
@@ -377,7 +377,7 @@ typedef struct xhci_ctrl {
|
|||||||
usb_ctrl_t ctrl;
|
usb_ctrl_t ctrl;
|
||||||
pcienum_t *pci_enum;
|
pcienum_t *pci_enum;
|
||||||
|
|
||||||
list_t hubs;
|
list_node_t hubs;
|
||||||
|
|
||||||
uint32_t port_count;
|
uint32_t port_count;
|
||||||
uint32_t slot_count;
|
uint32_t slot_count;
|
||||||
@@ -394,7 +394,7 @@ typedef struct xhci_ctrl {
|
|||||||
spinlock_t event_lock;
|
spinlock_t event_lock;
|
||||||
mutex_t callback_mutex;
|
mutex_t callback_mutex;
|
||||||
bitmap_t port_change_bitmap;
|
bitmap_t port_change_bitmap;
|
||||||
list_t completion_list;
|
list_node_t completion_list;
|
||||||
ringbuffer_t callback_ring;
|
ringbuffer_t callback_ring;
|
||||||
dpc_t dpc;
|
dpc_t dpc;
|
||||||
|
|
||||||
|
|||||||
@@ -9,35 +9,33 @@ typedef struct _list_node {
|
|||||||
struct _list_node *next;
|
struct _list_node *next;
|
||||||
} list_node_t;
|
} 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_node_t *list) {
|
||||||
|
|
||||||
static inline void list_init(list_t *list) {
|
|
||||||
list->prev = list;
|
list->prev = list;
|
||||||
list->next = 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;
|
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;
|
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;
|
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->prev = list;
|
||||||
node->next = list->next;
|
node->next = list->next;
|
||||||
list->next->prev = node;
|
list->next->prev = node;
|
||||||
list->next = 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->next = list;
|
||||||
node->prev = list->prev;
|
node->prev = list->prev;
|
||||||
list->prev->next = node;
|
list->prev->next = node;
|
||||||
@@ -51,7 +49,7 @@ static inline void list_remove(list_node_t *node) {
|
|||||||
node->next = NULL;
|
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;
|
list_node_t *node = list->next;
|
||||||
if (node == list)
|
if (node == list)
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -59,7 +57,7 @@ static inline list_node_t *list_pop_front(list_t *list) {
|
|||||||
return node;
|
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;
|
list_node_t *node = list->prev;
|
||||||
if (node == list)
|
if (node == list)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ typedef struct cpu_t {
|
|||||||
timer_t *timer;
|
timer_t *timer;
|
||||||
|
|
||||||
isr_t *dpcisr;
|
isr_t *dpcisr;
|
||||||
list_t dpcqueue;
|
list_node_t dpcqueue;
|
||||||
|
|
||||||
thread_t *idlethread;
|
thread_t *idlethread;
|
||||||
timerentry_t schedtimerentry;
|
timerentry_t schedtimerentry;
|
||||||
|
|||||||
@@ -365,7 +365,7 @@ struct acpi_work {
|
|||||||
struct acpi_workctx {
|
struct acpi_workctx {
|
||||||
work_queue_t *queue;
|
work_queue_t *queue;
|
||||||
spinlock_t pool_lock;
|
spinlock_t pool_lock;
|
||||||
list_t free_list;
|
list_node_t free_list;
|
||||||
struct acpi_work pool[ACPI_WORK_POOL_SIZE];
|
struct acpi_work pool[ACPI_WORK_POOL_SIZE];
|
||||||
bool target_bsp;
|
bool target_bsp;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ typedef struct hda hda_t;
|
|||||||
typedef struct hda_output_path hda_output_path_t;
|
typedef struct hda_output_path hda_output_path_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
list_t waiter_list;
|
list_node_t waiter_list;
|
||||||
spinlock_t waiter_list_lock;
|
spinlock_t waiter_list_lock;
|
||||||
size_t function_group_count;
|
size_t function_group_count;
|
||||||
size_t starting_node;
|
size_t starting_node;
|
||||||
@@ -630,7 +630,7 @@ static hda_path_t hda_find_path(hda_fg_t *fg, hda_widget_t *pin, int goal_type)
|
|||||||
hda_path_t path;
|
hda_path_t path;
|
||||||
} path_entry_t;
|
} path_entry_t;
|
||||||
|
|
||||||
list_t queue;
|
list_node_t queue;
|
||||||
list_init(&queue);
|
list_init(&queue);
|
||||||
|
|
||||||
bool *visited = alloc(sizeof(bool) * fg->widget_count);
|
bool *visited = alloc(sizeof(bool) * fg->widget_count);
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#define SOCKET_BUFFER (16 * 1024)
|
#define SOCKET_BUFFER (16 * 1024)
|
||||||
|
|
||||||
SPINLOCK_DEFINE(list_lock);
|
SPINLOCK_DEFINE(list_lock);
|
||||||
static list_t socket_list = LIST_INIT_VALUE(socket_list);
|
static list_node_t socket_list = LIST_INIT_VALUE(socket_list);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint8_t sender[6];
|
uint8_t sender[6];
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ typedef struct {
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
mutex_t mutex;
|
mutex_t mutex;
|
||||||
list_t list;
|
list_node_t list;
|
||||||
} futex_bucket_t;
|
} futex_bucket_t;
|
||||||
|
|
||||||
#define BUCKET_COUNT 256
|
#define BUCKET_COUNT 256
|
||||||
|
|||||||
Reference in New Issue
Block a user