]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[ioapi] Centralise notion of PAGE_SIZE
authorMichael Brown <mcb30@ipxe.org>
Sat, 26 Jul 2014 14:31:08 +0000 (15:31 +0100)
committerMichael Brown <mcb30@ipxe.org>
Mon, 28 Jul 2014 15:58:35 +0000 (16:58 +0100)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/arch/x86/include/ipxe/x86_io.h
src/include/ipxe/io.h
src/include/ipxe/virtio-ring.h

index 1fc7f660842f755f50363471d75b27d23491008c..9e68f4e78997c4c34f78383426447aa289dc9649 100644 (file)
@@ -28,6 +28,9 @@ FILE_LICENCE ( GPL2_OR_LATER );
  *
  */
 
+/** Page shift */
+#define PAGE_SHIFT 12
+
 /*
  * Physical<->Bus and Bus<->I/O address mappings
  *
index b8b8aa313fc4f7ff172962435bd52e2dacc9d4ef..29ccfd1fac4d03dc633cd53461c16f669fb4c82e 100644 (file)
@@ -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
  *
index 0afe8bab75bb206c09353f45f191b32cf236af32..c687acab71d664b815573e6ef3b45ef184e2722c 100644 (file)
@@ -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) */