Browse Source

[ioapi] Centralise notion of PAGE_SIZE

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 10 years ago
parent
commit
ec30c856a8
3 changed files with 9 additions and 3 deletions
  1. 3
    0
      src/arch/x86/include/ipxe/x86_io.h
  2. 6
    0
      src/include/ipxe/io.h
  3. 0
    3
      src/include/ipxe/virtio-ring.h

+ 3
- 0
src/arch/x86/include/ipxe/x86_io.h View File

28
  *
28
  *
29
  */
29
  */
30
 
30
 
31
+/** Page shift */
32
+#define PAGE_SHIFT 12
33
+
31
 /*
34
 /*
32
  * Physical<->Bus and Bus<->I/O address mappings
35
  * Physical<->Bus and Bus<->I/O address mappings
33
  *
36
  *

+ 6
- 0
src/include/ipxe/io.h View File

23
 #include <config/ioapi.h>
23
 #include <config/ioapi.h>
24
 #include <ipxe/uaccess.h>
24
 #include <ipxe/uaccess.h>
25
 
25
 
26
+/** Page size */
27
+#define PAGE_SIZE ( 1 << PAGE_SHIFT )
28
+
29
+/** Page mask */
30
+#define PAGE_MASK ( PAGE_SIZE - 1 )
31
+
26
 /**
32
 /**
27
  * Calculate static inline I/O API function name
33
  * Calculate static inline I/O API function name
28
  *
34
  *

+ 0
- 3
src/include/ipxe/virtio-ring.h View File

1
 #ifndef _VIRTIO_RING_H_
1
 #ifndef _VIRTIO_RING_H_
2
 # define _VIRTIO_RING_H_
2
 # define _VIRTIO_RING_H_
3
-#define PAGE_SHIFT (12)
4
-#define PAGE_SIZE  (1<<PAGE_SHIFT)
5
-#define PAGE_MASK  (PAGE_SIZE-1)
6
 
3
 
7
 /* Status byte for guest to report progress, and synchronize features. */
4
 /* Status byte for guest to report progress, and synchronize features. */
8
 /* We have seen device and processed generic fields (VIRTIO_CONFIG_F_VIRTIO) */
5
 /* We have seen device and processed generic fields (VIRTIO_CONFIG_F_VIRTIO) */

Loading…
Cancel
Save