kernel: move drivers to own file
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
5d9e62e4a9
commit
b6c9e0a2ba
12 changed files with 83 additions and 22 deletions
|
|
@ -28,9 +28,6 @@
|
|||
_panic(); \
|
||||
}
|
||||
|
||||
#define DRIVER_ENTRY(fn) static void (*__initcall_##fn)(void) __attribute((used, section(".initcall"))) = fn
|
||||
#define DRIVER_ENTRY_PRIORITY(fn, pr) static void (*__initcall_##fn)(void) __attribute((used, section(".initcall." #pr))) = fn
|
||||
|
||||
#define CLEANUP(fn) __attribute__((__cleanup__(fn)))
|
||||
|
||||
void yield();
|
||||
|
|
|
|||
8
include/kernel/driver.h
Normal file
8
include/kernel/driver.h
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef _DRIVER_H_
|
||||
#define _DRIVER_H_
|
||||
|
||||
#define DRIVER_ENTRY(fn) static void (*__initcall_##fn)(void) __attribute((used, section(".initcall"))) = fn
|
||||
#define DRIVER_ENTRY_PRIORITY(fn, pr) static void (*__initcall_##fn)(void) __attribute((used, section(".initcall." #pr))) = fn
|
||||
|
||||
#endif /* _DRIVER_H_ */
|
||||
|
|
@ -24,6 +24,7 @@ typedef struct {
|
|||
vaddr_t page_lowest_free(vaddr_t after, size_t len);
|
||||
void *map_mmio_dev(paddr_t base, size_t len);
|
||||
void page_map(pgd_t *pgd_table, paddr_t paddr, vaddr_t vaddr, size_t len, u64 flags, rbtree_t *map_tree);
|
||||
void page_unmap(pgd_t *pgd_table, vaddr_t vaddr, size_t len, rbtree_t *map_tree);
|
||||
pgd_t *pgd_get();
|
||||
pgd_t *pgd_create_user();
|
||||
void tlb_flush();
|
||||
|
|
|
|||
Loading…
Reference in a new issue