Loading...
Searching...
No Matches
19#ifndef _COBALT_ASM_GENERIC_WRAPPERS_H
21#include <linux/version.h>
23#define COBALT_BACKPORT(__sym) __cobalt_backport_ ##__sym
37#define DEFINE_PROC_OPS(__name, __open, __release, __read, __write) \
38 struct proc_ops __name = { \
39 .proc_open = (__open), \
40 .proc_release = (__release), \
41 .proc_read = (__read), \
42 .proc_write = (__write), \
43 .proc_lseek = seq_lseek, \
46#if LINUX_VERSION_CODE < KERNEL_VERSION(5,11,0)
47#define IRQ_WORK_INIT(_func) (struct irq_work) { \
48 .flags = ATOMIC_INIT(0), \
53#if LINUX_VERSION_CODE < KERNEL_VERSION(5,14,0) && \
54 (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0) || \
55 LINUX_VERSION_CODE < KERNEL_VERSION(5,10,220))
56#define close_fd(__ufd) __close_fd(current->files, __ufd)
59#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0) && \
60 (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0) || \
61 LINUX_VERSION_CODE < KERNEL_VERSION(5,10,188))
62#define dev_addr_set(dev, addr) memcpy((dev)->dev_addr, addr, MAX_ADDR_LEN)
63#define eth_hw_addr_set(dev, addr) memcpy((dev)->dev_addr, addr, ETH_ALEN)
66#if LINUX_VERSION_CODE < KERNEL_VERSION(5,17,0)
67#define pde_data(i) PDE_DATA(i)
70#if LINUX_VERSION_CODE < KERNEL_VERSION(6,2,0)
71#define timer_delete_sync del_timer_sync
74#if LINUX_VERSION_CODE < KERNEL_VERSION(6,3,0)
75#define spi_get_chipselect(spi, idx) ((spi)->chip_select)
76#define spi_get_csgpiod(spi, idx) ((spi)->cs_gpiod)
79#if LINUX_VERSION_CODE < KERNEL_VERSION(6,8,0)
80#define MAX_PAGE_ORDER MAX_ORDER
83#if LINUX_VERSION_CODE < KERNEL_VERSION(6,10,0)
84#define __wrap_assign_str __assign_str
86#define __wrap_assign_str(dst, src) __assign_str(dst)
89#if LINUX_VERSION_CODE < KERNEL_VERSION(6,10,0)
90#define mm_get_unmapped_area(__mm, __filp, __addr, __len, __pgoff, __flags) \
91 (__mm)->get_unmapped_area(__filp, __addr, __len, __pgoff, __flags)
94#if LINUX_VERSION_CODE < KERNEL_VERSION(6,16,0)
95#define timer_container_of from_timer