浏览代码

[ioapi] Centralise notion of PAGE_SIZE

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 10 年前
父节点
当前提交
ec30c856a8
共有 3 个文件被更改,包括 9 次插入3 次删除
  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 查看文件

@@ -28,6 +28,9 @@ FILE_LICENCE ( GPL2_OR_LATER );
28 28
  *
29 29
  */
30 30
 
31
+/** Page shift */
32
+#define PAGE_SHIFT 12
33
+
31 34
 /*
32 35
  * Physical<->Bus and Bus<->I/O address mappings
33 36
  *

+ 6
- 0
src/include/ipxe/io.h 查看文件

@@ -23,6 +23,12 @@ FILE_LICENCE ( GPL2_OR_LATER );
23 23
 #include <config/ioapi.h>
24 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 33
  * Calculate static inline I/O API function name
28 34
  *

+ 0
- 3
src/include/ipxe/virtio-ring.h 查看文件

@@ -1,8 +1,5 @@
1 1
 #ifndef _VIRTIO_RING_H_
2 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 4
 /* Status byte for guest to report progress, and synchronize features. */
8 5
 /* We have seen device and processed generic fields (VIRTIO_CONFIG_F_VIRTIO) */

正在加载...
取消
保存