diff options
| author | Bjoern A. Zeeb <bz@FreeBSD.org> | 2026-07-17 12:53:16 +0000 |
|---|---|---|
| committer | Bjoern A. Zeeb <bz@FreeBSD.org> | 2026-07-24 19:33:56 +0000 |
| commit | 0845efe88b355547b103dca90e69e46a3ebdd016 (patch) | |
| tree | f486e9437ae94737fcb92535c3c4fdc76dea8d8d | |
| parent | fe1784004d6e43b3080ab7b7115ee0ea3ba317f2 (diff) | |
LinuxKPI: move clear_page() within the linux/page.h file
clear_page() would normally live in asm/page.h but adding the file
and fixing the dependencies would be too much for a single line.
Move the function to the end of the file with a clear separator
and make it clear that it does not operate on a 'struct page'
but on a page address by changing the argument name and leaving
a comment.
The function is currently used by at least mthca(4) as the only
in-tree consumer, and drm-kmod ttm_pool.c.
No functional changes.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D58296
| -rw-r--r-- | sys/compat/linuxkpi/common/include/linux/page.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/page.h b/sys/compat/linuxkpi/common/include/linux/page.h index 6f5f37d2fd0f..a8e266af95fd 100644 --- a/sys/compat/linuxkpi/common/include/linux/page.h +++ b/sys/compat/linuxkpi/common/include/linux/page.h @@ -79,7 +79,6 @@ pgprot2cachemode(pgprot_t prot) #define nth_page(page,n) pfn_to_page(page_to_pfn(page) + (n)) #define page_to_phys(page) VM_PAGE_TO_PHYS(page) -#define clear_page(page) memset(page, 0, PAGE_SIZE) #define pgprot_noncached(prot) \ (((prot) & VM_PROT_ALL) | cachemode2protval(VM_MEMATTR_UNCACHEABLE)) #ifdef VM_MEMATTR_WRITE_COMBINING @@ -129,4 +128,11 @@ clflush_cache_range(void *addr, unsigned int size) int lkpi_set_pages_attr(struct page *page, int numpages, vm_memattr_t ma); +/* -------------------------------------------------------------------------- */ +/* + * clear_page() is called on kmem allocated page addresses, thus zeros a page + * not a 'struct page'. Really belongs into <asm/page.h>. + */ +#define clear_page(_pa) memset(_pa, 0, PAGE_SIZE) + #endif /* _LINUXKPI_LINUX_PAGE_H_ */ |
