kv2: initialize memory manager, early pci devices
Signed-off-by: Michael Shaw <spencershawiscool@gmail.com>
This commit is contained in:
parent
e5b55a6ba5
commit
a252a3f8e9
58 changed files with 1270 additions and 505 deletions
26
include/lib/list.h
Normal file
26
include/lib/list.h
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef _LIST_H_
|
||||
#define _LIST_H_
|
||||
|
||||
#include <kernel/spinlock.h>
|
||||
|
||||
typedef struct _list_item {
|
||||
void *ptr;
|
||||
struct _list_head *list;
|
||||
struct _list_item *next;
|
||||
struct _list_item *prev;
|
||||
} list_item_t;
|
||||
|
||||
typedef struct _list_head {
|
||||
struct _list_item *head;
|
||||
struct _list_item *tail;
|
||||
spinlock_t lock;
|
||||
} list_t;
|
||||
|
||||
|
||||
void list_create(list_t *list);
|
||||
list_item_t *list_insert(list_t *list, void *item);
|
||||
void list_remove(list_item_t *item);
|
||||
void list_init();
|
||||
|
||||
#endif /* _LIST_H_ */
|
||||
Loading…
Reference in a new issue