24 lines
608 B
C
24 lines
608 B
C
//
|
|
// Created by rick on 06-03-21.
|
|
//
|
|
|
|
#ifndef NEW_KERNEL_DRIVER_H
|
|
#define NEW_KERNEL_DRIVER_H
|
|
|
|
#include <myke/attributes.h>
|
|
#include <myke/preprocessor_format_zero.h>
|
|
|
|
#ifndef STRUCT_ALIGNMENT
|
|
#define STRUCT_ALIGNMENT 16
|
|
#endif
|
|
#define DRIVER_CAT(a, b) DRIVER_DUMMY() a ## _ ## b
|
|
#define DRIVER_DUMMY()
|
|
#define SECT_NAME_(a, b) "." #a "." #b
|
|
#define SECT_NAME(a, b) SECT_NAME_(a, b)
|
|
|
|
#define GENERIC_DRIVER(drivername, order) \
|
|
static struct drivername DRIVER_CAT(drivername, counter) \
|
|
__attribute((__used__, __section__(SECT_NAME(drivername, FORMAT_3_ZERO(order)))))
|
|
|
|
#endif //NEW_KERNEL_DRIVER_H
|