Skip to content

Commit

Permalink
[ioapi] Centralise notion of PAGE_SIZE
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Jul 28, 2014
1 parent 6153c09 commit ec30c85
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/arch/x86/include/ipxe/x86_io.h
Expand Up @@ -28,6 +28,9 @@ FILE_LICENCE ( GPL2_OR_LATER );
*
*/

/** Page shift */
#define PAGE_SHIFT 12

/*
* Physical<->Bus and Bus<->I/O address mappings
*
Expand Down
6 changes: 6 additions & 0 deletions src/include/ipxe/io.h
Expand Up @@ -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
*
Expand Down
3 changes: 0 additions & 3 deletions src/include/ipxe/virtio-ring.h
@@ -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) */
Expand Down

0 comments on commit ec30c85

Please sign in to comment.