david/ipxe
Archived
1
0

[ioapi] Centralise notion of PAGE_SIZE

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2014-07-26 15:31:08 +01:00
parent 6153c09c41
commit ec30c856a8
3 changed files with 9 additions and 3 deletions

View File

@ -28,6 +28,9 @@ FILE_LICENCE ( GPL2_OR_LATER );
*
*/
/** Page shift */
#define PAGE_SHIFT 12
/*
* Physical<->Bus and Bus<->I/O address mappings
*

View 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
*

View 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) */