]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - include/linux/pfn.h
rfkill: allocate static minor
[mirror_ubuntu-bionic-kernel.git] / include / linux / pfn.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
22a9835c
DH
2#ifndef _LINUX_PFN_H_
3#define _LINUX_PFN_H_
4
947d0496
JF
5#ifndef __ASSEMBLY__
6#include <linux/types.h>
34c0fd54
DW
7
8/*
9 * pfn_t: encapsulates a page-frame number that is optionally backed
10 * by memmap (struct page). Whether a pfn_t has a 'struct page'
11 * backing is indicated by flags in the high bits of the value.
12 */
13typedef struct {
db78c222 14 u64 val;
34c0fd54 15} pfn_t;
947d0496
JF
16#endif
17
22a9835c
DH
18#define PFN_ALIGN(x) (((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK)
19#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
20#define PFN_DOWN(x) ((x) >> PAGE_SHIFT)
947d0496 21#define PFN_PHYS(x) ((phys_addr_t)(x) << PAGE_SHIFT)
8f235d1a 22#define PHYS_PFN(x) ((unsigned long)((x) >> PAGE_SHIFT))
22a9835c
DH
23
24#endif