소스 검색

[ioapi] Centralise notion of PAGE_SIZE

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 9 년 전
부모
커밋
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) */

Loading…
취소
저장