diff options
| author | Michael Brown | 2014-07-26 16:31:08 +0200 |
|---|---|---|
| committer | Michael Brown | 2014-07-28 17:58:35 +0200 |
| commit | ec30c856a80270578a90528ecffdaf4eaf148503 (patch) | |
| tree | 91968794eeaba657fbbccfa3b5d30c753e5da080 /src | |
| parent | [build] Set GITVERSION only if there is a git repository (diff) | |
| download | ipxe-ec30c856a80270578a90528ecffdaf4eaf148503.tar.gz ipxe-ec30c856a80270578a90528ecffdaf4eaf148503.tar.xz ipxe-ec30c856a80270578a90528ecffdaf4eaf148503.zip | |
[ioapi] Centralise notion of PAGE_SIZE
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/arch/x86/include/ipxe/x86_io.h | 3 | ||||
| -rw-r--r-- | src/include/ipxe/io.h | 6 | ||||
| -rw-r--r-- | src/include/ipxe/virtio-ring.h | 3 |
3 files changed, 9 insertions, 3 deletions
diff --git a/src/arch/x86/include/ipxe/x86_io.h b/src/arch/x86/include/ipxe/x86_io.h index 1fc7f6608..9e68f4e78 100644 --- a/src/arch/x86/include/ipxe/x86_io.h +++ b/src/arch/x86/include/ipxe/x86_io.h @@ -28,6 +28,9 @@ FILE_LICENCE ( GPL2_OR_LATER ); * */ +/** Page shift */ +#define PAGE_SHIFT 12 + /* * Physical<->Bus and Bus<->I/O address mappings * diff --git a/src/include/ipxe/io.h b/src/include/ipxe/io.h index b8b8aa313..29ccfd1fa 100644 --- a/src/include/ipxe/io.h +++ b/src/include/ipxe/io.h @@ -23,6 +23,12 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include <config/ioapi.h> #include <ipxe/uaccess.h> +/** Page size */ +#define PAGE_SIZE ( 1 << PAGE_SHIFT ) + +/** Page mask */ +#define PAGE_MASK ( PAGE_SIZE - 1 ) + /** * Calculate static inline I/O API function name * diff --git a/src/include/ipxe/virtio-ring.h b/src/include/ipxe/virtio-ring.h index 0afe8bab7..c687acab7 100644 --- a/src/include/ipxe/virtio-ring.h +++ b/src/include/ipxe/virtio-ring.h @@ -1,8 +1,5 @@ #ifndef _VIRTIO_RING_H_ # define _VIRTIO_RING_H_ -#define PAGE_SHIFT (12) -#define PAGE_SIZE (1<<PAGE_SHIFT) -#define PAGE_MASK (PAGE_SIZE-1) /* Status byte for guest to report progress, and synchronize features. */ /* We have seen device and processed generic fields (VIRTIO_CONFIG_F_VIRTIO) */ |
