linuxkpi: move io_mapping_create_wc to .c

Move io_mapping_create_wc to .c because it encodes the size of struct
io_mapping so we move this from the client module to the linuxkpi
module.

Sponsored by:		Netflix
Reviewed by:		hselasky, emaste
Differential Revision:	https://reviews.freebsd.org/D34776
This commit is contained in:
Warner Losh 2022-04-04 23:06:37 -06:00
parent 2bf3361d56
commit 132b00f906
2 changed files with 14 additions and 11 deletions

View File

@ -46,6 +46,8 @@ struct io_mapping {
vm_memattr_t attr;
};
struct io_mapping *io_mapping_create_wc(resource_size_t base, unsigned long size);
static inline struct io_mapping *
io_mapping_init_wc(struct io_mapping *mapping, resource_size_t base,
unsigned long size)
@ -63,17 +65,6 @@ io_mapping_init_wc(struct io_mapping *mapping, resource_size_t base,
return (mapping);
}
static inline struct io_mapping *
io_mapping_create_wc(resource_size_t base, unsigned long size)
{
struct io_mapping *mapping;
mapping = kmalloc(sizeof(*mapping), GFP_KERNEL);
if (mapping == NULL)
return (NULL);
return (io_mapping_init_wc(mapping, base, size));
}
static inline void
io_mapping_fini(struct io_mapping *mapping)
{

View File

@ -87,6 +87,7 @@ __FBSDID("$FreeBSD$");
#include <linux/kthread.h>
#include <linux/kernel.h>
#include <linux/compat.h>
#include <linux/io-mapping.h>
#include <linux/poll.h>
#include <linux/smp.h>
#include <linux/wait_bit.h>
@ -2716,6 +2717,17 @@ linuxkpi_net_ratelimit(void)
lkpi_net_maxpps));
}
struct io_mapping *
io_mapping_create_wc(resource_size_t base, unsigned long size)
{
struct io_mapping *mapping;
mapping = kmalloc(sizeof(*mapping), GFP_KERNEL);
if (mapping == NULL)
return (NULL);
return (io_mapping_init_wc(mapping, base, size));
}
#if defined(__i386__) || defined(__amd64__)
bool linux_cpu_has_clflush;
#endif